Re: [PATCH -mm 3/3] slub: make dead caches discard free slabs immediately
From: Vladimir Davydov <hidden>
Date: 2015-01-27 09:28:58
Also in:
lkml
On Tue, Jan 27, 2015 at 06:21:14PM +0900, Joonsoo Kim wrote:
2015-01-27 17:23 GMT+09:00 Vladimir Davydov [off-list ref]:quoted
Hi Joonsoo, On Tue, Jan 27, 2015 at 05:00:09PM +0900, Joonsoo Kim wrote:quoted
On Mon, Jan 26, 2015 at 03:55:29PM +0300, Vladimir Davydov wrote:quoted
@@ -3381,6 +3390,15 @@ void __kmem_cache_shrink(struct kmem_cache *s) kmalloc(sizeof(struct list_head) * objects, GFP_KERNEL); unsigned long flags; + if (deactivate) { + /* + * Disable empty slabs caching. Used to avoid pinning offline + * memory cgroups by freeable kmem pages. + */ + s->cpu_partial = 0; + s->min_partial = 0; + } +Maybe, kick_all_cpus_sync() is needed here since object would be freed asynchronously so they can't see this updated value.I thought flush_all() should do the trick, no?Unfortunately, it doesn't. flush_all() sends IPI to not all cpus. It only sends IPI to cpus where some conditions are met and freeing could occur on the other ones.
Oh, true, missed that. Yeah, we should kick all cpus explicitly then. Will fix in the next iteration. Thanks for catching this! Thanks, Vladimir -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>