All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
To: Christoph Lameter <cl@linux.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/slab: Improve performance of gathering slabinfo stats
Date: Tue, 2 Aug 2016 10:39:13 -0700	[thread overview]
Message-ID: <39e8a2e9-93c9-9051-cd90-3690baa8239f@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1608020953160.24620@east.gentwo.org>


On 08/02/2016 07:59 AM, Christoph Lameter wrote:
> Hmm.... What SLUB does is:
>
> 1. Keep a count of the total number of allocated slab pages per node.
> 	This counter only needs to be updated when a slab page is
> 	allocated from the page allocator or when it is freed to the
> 	page allocator. At that point we already hold the per node lock,
> 	page allocator operations are extremely costly anyways and so that
> 	is ok.
>
> 2. Keep a count of the number of partially allocated slab pages per node.
> 	At that point we have to access the partial list and take a per
> 	node lock. Placing the counter into the same cacheline and
> 	the increment/decrement into the period when the lock has been taken
> 	avoids the overhead.
>

As Joonsoo mentioned in his previous comment, the partial list is pretty 
small anyway. And we cannot avoid traversal of the partial list - we 
have to count the number of active objects in each partial slab:
	
	active_objs += page->active;

So keeping a count of partially allocated slabs seems unnecessary to me.

> The number of full pages is then
>
> 	total - partial
>
>
> If both allocators would use the same scheme here then the code to
> maintain the counter can be moved into mm/slab_common.c. Plus the per node
> structures could be mostly harmonized between both allocators. Maybe even
> the page allocator operations could become common code.
>
> Aruna: Could you work on a solution like that?
>

Yup, I'll replace the 3 counters with one counter for number of slabs 
per node and send out a new patch. I'll try to make the counter 
management as similar as possible, between SLAB and SLUB.

Thanks,
Aruna

WARNING: multiple messages have this Message-ID (diff)
From: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
To: Christoph Lameter <cl@linux.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/slab: Improve performance of gathering slabinfo stats
Date: Tue, 2 Aug 2016 10:39:13 -0700	[thread overview]
Message-ID: <39e8a2e9-93c9-9051-cd90-3690baa8239f@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1608020953160.24620@east.gentwo.org>


On 08/02/2016 07:59 AM, Christoph Lameter wrote:
> Hmm.... What SLUB does is:
>
> 1. Keep a count of the total number of allocated slab pages per node.
> 	This counter only needs to be updated when a slab page is
> 	allocated from the page allocator or when it is freed to the
> 	page allocator. At that point we already hold the per node lock,
> 	page allocator operations are extremely costly anyways and so that
> 	is ok.
>
> 2. Keep a count of the number of partially allocated slab pages per node.
> 	At that point we have to access the partial list and take a per
> 	node lock. Placing the counter into the same cacheline and
> 	the increment/decrement into the period when the lock has been taken
> 	avoids the overhead.
>

As Joonsoo mentioned in his previous comment, the partial list is pretty 
small anyway. And we cannot avoid traversal of the partial list - we 
have to count the number of active objects in each partial slab:
	
	active_objs += page->active;

So keeping a count of partially allocated slabs seems unnecessary to me.

> The number of full pages is then
>
> 	total - partial
>
>
> If both allocators would use the same scheme here then the code to
> maintain the counter can be moved into mm/slab_common.c. Plus the per node
> structures could be mostly harmonized between both allocators. Maybe even
> the page allocator operations could become common code.
>
> Aruna: Could you work on a solution like that?
>

Yup, I'll replace the 3 counters with one counter for number of slabs 
per node and send out a new patch. I'll try to make the counter 
management as similar as possible, between SLAB and SLUB.

Thanks,
Aruna

--
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:[~2016-08-02 17:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02  0:09 [PATCH] mm/slab: Improve performance of gathering slabinfo stats Aruna Ramakrishna
2016-08-02  0:09 ` Aruna Ramakrishna
2016-08-02  0:55 ` Joonsoo Kim
2016-08-02  0:55   ` Joonsoo Kim
2016-08-02  1:43   ` Aruna Ramakrishna
2016-08-02  1:43     ` Aruna Ramakrishna
2016-08-02  2:43     ` Joonsoo Kim
2016-08-02  2:43       ` Joonsoo Kim
2016-08-02 14:59       ` Christoph Lameter
2016-08-02 14:59         ` Christoph Lameter
2016-08-02 17:39         ` Aruna Ramakrishna [this message]
2016-08-02 17:39           ` Aruna Ramakrishna

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=39e8a2e9-93c9-9051-cd90-3690baa8239f@oracle.com \
    --to=aruna.ramakrishna@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.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 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.