lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <39e8a2e9-93c9-9051-cd90-3690baa8239f@oracle.com>
Date:	Tue, 2 Aug 2016 10:39:13 -0700
From:	Aruna Ramakrishna <aruna.ramakrishna@...cle.com>
To:	Christoph Lameter <cl@...ux.com>,
	Joonsoo Kim <iamjoonsoo.kim@....com>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Mike Kravetz <mike.kravetz@...cle.com>,
	Pekka Enberg <penberg@...nel.org>,
	David Rientjes <rientjes@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] mm/slab: Improve performance of gathering slabinfo stats


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ