The patch titled Subject: slub: fix kmem_cache_shrink return value has been added to the -mm tree. Its filename is slub-fix-kmem_cache_shrink-return-value.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/slub-fix-kmem_cache_shrink-return-value.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/slub-fix-kmem_cache_shrink-return-value.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Vladimir Davydov <vdavydov@xxxxxxxxxxxxx> Subject: slub: fix kmem_cache_shrink return value It is supposed to return 0 if the cache has no remaining objects and 1 otherwise, while currently it always returns 0. Fix it. Signed-off-by: Vladimir Davydov <vdavydov@xxxxxxxxxxxxx> Acked-by: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/slub.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff -puN mm/slub.c~slub-fix-kmem_cache_shrink-return-value mm/slub.c --- a/mm/slub.c~slub-fix-kmem_cache_shrink-return-value +++ a/mm/slub.c @@ -3379,6 +3379,7 @@ int __kmem_cache_shrink(struct kmem_cach LIST_HEAD(discard); struct list_head promote[SHRINK_PROMOTE_MAX]; unsigned long flags; + int ret = 0; for (i = 0; i < SHRINK_PROMOTE_MAX; i++) INIT_LIST_HEAD(promote + i); @@ -3424,9 +3425,12 @@ int __kmem_cache_shrink(struct kmem_cach /* Release empty slabs */ list_for_each_entry_safe(page, t, &discard, lru) discard_slab(s, page); + + if (slabs_node(s, node)) + ret = 1; } - return 0; + return ret; } static int slab_mem_going_offline_callback(void *arg) _ Patches currently in -mm which might be from vdavydov@xxxxxxxxxxxxx are origin.patch memcg-zap-__memcg_chargeuncharge_slab.patch memcg-zap-memcg_name-argument-of-memcg_create_kmem_cache.patch memcg-zap-memcg_slab_caches-and-memcg_slab_mutex.patch swap-remove-unused-mem_cgroup_uncharge_swapcache-declaration.patch mm-memcontrol-track-move_lock-state-internally.patch mm-vmscan-wake-up-all-pfmemalloc-throttled-processes-at-once.patch list_lru-introduce-list_lru_shrink_countwalk.patch fs-consolidate-nrfree_cached_objects-args-in-shrink_control.patch vmscan-per-memory-cgroup-slab-shrinkers.patch memcg-rename-some-cache-id-related-variables.patch memcg-add-rwsem-to-synchronize-against-memcg_caches-arrays-relocation.patch list_lru-get-rid-of-active_nodes.patch list_lru-organize-all-list_lrus-to-list.patch list_lru-introduce-per-memcg-lists.patch fs-make-shrinker-memcg-aware.patch vmscan-force-scan-offline-memory-cgroups.patch vmscan-force-scan-offline-memory-cgroups-fix.patch mm-page_counter-pull-1-handling-out-of-page_counter_memparse.patch mm-memcontrol-default-hierarchy-interface-for-memory.patch mm-memcontrol-fold-move_anon-and-move_file.patch mm-memcontrol-fold-move_anon-and-move_file-fix.patch mm-memcontrol-simplify-soft-limit-tree-init-code.patch mm-memcontrol-consolidate-memory-controller-initialization.patch mm-memcontrol-consolidate-swap-controller-code.patch fs-shrinker-always-scan-at-least-one-object-of-each-type.patch fs-shrinker-always-scan-at-least-one-object-of-each-type-fix.patch mm-vmscan-fix-the-page-state-calculation-in-too_many_isolated.patch mm-vmscan-fix-the-page-state-calculation-in-too_many_isolated-fix.patch slab-embed-memcg_cache_params-to-kmem_cache.patch slab-embed-memcg_cache_params-to-kmem_cache-fix.patch slab-link-memcg-caches-of-the-same-kind-into-a-list.patch slab-link-memcg-caches-of-the-same-kind-into-a-list-fix.patch cgroup-release-css-id-after-css_free.patch slab-use-css-id-for-naming-per-memcg-caches.patch memcg-free-memcg_caches-slot-on-css-offline.patch list_lru-add-helpers-to-isolate-items.patch memcg-reparent-list_lrus-and-free-kmemcg_id-on-css-offline.patch slub-never-fail-to-shrink-cache.patch slub-fix-kmem_cache_shrink-return-value.patch slub-make-dead-caches-discard-free-slabs-immediately.patch vmstat-do-not-use-deferrable-delayed-work-for-vmstat_update.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html