All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	Nick Piggin <npiggin@suse.de>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lin Ming <ming.m.lin@intel.com>,
	Christoph Lameter <cl@linux-foundation.org>
Subject: Re: [patch] SLQB slab allocator
Date: Tue, 10 Feb 2009 16:56:48 +0800	[thread overview]
Message-ID: <1234256208.2604.363.camel@ymzhang> (raw)
In-Reply-To: <Pine.LNX.4.64.0902061216001.23313@blonde.anvils>

On Fri, 2009-02-06 at 12:33 +0000, Hugh Dickins wrote:
> On Fri, 6 Feb 2009, Pekka Enberg wrote:
> > On Thu, 2009-02-05 at 19:04 +0000, Hugh Dickins wrote:
> > > I then tried a patch I thought obviously better than yours: just mask
> > > off __GFP_WAIT in that __GFP_NOWARN|__GFP_NORETRY preliminary call to
> > > alloc_slab_page(): so we're not trying to infer anything about high-
> > > order availability from the number of free order-0 pages, but actually
> > > going to look for it and taking it if it's free, forgetting it if not.
> > > 
> > > That didn't work well at all: almost as bad as the unmodified slub.c.
> > > I decided that was due to __alloc_pages_internal()'s
> > > wakeup_kswapd(zone, order): just expressing an interest in a high-
> > > order page was enough to send it off trying to reclaim them, though
> > > not directly.  Hacked in a condition to suppress that in this case:
> > > worked a lot better, but not nearly as well as yours.  I supposed
> > > that was somehow(?) due to the subsequent get_page_from_freelist()
> > > calls with different watermarking: hacked in another __GFP flag to
> > > break out to nopage just like the NUMA_BUILD GFP_THISNODE case does.
> > > Much better, getting close, but still not as good as yours.  
I did the similiar hack. get_page_from_freelist, wakeup_kswapd, try_to_free_pages,
and drain_all_pages consume time. If I disable them one by one, I see the result
is improved gradually.

> > 
> > Did you look at it with oprofile?
> 
> No, I didn't.  I didn't say so, but again it was elapsed time that
> I was focussing on, so I don't think oprofile would be relevant.
The vmstat data varies very much when testing runs. The original test case
consists of 2 kbuild tasks and sometimes the 2 tasks almost run serially
because it takes a long time to untie kernel source tarball on the loop ext2
fs. So it's not appropriate to collect oprofile data.

I changed the script to run 2 tasks on tmpfs without loop ext2 device.
The result difference between slub_max_order=0 and default order is about 25%.
When kernel building is started, vmstat sys time is about 4%~10% on my
2 qual-core processor stoakley. io-wait is mostly 40%~80%. I collected the
oprofile data. Mostly, only free_pages_bulk seems a little abnormal. With
default order, free_pages_bulk is more than 1% while it's 0.23%. By changing
total memory quantity, free_pages_bulk difference between slub_max_order=0 and
default order is about 1%.


> There are some differences in system time, of course, consistent
> with your point; but they're generally an order of magnitude less,
> so didn't excite my interest.
> 
> > One thing to keep in mind is that if
> > there are 4K allocations going on, your approach will get double the
> > overhead of page allocations (which can be substantial performance hit
> > for slab).
> 
> Sure, and even the current allocate_slab() is inefficient in that
> respect: I've followed it because I do for now have an interest in
> the stats, but if stats are configured off then there's no point in
> dividing it into two stages; and if they are really intended to be
> ORDER_FALLBACK stats, then it shouldn't divide into two stages when
> oo_order(s->oo) == oo_order(s->min).
You are right theoretically. Under the real environment, the order mostly is 0
when oo_order(s->oo) == oo_order(s->min), and order 0 page allocation almost
doesn't fail even with flag __GFP_NORETRY. When default order isn't 0, mostly,
oo_order(s->oo) isn't equal to oo_order(s->min).

>   On the other hand, I find it
> interesting to see how often the __GFP_NORETRY fails, even when
> the order is the same each time (and usually 0).



WARNING: multiple messages have this Message-ID (diff)
From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	Nick Piggin <npiggin@suse.de>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lin Ming <ming.m.lin@intel.com>,
	Christoph Lameter <cl@linux-foundation.org>
Subject: Re: [patch] SLQB slab allocator
Date: Tue, 10 Feb 2009 16:56:48 +0800	[thread overview]
Message-ID: <1234256208.2604.363.camel@ymzhang> (raw)
In-Reply-To: <Pine.LNX.4.64.0902061216001.23313@blonde.anvils>

On Fri, 2009-02-06 at 12:33 +0000, Hugh Dickins wrote:
> On Fri, 6 Feb 2009, Pekka Enberg wrote:
> > On Thu, 2009-02-05 at 19:04 +0000, Hugh Dickins wrote:
> > > I then tried a patch I thought obviously better than yours: just mask
> > > off __GFP_WAIT in that __GFP_NOWARN|__GFP_NORETRY preliminary call to
> > > alloc_slab_page(): so we're not trying to infer anything about high-
> > > order availability from the number of free order-0 pages, but actually
> > > going to look for it and taking it if it's free, forgetting it if not.
> > > 
> > > That didn't work well at all: almost as bad as the unmodified slub.c.
> > > I decided that was due to __alloc_pages_internal()'s
> > > wakeup_kswapd(zone, order): just expressing an interest in a high-
> > > order page was enough to send it off trying to reclaim them, though
> > > not directly.  Hacked in a condition to suppress that in this case:
> > > worked a lot better, but not nearly as well as yours.  I supposed
> > > that was somehow(?) due to the subsequent get_page_from_freelist()
> > > calls with different watermarking: hacked in another __GFP flag to
> > > break out to nopage just like the NUMA_BUILD GFP_THISNODE case does.
> > > Much better, getting close, but still not as good as yours.  
I did the similiar hack. i>>?get_page_from_freelist, wakeup_kswapd, try_to_free_pages,
and drain_all_pages consume time. If I disable them one by one, I see the result
is improved gradually.

> > 
> > Did you look at it with oprofile?
> 
> No, I didn't.  I didn't say so, but again it was elapsed time that
> I was focussing on, so I don't think oprofile would be relevant.
The vmstat data varies very much when testing runs. The original test case
consists of 2 kbuild tasks and sometimes the 2 tasks almost run serially
because it takes a long time to untie kernel source tarball on the loop ext2
fs. So it's not appropriate to collect oprofile data.

I changed the script to run 2 tasks on tmpfs without loop ext2 device.
The result difference between slub_max_order=0 and default order is about 25%.
When kernel building is started, vmstat sys time is about 4%~10% on my
2 qual-core processor stoakley. io-wait is mostly 40%~80%. I collected the
oprofile data. Mostly, only free_pages_bulk seems a little abnormal. With
default order, i>>?free_pages_bulk is more than 1% while it's 0.23%. By changing
total memory quantity, i>>?free_pages_bulk difference between i>>?slub_max_order=0 and
default order is about 1%.


> There are some differences in system time, of course, consistent
> with your point; but they're generally an order of magnitude less,
> so didn't excite my interest.
> 
> > One thing to keep in mind is that if
> > there are 4K allocations going on, your approach will get double the
> > overhead of page allocations (which can be substantial performance hit
> > for slab).
> 
> Sure, and even the current allocate_slab() is inefficient in that
> respect: I've followed it because I do for now have an interest in
> the stats, but if stats are configured off then there's no point in
> dividing it into two stages; and if they are really intended to be
> ORDER_FALLBACK stats, then it shouldn't divide into two stages when
> oo_order(s->oo) == oo_order(s->min).
You are right theoretically. Under the real environment, the order mostly is 0
when i>>?oo_order(s->oo) == oo_order(s->min), and order 0 page allocation almost
doesn't fail even with flag i>>?__GFP_NORETRY. When default order isn't 0, mostly,
i>>?oo_order(s->oo) isn't equal to i>>?oo_order(s->min).

>   On the other hand, I find it
> interesting to see how often the __GFP_NORETRY fails, even when
> the order is the same each time (and usually 0).


--
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>

  reply	other threads:[~2009-02-10  8:57 UTC|newest]

Thread overview: 197+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 14:30 [patch] SLQB slab allocator Nick Piggin
2009-01-21 14:30 ` Nick Piggin
2009-01-21 14:59 ` Ingo Molnar
2009-01-21 14:59   ` Ingo Molnar
2009-01-21 15:17   ` Nick Piggin
2009-01-21 15:17     ` Nick Piggin
2009-01-21 16:56   ` Nick Piggin
2009-01-21 16:56     ` Nick Piggin
2009-01-21 17:40     ` Ingo Molnar
2009-01-21 17:40       ` Ingo Molnar
2009-01-23  3:31       ` Nick Piggin
2009-01-23  3:31         ` Nick Piggin
2009-01-23  6:14       ` Nick Piggin
2009-01-23  6:14         ` Nick Piggin
2009-01-23 12:56         ` Ingo Molnar
2009-01-23 12:56           ` Ingo Molnar
2009-01-21 17:59 ` Joe Perches
2009-01-21 17:59   ` Joe Perches
2009-01-23  3:35   ` Nick Piggin
2009-01-23  3:35     ` Nick Piggin
2009-01-23  4:00     ` Joe Perches
2009-01-23  4:00       ` Joe Perches
2009-01-21 18:10 ` Hugh Dickins
2009-01-21 18:10   ` Hugh Dickins
2009-01-22 10:01   ` Pekka Enberg
2009-01-22 10:01     ` Pekka Enberg
2009-01-22 12:47     ` Hugh Dickins
2009-01-22 12:47       ` Hugh Dickins
2009-01-23 14:23       ` Hugh Dickins
2009-01-23 14:23         ` Hugh Dickins
2009-01-23 14:30         ` Pekka Enberg
2009-01-23 14:30           ` Pekka Enberg
2009-02-02  3:38         ` Zhang, Yanmin
2009-02-02  3:38           ` Zhang, Yanmin
2009-02-02  9:00           ` Pekka Enberg
2009-02-02  9:00             ` Pekka Enberg
2009-02-02 15:00             ` Christoph Lameter
2009-02-02 15:00               ` Christoph Lameter
2009-02-03  1:34               ` Zhang, Yanmin
2009-02-03  1:34                 ` Zhang, Yanmin
2009-02-03  7:29             ` Zhang, Yanmin
2009-02-03  7:29               ` Zhang, Yanmin
2009-02-03 12:18               ` Hugh Dickins
2009-02-03 12:18                 ` Hugh Dickins
2009-02-04  2:21                 ` Zhang, Yanmin
2009-02-04  2:21                   ` Zhang, Yanmin
2009-02-05 19:04                   ` Hugh Dickins
2009-02-05 19:04                     ` Hugh Dickins
2009-02-06  0:47                     ` Zhang, Yanmin
2009-02-06  0:47                       ` Zhang, Yanmin
2009-02-06  8:57                     ` Pekka Enberg
2009-02-06  8:57                       ` Pekka Enberg
2009-02-06 12:33                       ` Hugh Dickins
2009-02-06 12:33                         ` Hugh Dickins
2009-02-10  8:56                         ` Zhang, Yanmin [this message]
2009-02-10  8:56                           ` Zhang, Yanmin
2009-02-02 11:50           ` Hugh Dickins
2009-01-23  3:55   ` Nick Piggin
2009-01-23  3:55     ` Nick Piggin
2009-01-23 13:57     ` Hugh Dickins
2009-01-23 13:57       ` Hugh Dickins
2009-01-22  8:45 ` Zhang, Yanmin
2009-01-22  8:45   ` Zhang, Yanmin
2009-01-23  3:57   ` Nick Piggin
2009-01-23  3:57     ` Nick Piggin
2009-01-23  9:00   ` Nick Piggin
2009-01-23  9:00     ` Nick Piggin
2009-01-23 13:34     ` Hugh Dickins
2009-01-23 13:34       ` Hugh Dickins
2009-01-23 13:44       ` Nick Piggin
2009-01-23 13:44         ` Nick Piggin
2009-01-23  9:55 ` Andi Kleen
2009-01-23  9:55   ` Andi Kleen
2009-01-23 10:13   ` Pekka Enberg
2009-01-23 10:13     ` Pekka Enberg
2009-01-23 11:25   ` Nick Piggin
2009-01-23 11:25     ` Nick Piggin
2009-01-23 11:57     ` Andi Kleen
2009-01-23 11:57       ` Andi Kleen
2009-01-23 13:18       ` Nick Piggin
2009-01-23 13:18         ` Nick Piggin
2009-01-23 14:04         ` Andi Kleen
2009-01-23 14:04           ` Andi Kleen
2009-01-23 14:27           ` Nick Piggin
2009-01-23 14:27             ` Nick Piggin
2009-01-23 15:06             ` Andi Kleen
2009-01-23 15:06               ` Andi Kleen
2009-01-23 15:15               ` Nick Piggin
2009-01-23 15:15                 ` Nick Piggin
2009-01-23 12:55   ` Nick Piggin
2009-01-23 12:55     ` Nick Piggin
  -- strict thread matches above, loose matches on Subject: below --
2009-01-14  9:04 Nick Piggin
2009-01-14  9:04 ` Nick Piggin
2009-01-14 10:53 ` Pekka Enberg
2009-01-14 10:53   ` Pekka Enberg
2009-01-14 11:47   ` Nick Piggin
2009-01-14 11:47     ` Nick Piggin
2009-01-14 13:44     ` Pekka Enberg
2009-01-14 13:44       ` Pekka Enberg
2009-01-14 14:22       ` Nick Piggin
2009-01-14 14:22         ` Nick Piggin
2009-01-14 14:45         ` Pekka Enberg
2009-01-14 14:45           ` Pekka Enberg
2009-01-14 15:09           ` Nick Piggin
2009-01-14 15:09             ` Nick Piggin
2009-01-14 15:22             ` Nick Piggin
2009-01-14 15:22               ` Nick Piggin
2009-01-14 15:30               ` Pekka Enberg
2009-01-14 15:30                 ` Pekka Enberg
2009-01-14 15:59                 ` Nick Piggin
2009-01-14 15:59                   ` Nick Piggin
2009-01-14 18:40                   ` Christoph Lameter
2009-01-14 18:40                     ` Christoph Lameter
2009-01-15  6:19                     ` Nick Piggin
2009-01-15  6:19                       ` Nick Piggin
2009-01-15 20:47                       ` Christoph Lameter
2009-01-15 20:47                         ` Christoph Lameter
2009-01-16  3:43                         ` Nick Piggin
2009-01-16  3:43                           ` Nick Piggin
2009-01-16 21:25                           ` Christoph Lameter
2009-01-16 21:25                             ` Christoph Lameter
2009-01-19  6:18                             ` Nick Piggin
2009-01-19  6:18                               ` Nick Piggin
2009-01-22  0:13                               ` Christoph Lameter
2009-01-22  0:13                                 ` Christoph Lameter
2009-01-22  9:27                                 ` Pekka Enberg
2009-01-22  9:27                                   ` Pekka Enberg
2009-01-22  9:30                                   ` Zhang, Yanmin
2009-01-22  9:30                                     ` Zhang, Yanmin
2009-01-22  9:33                                     ` Pekka Enberg
2009-01-22  9:33                                       ` Pekka Enberg
2009-01-23 15:32                                       ` Christoph Lameter
2009-01-23 15:32                                         ` Christoph Lameter
2009-01-23 15:37                                         ` Pekka Enberg
2009-01-23 15:37                                           ` Pekka Enberg
2009-01-23 15:42                                           ` Christoph Lameter
2009-01-23 15:42                                             ` Christoph Lameter
2009-01-23 15:32                                   ` Christoph Lameter
2009-01-23 15:32                                     ` Christoph Lameter
2009-01-23  4:09                                 ` Nick Piggin
2009-01-23  4:09                                   ` Nick Piggin
2009-01-23 15:41                                   ` Christoph Lameter
2009-01-23 15:41                                     ` Christoph Lameter
2009-01-23 15:53                                     ` Nick Piggin
2009-01-23 15:53                                       ` Nick Piggin
2009-01-26 17:28                                       ` Christoph Lameter
2009-01-26 17:28                                         ` Christoph Lameter
2009-02-03  1:53                                         ` Nick Piggin
2009-02-03  1:53                                           ` Nick Piggin
2009-02-03 17:33                                           ` Christoph Lameter
2009-02-03 17:33                                             ` Christoph Lameter
2009-02-03 18:42                                             ` Pekka Enberg
2009-02-03 18:42                                               ` Pekka Enberg
2009-02-03 18:47                                               ` Pekka Enberg
2009-02-03 18:47                                                 ` Pekka Enberg
2009-02-04  4:22                                                 ` Nick Piggin
2009-02-04  4:22                                                   ` Nick Piggin
2009-02-04 20:09                                                   ` Christoph Lameter
2009-02-04 20:09                                                     ` Christoph Lameter
2009-02-05  3:18                                                     ` Nick Piggin
2009-02-05  3:18                                                       ` Nick Piggin
2009-02-04 20:10                                               ` Christoph Lameter
2009-02-04 20:10                                                 ` Christoph Lameter
2009-02-05  3:14                                                 ` Nick Piggin
2009-02-05  3:14                                                   ` Nick Piggin
2009-02-04  4:07                                             ` Nick Piggin
2009-02-04  4:07                                               ` Nick Piggin
2009-01-14 18:01             ` Christoph Lameter
2009-01-14 18:01               ` Christoph Lameter
2009-01-15  6:03               ` Nick Piggin
2009-01-15  6:03                 ` Nick Piggin
2009-01-15 20:05                 ` Christoph Lameter
2009-01-15 20:05                   ` Christoph Lameter
2009-01-16  3:19                   ` Nick Piggin
2009-01-16  3:19                     ` Nick Piggin
2009-01-16 21:07                     ` Christoph Lameter
2009-01-16 21:07                       ` Christoph Lameter
2009-01-19  5:47                       ` Nick Piggin
2009-01-19  5:47                         ` Nick Piggin
2009-01-22  0:19                         ` Christoph Lameter
2009-01-22  0:19                           ` Christoph Lameter
2009-01-23  4:17                           ` Nick Piggin
2009-01-23  4:17                             ` Nick Piggin
2009-01-23 15:52                             ` Christoph Lameter
2009-01-23 15:52                               ` Christoph Lameter
2009-01-23 16:10                               ` Nick Piggin
2009-01-23 16:10                                 ` Nick Piggin
2009-01-23 17:09                                 ` Nick Piggin
2009-01-23 17:09                                   ` Nick Piggin
2009-01-26 17:46                                   ` Christoph Lameter
2009-01-26 17:46                                     ` Christoph Lameter
2009-02-03  1:42                                     ` Nick Piggin
2009-02-03  1:42                                       ` Nick Piggin
2009-01-26 17:34                                 ` Christoph Lameter
2009-01-26 17:34                                   ` Christoph Lameter
2009-02-03  1:48                                   ` Nick Piggin
2009-02-03  1:48                                     ` Nick Piggin

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=1234256208.2604.363.camel@ymzhang \
    --to=yanmin_zhang@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ming.m.lin@intel.com \
    --cc=npiggin@suse.de \
    --cc=penberg@cs.helsinki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.