LKML Archive on lore.kernel.org help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux.com> To: Vladimir Davydov <vdavydov@parallels.com> Cc: Andrew Morton <akpm@linux-foundation.org>, Pekka Enberg <penberg@kernel.org>, David Rientjes <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@suse.cz>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -mm 1/3] slub: don't fail kmem_cache_shrink if slab placement optimization fails Date: Mon, 26 Jan 2015 12:24:49 -0600 (CST) [thread overview] Message-ID: <alpine.DEB.2.11.1501261216120.16638@gentwo.org> (raw) In-Reply-To: <20150126170147.GB28978@esperanza> On Mon, 26 Jan 2015, Vladimir Davydov wrote: > Anyways, I think that silently relying on the fact that the allocator > never fails small allocations is kind of unreliable. What if this We are not doing that though. If the allocation fails we do nothing. > > > + if (page->inuse < objects) > > > + list_move(&page->lru, > > > + slabs_by_inuse + page->inuse); > > > if (!page->inuse) > > > n->nr_partial--; > > > } > > > > The condition is always true. A page that has page->inuse == objects > > would not be on the partial list. > > > > This is in case we failed to allocate the slabs_by_inuse array. We only > have a list for empty slabs then (on stack). Ok in that case objects == 1. If you want to do this maybe do it in a more general way? You could allocate an array on the stack to deal with the common cases. I believe an array of 32 objects would be fine to allocate and cover most of the slab caches on the system? Would eliminate most of the allocations in kmem_cache_shrink.
next prev parent reply other threads:[~2015-01-26 18:24 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-01-26 12:55 [PATCH -mm 0/3] slub: make dead caches discard free slabs immediately Vladimir Davydov 2015-01-26 12:55 ` [PATCH -mm 1/3] slub: don't fail kmem_cache_shrink if slab placement optimization fails Vladimir Davydov 2015-01-26 15:48 ` Christoph Lameter 2015-01-26 17:01 ` Vladimir Davydov 2015-01-26 18:24 ` Christoph Lameter [this message] 2015-01-26 19:36 ` Vladimir Davydov 2015-01-26 19:53 ` Christoph Lameter 2015-01-27 12:58 ` Vladimir Davydov 2015-01-27 17:02 ` Christoph Lameter 2015-01-28 15:00 ` Vladimir Davydov 2015-01-26 12:55 ` [PATCH -mm 2/3] slab: zap kmem_cache_shrink return value Vladimir Davydov 2015-01-26 15:49 ` Christoph Lameter 2015-01-26 17:04 ` Vladimir Davydov 2015-01-26 18:26 ` Christoph Lameter 2015-01-26 19:48 ` Vladimir Davydov 2015-01-26 19:55 ` Christoph Lameter 2015-01-26 20:16 ` Vladimir Davydov 2015-01-26 20:28 ` Christoph Lameter 2015-01-26 20:43 ` Vladimir Davydov 2015-01-26 12:55 ` [PATCH -mm 3/3] slub: make dead caches discard free slabs immediately Vladimir Davydov 2015-01-27 8:00 ` Joonsoo Kim 2015-01-27 8:23 ` Vladimir Davydov 2015-01-27 9:21 ` Joonsoo Kim 2015-01-27 9:28 ` Vladimir Davydov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=alpine.DEB.2.11.1501261216120.16638@gentwo.org \ --to=cl@linux.com \ --cc=akpm@linux-foundation.org \ --cc=hannes@cmpxchg.org \ --cc=iamjoonsoo.kim@lge.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=mhocko@suse.cz \ --cc=penberg@kernel.org \ --cc=rientjes@google.com \ --cc=vdavydov@parallels.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).