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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20121108144043.baf9f2e5.akpm@linux-foundation.org>
Date:	Thu, 8 Nov 2012 14:40:43 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Glauber Costa <glommer@...allels.com>
Cc:	Christoph Lameter <cl@...ux.com>, <linux-mm@...ck.org>,
	<linux-kernel@...r.kernel.org>, <kamezawa.hiroyu@...fujitsu.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Tejun Heo <tj@...nel.org>, Michal Hocko <mhocko@...e.cz>,
	Pekka Enberg <penberg@...nel.org>,
	David Rientjes <rientjes@...gle.com>,
	Pekka Enberg <penberg@...helsinki.fi>,
	Suleiman Souhlal <suleiman@...gle.com>,
	Robert Moore <robert.moore@...el.com>,
	Len Brown <lenb@...nel.org>, "Brown, Len" <len.brown@...el.com>
Subject: Re: [PATCH v6 25/29] memcg/sl[au]b: shrink dead caches

On Thu, 8 Nov 2012 23:31:16 +0100
Glauber Costa <glommer@...allels.com> wrote:

> On 11/08/2012 08:21 PM, Andrew Morton wrote:
> > On Thu, 8 Nov 2012 17:15:36 +0000
> > Christoph Lameter <cl@...ux.com> wrote:
> > 
> >> On Wed, 7 Nov 2012, Andrew Morton wrote:
> >>
> >>> What's up with kmem_cache_shrink?  It's global and exported to modules
> >>> but its only external caller is some weird and hopelessly poorly
> >>> documented site down in drivers/acpi/osl.c.  slab and slob implement
> >>> kmem_cache_shrink() *only* for acpi!  wtf?  Let's work out what acpi is
> >>> trying to actually do there, then do it properly, then killkillkill!
> >>
> >> kmem_cache_shrink is also used internally. Its simply releasing unused
> >> cached objects.
> > 
> > Only in slub.  It could be removed outright from the others and
> > simplified in slub.
> > 
> >>> Secondly, as slab and slub (at least) have the ability to shed cached
> >>> memory, why aren't they hooked into the core cache-shinking machinery.
> >>> After all, it's called "shrink_slab"!
> >>
> >> Because the core cache shrinking needs the slab caches to free up memory
> >> from inodes and dentries. We could call kmem_cache_shrink at the end of
> >> the shrink passes in vmscan. The price would be that the caches would have
> >> to be repopulated when new allocations occur.
> > 
> > Well, the shrinker shouldn't strips away all the cache.  It will perform
> > a partial trim, the magnitude of which increases with perceived
> > external memory pressure.
> > 
> > AFACIT, this is correct and desirable behaviour for shrinking
> > slab's internal caches.
> > 
> 
> I believe calling this from shrink_slab() is not a bad idea at all. If
> you're all in favour, I'll cook a patch for this soon

It sounds like a pretty big change but yes, well worth exploring.

I'd still like to give ACPI a thwap.  That kmem_cache_shrink() in
drivers/acpi/osl.c was added unchangelogged in a megapatch
(73459f73e5d1602c59) so it's a mystery.  Cc's optimistically added.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ