From: David Rientjes <rientjes@google.com>
To: Shaohua Li <shaohua.li@intel.com>
Cc: "Shi, Alex" <alex.shi@intel.com>,
Christoph Lameter <cl@linux.com>,
"penberg@kernel.org" <penberg@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/3] slub: set a criteria for slub node partial adding
Date: Tue, 6 Dec 2011 23:28:27 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.00.1112062319010.21785@chino.kir.corp.google.com> (raw)
In-Reply-To: <1323234673.22361.372.camel@sli10-conroe>
On Wed, 7 Dec 2011, Shaohua Li wrote:
> interesting. I did similar experiment before (try to sort the page
> according to free number), but it appears quite hard. The free number of
> a page is dynamic, eg more slabs can be freed when the page is in
> partial list. And in netperf test, the partial list could be very very
> long. Can you post your patch, I definitely what to look at it.
It was over a couple of years ago and the slub code has changed
significantly since then, but you can see the general concept of the "slab
thrashing" problem with netperf and my solution back then:
http://marc.info/?l=linux-kernel&m=123839191416478
http://marc.info/?l=linux-kernel&m=123839203016592
http://marc.info/?l=linux-kernel&m=123839202916583
I also had a separate patchset that, instead of this approach, would just
iterate through the partial list in get_partial_node() looking for
anything where the number of free objects met a certain threshold, which
still defaulted to 25% and instantly picked it. The overhead was taking
slab_lock() for each page, but that was nullified by the performance
speedup of using the alloc fastpath a majority of the time for both
kmalloc-256 and kmalloc-2k when in the past it had only been able to serve
one or two allocs. If no partial slab met the threshold, the slab_lock()
is held of the partial slab with the most free objects and returned
instead.
> What I have about the partial list is it wastes a lot of memory.
That's not going to be helped with the above approach since we typically
try to fill a partial slab with many free objects, but it also won't be
severely impacted because if the threshold is kept small enough, then we
simply return the first partial slab that meets the criteria. That allows
the partial slabs at the end of the list to hopefully become mostly free.
And, for completeness, there's also a possibility that you have some
completely free slabs on the partial list that coule be freed back to the
buddy allocator by decreasing min_partial by way of
/sys/kernel/slab/cache/min_partial at the risk of performance and then
invoke /sys/kernel/slab/cache/shrink to free the unused slabs.
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-12-07 7:28 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-02 8:23 Alex Shi
2011-12-02 8:23 ` [PATCH 2/3] slub: remove unnecessary statistics, deactivate_to_head/tail Alex Shi
2011-12-02 8:23 ` [PATCH 3/3] slub: fill per cpu partial only when free objects larger than one quarter Alex Shi
2011-12-02 14:44 ` [PATCH 2/3] slub: remove unnecessary statistics, deactivate_to_head/tail Christoph Lameter
2011-12-06 21:08 ` David Rientjes
2011-12-02 11:36 ` [PATCH 1/3] slub: set a criteria for slub node partial adding Eric Dumazet
2011-12-02 20:02 ` Christoph Lameter
2011-12-05 2:21 ` Shaohua Li
2011-12-05 10:01 ` Alex,Shi
2011-12-05 3:28 ` Alex,Shi
2011-12-02 14:43 ` Christoph Lameter
2011-12-05 9:22 ` Alex,Shi
2011-12-06 21:06 ` David Rientjes
2011-12-07 5:11 ` Shaohua Li
2011-12-07 7:28 ` David Rientjes [this message]
2011-12-12 2:43 ` Shaohua Li
2011-12-12 4:14 ` Alex,Shi
2011-12-12 4:35 ` Shaohua Li
2011-12-12 4:25 ` Alex,Shi
2011-12-12 4:48 ` Shaohua Li
2011-12-12 6:17 ` Alex,Shi
2011-12-12 6:09 ` Eric Dumazet
2011-12-14 1:29 ` David Rientjes
2011-12-14 2:43 ` Shaohua Li
2011-12-14 2:38 ` David Rientjes
2011-12-09 8:30 ` Alex,Shi
2011-12-09 10:10 ` David Rientjes
2011-12-09 13:40 ` Shi, Alex
2011-12-14 1:38 ` David Rientjes
2011-12-14 2:36 ` David Rientjes
2011-12-14 6:06 ` Alex,Shi
2011-12-14 6:44 ` Eric Dumazet
2011-12-14 6:47 ` Pekka Enberg
2011-12-14 14:53 ` Christoph Lameter
2011-12-14 6:56 ` Alex,Shi
2011-12-14 14:59 ` Christoph Lameter
2011-12-14 17:33 ` Eric Dumazet
2011-12-14 18:26 ` Christoph Lameter
2011-12-13 13:01 ` Shi, Alex
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.00.1112062319010.21785@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=ak@linux.intel.com \
--cc=alex.shi@intel.com \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=shaohua.li@intel.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: link
Be 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