From: Sasha Levin Date: Sun, 24 May 2020 13:51:24 +0000 (-0400) Subject: Fixes for 5.6 X-Git-Tag: v4.4.225~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55dc903d6b214ae9e3f232d5f978351a8a22b50d;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.6 Signed-off-by: Sasha Levin --- diff --git a/queue-5.6/kbuild-remove-debug-info-from-kallsyms-linking.patch b/queue-5.6/kbuild-remove-debug-info-from-kallsyms-linking.patch new file mode 100644 index 00000000000..2b6e7053e43 --- /dev/null +++ b/queue-5.6/kbuild-remove-debug-info-from-kallsyms-linking.patch @@ -0,0 +1,142 @@ +From 1dbfb1da249d7b9fec6042554708c77d7814fe24 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Mar 2020 18:18:34 -0800 +Subject: kbuild: Remove debug info from kallsyms linking + +From: Kees Cook + +[ Upstream commit af73d78bd384aa9b8789aa6e7ddbb165f971276f ] + +When CONFIG_DEBUG_INFO is enabled, the two kallsyms linking steps spend +time collecting and writing the dwarf sections to the temporary output +files. kallsyms does not need this information, and leaving it off +halves their linking time. This is especially noticeable without +CONFIG_DEBUG_INFO_REDUCED. The BTF linking stage, however, does still +need those details. + +Refactor the BTF and kallsyms generation stages slightly for more +regularized temporary names. Skip debug during kallsyms links. +Additionally move "info BTF" to the correct place since commit +8959e39272d6 ("kbuild: Parameterize kallsyms generation and correct +reporting"), which added "info LD ..." to vmlinux_link calls. + +For a full debug info build with BTF, my link time goes from 1m06s to +0m54s, saving about 12 seconds, or 18%. + +Signed-off-by: Kees Cook +Signed-off-by: Daniel Borkmann +Acked-by: Andrii Nakryiko +Link: https://lore.kernel.org/bpf/202003031814.4AEA3351@keescook +Signed-off-by: Sasha Levin +--- + scripts/link-vmlinux.sh | 28 +++++++++++++++++++--------- + 1 file changed, 19 insertions(+), 9 deletions(-) + +diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh +index dd484e92752e..ac569e197bfa 100755 +--- a/scripts/link-vmlinux.sh ++++ b/scripts/link-vmlinux.sh +@@ -63,12 +63,18 @@ vmlinux_link() + local lds="${objtree}/${KBUILD_LDS}" + local output=${1} + local objects ++ local strip_debug + + info LD ${output} + + # skip output file argument + shift + ++ # The kallsyms linking does not need debug symbols included. ++ if [ "$output" != "${output#.tmp_vmlinux.kallsyms}" ] ; then ++ strip_debug=-Wl,--strip-debug ++ fi ++ + if [ "${SRCARCH}" != "um" ]; then + objects="--whole-archive \ + ${KBUILD_VMLINUX_OBJS} \ +@@ -79,6 +85,7 @@ vmlinux_link() + ${@}" + + ${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} \ ++ ${strip_debug#-Wl,} \ + -o ${output} \ + -T ${lds} ${objects} + else +@@ -91,6 +98,7 @@ vmlinux_link() + ${@}" + + ${CC} ${CFLAGS_vmlinux} \ ++ ${strip_debug} \ + -o ${output} \ + -Wl,-T,${lds} \ + ${objects} \ +@@ -106,6 +114,8 @@ gen_btf() + { + local pahole_ver + local bin_arch ++ local bin_format ++ local bin_file + + if ! [ -x "$(command -v ${PAHOLE})" ]; then + echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available" +@@ -118,8 +128,9 @@ gen_btf() + return 1 + fi + +- info "BTF" ${2} + vmlinux_link ${1} ++ ++ info "BTF" ${2} + LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1} + + # dump .BTF section into raw binary file to link with final vmlinux +@@ -127,11 +138,12 @@ gen_btf() + cut -d, -f1 | cut -d' ' -f2) + bin_format=$(LANG=C ${OBJDUMP} -f ${1} | grep 'file format' | \ + awk '{print $4}') ++ bin_file=.btf.vmlinux.bin + ${OBJCOPY} --change-section-address .BTF=0 \ + --set-section-flags .BTF=alloc -O binary \ +- --only-section=.BTF ${1} .btf.vmlinux.bin ++ --only-section=.BTF ${1} $bin_file + ${OBJCOPY} -I binary -O ${bin_format} -B ${bin_arch} \ +- --rename-section .data=.BTF .btf.vmlinux.bin ${2} ++ --rename-section .data=.BTF $bin_file ${2} + } + + # Create ${2} .o file with all symbols from the ${1} object file +@@ -166,8 +178,8 @@ kallsyms() + kallsyms_step() + { + kallsymso_prev=${kallsymso} +- kallsymso=.tmp_kallsyms${1}.o +- kallsyms_vmlinux=.tmp_vmlinux${1} ++ kallsyms_vmlinux=.tmp_vmlinux.kallsyms${1} ++ kallsymso=${kallsyms_vmlinux}.o + + vmlinux_link ${kallsyms_vmlinux} "${kallsymso_prev}" ${btf_vmlinux_bin_o} + kallsyms ${kallsyms_vmlinux} ${kallsymso} +@@ -190,7 +202,6 @@ cleanup() + { + rm -f .btf.* + rm -f .tmp_System.map +- rm -f .tmp_kallsyms* + rm -f .tmp_vmlinux* + rm -f System.map + rm -f vmlinux +@@ -257,9 +268,8 @@ tr '\0' '\n' < modules.builtin.modinfo | sed -n 's/^[[:alnum:]:_]*\.file=//p' | + + btf_vmlinux_bin_o="" + if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then +- if gen_btf .tmp_vmlinux.btf .btf.vmlinux.bin.o ; then +- btf_vmlinux_bin_o=.btf.vmlinux.bin.o +- else ++ btf_vmlinux_bin_o=.btf.vmlinux.bin.o ++ if ! gen_btf .tmp_vmlinux.btf $btf_vmlinux_bin_o ; then + echo >&2 "Failed to generate BTF for vmlinux" + echo >&2 "Try to disable CONFIG_DEBUG_INFO_BTF" + exit 1 +-- +2.25.1 + diff --git a/queue-5.6/revert-amba-initialize-dma_parms-for-amba-devices.patch b/queue-5.6/revert-amba-initialize-dma_parms-for-amba-devices.patch new file mode 100644 index 00000000000..552fdded849 --- /dev/null +++ b/queue-5.6/revert-amba-initialize-dma_parms-for-amba-devices.patch @@ -0,0 +1,41 @@ +From 97995883439df70966bc1a02c32dd1abee231ab5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 1 Apr 2020 08:03:28 +0200 +Subject: Revert "amba: Initialize dma_parms for amba devices" + +From: Greg Kroah-Hartman + +[ Upstream commit a9d68cbd4f8834d126ebdd3097a1dee1c5973fdf ] + +This reverts commit 5caf6102e32ead7ed5d21b5309c1a4a7d70e6a9f. It still +needs some more work and that will happen for the next release cycle, +not this one. + +Cc: +Cc: Russell King +Cc: Christoph Hellwig +Cc: Ludovic Barre +Cc: Linus Walleij +Cc: Arnd Bergmann +Cc: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + include/linux/amba/bus.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h +index 0bbfd647f5c6..26f0ecf401ea 100644 +--- a/include/linux/amba/bus.h ++++ b/include/linux/amba/bus.h +@@ -65,7 +65,6 @@ struct amba_device { + struct device dev; + struct resource res; + struct clk *pclk; +- struct device_dma_parameters dma_parms; + unsigned int periphid; + unsigned int cid; + struct amba_cs_uci_id uci; +-- +2.25.1 + diff --git a/queue-5.6/revert-driver-core-platform-initialize-dma_parms-for.patch b/queue-5.6/revert-driver-core-platform-initialize-dma_parms-for.patch new file mode 100644 index 00000000000..4e265aed806 --- /dev/null +++ b/queue-5.6/revert-driver-core-platform-initialize-dma_parms-for.patch @@ -0,0 +1,55 @@ +From bb073ee484efb54ed09d63dd4d667d83fbd7234f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 23 May 2020 22:21:13 -0400 +Subject: Revert "driver core: platform: Initialize dma_parms for platform + devices" + +[ Upstream commit 1d2a14649ef5b5eb64ea5ce276d7df502bac4dbe ] + +[ Upstream commit 885a64715fd81e6af6d94a038556e0b2e6deb19c ] + +This reverts commit 7c8978c0837d40c302f5e90d24c298d9ca9fc097, a new +version will come in the next release cycle. + +Cc: +Cc: Russell King +Cc: Christoph Hellwig +Cc: Ludovic Barre +Cc: Linus Walleij +Cc: Arnd Bergmann +Cc: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/base/platform.c | 2 -- + include/linux/platform_device.h | 1 - + 2 files changed, 3 deletions(-) + +diff --git a/drivers/base/platform.c b/drivers/base/platform.c +index c81b68d5d66d..b5ce7b085795 100644 +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -361,8 +361,6 @@ struct platform_object { + */ + static void setup_pdev_dma_masks(struct platform_device *pdev) + { +- pdev->dev.dma_parms = &pdev->dma_parms; +- + if (!pdev->dev.coherent_dma_mask) + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + if (!pdev->dev.dma_mask) { +diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h +index 81900b3cbe37..041bfa412aa0 100644 +--- a/include/linux/platform_device.h ++++ b/include/linux/platform_device.h +@@ -25,7 +25,6 @@ struct platform_device { + bool id_auto; + struct device dev; + u64 platform_dma_mask; +- struct device_dma_parameters dma_parms; + u32 num_resources; + struct resource *resource; + +-- +2.25.1 + diff --git a/queue-5.6/revert-gfs2-don-t-demote-a-glock-until-its-revokes-a.patch b/queue-5.6/revert-gfs2-don-t-demote-a-glock-until-its-revokes-a.patch new file mode 100644 index 00000000000..71b89ccd970 --- /dev/null +++ b/queue-5.6/revert-gfs2-don-t-demote-a-glock-until-its-revokes-a.patch @@ -0,0 +1,48 @@ +From 3e68b7d2266cf71dbfec9fcc2df117903036d6d4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 May 2020 15:01:25 -0500 +Subject: Revert "gfs2: Don't demote a glock until its revokes are written" + +From: Bob Peterson + +[ Upstream commit b14c94908b1b884276a6608dea3d0b1b510338b7 ] + +This reverts commit df5db5f9ee112e76b5202fbc331f990a0fc316d6. + +This patch fixes a regression: patch df5db5f9ee112 allowed function +run_queue() to bypass its call to do_xmote() if revokes were queued for +the glock. That's wrong because its call to do_xmote() is what is +responsible for calling the go_sync() glops functions to sync both +the ail list and any revokes queued for it. By bypassing the call, +gfs2 could get into a stand-off where the glock could not be demoted +until its revokes are written back, but the revokes would not be +written back because do_xmote() was never called. + +It "sort of" works, however, because there are other mechanisms like +the log flush daemon (logd) that can sync the ail items and revokes, +if it deems it necessary. The problem is: without file system pressure, +it might never deem it necessary. + +Signed-off-by: Bob Peterson +Signed-off-by: Sasha Levin +--- + fs/gfs2/glock.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c +index 19ebc6cd0f2b..d0eceaff3cea 100644 +--- a/fs/gfs2/glock.c ++++ b/fs/gfs2/glock.c +@@ -645,9 +645,6 @@ __acquires(&gl->gl_lockref.lock) + goto out_unlock; + if (nonblock) + goto out_sched; +- smp_mb(); +- if (atomic_read(&gl->gl_revokes) != 0) +- goto out_sched; + set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags); + GLOCK_BUG_ON(gl, gl->gl_demote_state == LM_ST_EXCLUSIVE); + gl->gl_target = gl->gl_demote_state; +-- +2.25.1 + diff --git a/queue-5.6/series b/queue-5.6/series index 947f5753146..95e3b4388ea 100644 --- a/queue-5.6/series +++ b/queue-5.6/series @@ -82,3 +82,9 @@ dmaengine-owl-use-correct-lock-in-owl_dma_get_pchan.patch vsprintf-don-t-obfuscate-null-and-error-pointers.patch drm-i915-gvt-init-dpll-ddi-vreg-for-virtual-display-instead-of-inheritance.patch drm-i915-propagate-error-from-completed-fences.patch +revert-gfs2-don-t-demote-a-glock-until-its-revokes-a.patch +virtio-balloon-revert-virtio-balloon-switch-back-to-.patch +revert-amba-initialize-dma_parms-for-amba-devices.patch +revert-driver-core-platform-initialize-dma_parms-for.patch +tools-bootconfig-fix-apply_xbc-to-return-zero-on-suc.patch +kbuild-remove-debug-info-from-kallsyms-linking.patch diff --git a/queue-5.6/tools-bootconfig-fix-apply_xbc-to-return-zero-on-suc.patch b/queue-5.6/tools-bootconfig-fix-apply_xbc-to-return-zero-on-suc.patch new file mode 100644 index 00000000000..b9974c29eb5 --- /dev/null +++ b/queue-5.6/tools-bootconfig-fix-apply_xbc-to-return-zero-on-suc.patch @@ -0,0 +1,39 @@ +From d76f36bbee7c45721965cf8e202a402c9a9b10cc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 May 2020 11:07:56 -0400 +Subject: tools/bootconfig: Fix apply_xbc() to return zero on success + +From: Steven Rostedt (VMware) + +[ Upstream commit 9d82ccda2bc5c148060543d249d54f8703741bb4 ] + +The return of apply_xbc() returns the result of the last write() call, which +is not what is expected. It should only return zero on success. + +Link: https://lore.kernel.org/r/20200508093059.GF9365@kadam + +Fixes: 8842604446d1 ("tools/bootconfig: Fix resource leak in apply_xbc()") +Reported-by: Dan Carpenter +Acked-by: Masami Hiramatsu +Tested-by: Masami Hiramatsu +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Sasha Levin +--- + tools/bootconfig/main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c +index 5dbe893cf00c..37fb2e85de12 100644 +--- a/tools/bootconfig/main.c ++++ b/tools/bootconfig/main.c +@@ -310,6 +310,7 @@ int apply_xbc(const char *path, const char *xbc_path) + pr_err("Failed to apply a boot config magic: %d\n", ret); + goto out; + } ++ ret = 0; + out: + close(fd); + free(data); +-- +2.25.1 + diff --git a/queue-5.6/virtio-balloon-revert-virtio-balloon-switch-back-to-.patch b/queue-5.6/virtio-balloon-revert-virtio-balloon-switch-back-to-.patch new file mode 100644 index 00000000000..8bbfa140fcf --- /dev/null +++ b/queue-5.6/virtio-balloon-revert-virtio-balloon-switch-back-to-.patch @@ -0,0 +1,206 @@ +From 9da5cb9ec496f0fb1a28b88ce3e6c33f0494d713 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 7 Apr 2020 05:43:30 -0400 +Subject: virtio-balloon: Revert "virtio-balloon: Switch back to OOM handler + for VIRTIO_BALLOON_F_DEFLATE_ON_OOM" + +From: Michael S. Tsirkin + +[ Upstream commit 835a6a649d0dd1b1f46759eb60fff2f63ed253a7 ] + +This reverts commit 5a6b4cc5b7a1892a8d7f63d6cbac6e0ae2a9d031. + +It has been queued properly in the akpm tree, this version is just +creating conflicts. + +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Sasha Levin +--- + drivers/virtio/virtio_balloon.c | 107 +++++++++++++++++++------------- + 1 file changed, 63 insertions(+), 44 deletions(-) + +diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c +index 44375a22307b..341458fd95ca 100644 +--- a/drivers/virtio/virtio_balloon.c ++++ b/drivers/virtio/virtio_balloon.c +@@ -14,7 +14,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -28,9 +27,7 @@ + */ + #define VIRTIO_BALLOON_PAGES_PER_PAGE (unsigned)(PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT) + #define VIRTIO_BALLOON_ARRAY_PFNS_MAX 256 +-/* Maximum number of (4k) pages to deflate on OOM notifications. */ +-#define VIRTIO_BALLOON_OOM_NR_PAGES 256 +-#define VIRTIO_BALLOON_OOM_NOTIFY_PRIORITY 80 ++#define VIRTBALLOON_OOM_NOTIFY_PRIORITY 80 + + #define VIRTIO_BALLOON_FREE_PAGE_ALLOC_FLAG (__GFP_NORETRY | __GFP_NOWARN | \ + __GFP_NOMEMALLOC) +@@ -115,11 +112,8 @@ struct virtio_balloon { + /* Memory statistics */ + struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR]; + +- /* Shrinker to return free pages - VIRTIO_BALLOON_F_FREE_PAGE_HINT */ ++ /* To register a shrinker to shrink memory upon memory pressure */ + struct shrinker shrinker; +- +- /* OOM notifier to deflate on OOM - VIRTIO_BALLOON_F_DEFLATE_ON_OOM */ +- struct notifier_block oom_nb; + }; + + static struct virtio_device_id id_table[] = { +@@ -794,13 +788,50 @@ static unsigned long shrink_free_pages(struct virtio_balloon *vb, + return blocks_freed * VIRTIO_BALLOON_HINT_BLOCK_PAGES; + } + ++static unsigned long leak_balloon_pages(struct virtio_balloon *vb, ++ unsigned long pages_to_free) ++{ ++ return leak_balloon(vb, pages_to_free * VIRTIO_BALLOON_PAGES_PER_PAGE) / ++ VIRTIO_BALLOON_PAGES_PER_PAGE; ++} ++ ++static unsigned long shrink_balloon_pages(struct virtio_balloon *vb, ++ unsigned long pages_to_free) ++{ ++ unsigned long pages_freed = 0; ++ ++ /* ++ * One invocation of leak_balloon can deflate at most ++ * VIRTIO_BALLOON_ARRAY_PFNS_MAX balloon pages, so we call it ++ * multiple times to deflate pages till reaching pages_to_free. ++ */ ++ while (vb->num_pages && pages_freed < pages_to_free) ++ pages_freed += leak_balloon_pages(vb, ++ pages_to_free - pages_freed); ++ ++ update_balloon_size(vb); ++ ++ return pages_freed; ++} ++ + static unsigned long virtio_balloon_shrinker_scan(struct shrinker *shrinker, + struct shrink_control *sc) + { ++ unsigned long pages_to_free, pages_freed = 0; + struct virtio_balloon *vb = container_of(shrinker, + struct virtio_balloon, shrinker); + +- return shrink_free_pages(vb, sc->nr_to_scan); ++ pages_to_free = sc->nr_to_scan; ++ ++ if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) ++ pages_freed = shrink_free_pages(vb, pages_to_free); ++ ++ if (pages_freed >= pages_to_free) ++ return pages_freed; ++ ++ pages_freed += shrink_balloon_pages(vb, pages_to_free - pages_freed); ++ ++ return pages_freed; + } + + static unsigned long virtio_balloon_shrinker_count(struct shrinker *shrinker, +@@ -808,22 +839,26 @@ static unsigned long virtio_balloon_shrinker_count(struct shrinker *shrinker, + { + struct virtio_balloon *vb = container_of(shrinker, + struct virtio_balloon, shrinker); ++ unsigned long count; ++ ++ count = vb->num_pages / VIRTIO_BALLOON_PAGES_PER_PAGE; ++ count += vb->num_free_page_blocks * VIRTIO_BALLOON_HINT_BLOCK_PAGES; + +- return vb->num_free_page_blocks * VIRTIO_BALLOON_HINT_BLOCK_PAGES; ++ return count; + } + +-static int virtio_balloon_oom_notify(struct notifier_block *nb, +- unsigned long dummy, void *parm) ++static void virtio_balloon_unregister_shrinker(struct virtio_balloon *vb) + { +- struct virtio_balloon *vb = container_of(nb, +- struct virtio_balloon, oom_nb); +- unsigned long *freed = parm; ++ unregister_shrinker(&vb->shrinker); ++} + +- *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / +- VIRTIO_BALLOON_PAGES_PER_PAGE; +- update_balloon_size(vb); ++static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) ++{ ++ vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; ++ vb->shrinker.count_objects = virtio_balloon_shrinker_count; ++ vb->shrinker.seeks = DEFAULT_SEEKS; + +- return NOTIFY_OK; ++ return register_shrinker(&vb->shrinker); + } + + static int virtballoon_probe(struct virtio_device *vdev) +@@ -900,35 +935,22 @@ static int virtballoon_probe(struct virtio_device *vdev) + virtio_cwrite(vb->vdev, struct virtio_balloon_config, + poison_val, &poison_val); + } +- +- /* +- * We're allowed to reuse any free pages, even if they are +- * still to be processed by the host. +- */ +- vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; +- vb->shrinker.count_objects = virtio_balloon_shrinker_count; +- vb->shrinker.seeks = DEFAULT_SEEKS; +- err = register_shrinker(&vb->shrinker); ++ } ++ /* ++ * We continue to use VIRTIO_BALLOON_F_DEFLATE_ON_OOM to decide if a ++ * shrinker needs to be registered to relieve memory pressure. ++ */ ++ if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) { ++ err = virtio_balloon_register_shrinker(vb); + if (err) + goto out_del_balloon_wq; + } +- if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) { +- vb->oom_nb.notifier_call = virtio_balloon_oom_notify; +- vb->oom_nb.priority = VIRTIO_BALLOON_OOM_NOTIFY_PRIORITY; +- err = register_oom_notifier(&vb->oom_nb); +- if (err < 0) +- goto out_unregister_shrinker; +- } +- + virtio_device_ready(vdev); + + if (towards_target(vb)) + virtballoon_changed(vdev); + return 0; + +-out_unregister_shrinker: +- if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) +- unregister_shrinker(&vb->shrinker); + out_del_balloon_wq: + if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) + destroy_workqueue(vb->balloon_wq); +@@ -967,11 +989,8 @@ static void virtballoon_remove(struct virtio_device *vdev) + { + struct virtio_balloon *vb = vdev->priv; + +- if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) +- unregister_oom_notifier(&vb->oom_nb); +- if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) +- unregister_shrinker(&vb->shrinker); +- ++ if (virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) ++ virtio_balloon_unregister_shrinker(vb); + spin_lock_irq(&vb->stop_update_lock); + vb->stop_update = true; + spin_unlock_irq(&vb->stop_update_lock); +-- +2.25.1 +