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]
Date:	Mon, 2 Apr 2007 23:09:54 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-mm@...ck.org, xfs-masters@....sgi.com,
	reiserfs-dev@...esys.com
Subject: Re: [PATCH] Cleanup and kernelify shrinker registration (rc5-mm2)

On Tue, 03 Apr 2007 15:47:05 +1000 Rusty Russell <rusty@...tcorp.com.au> wrote:

> On Mon, 2007-04-02 at 21:57 -0700, Andrew Morton wrote:
> > On Tue, 03 Apr 2007 14:45:02 +1000 Rusty Russell <rusty@...tcorp.com.au> wrote:
> > > Does that mean the to function correctly every user needs some internal
> > > cursor so it doesn't end up scanning the first N entries over and over?
> > > 
> > 
> > If it wants to be well-behaved, and to behave as the VM expects, yes. 
> > 
> > There's an expectation that the callback will be performing some scan-based
> > aging operation and of course to do LRU (or whatever) aging, the callback
> > will need to remember where it was up to last time it was called.
> > 
> > But it's just a guideline - callbacks could do something different but
> > in-the-spirit, I guess.
> 
> Hmm, actually the callers I looked at (nfs, dcache, mbcache) seem to use
> an LRU list and just walk the first "nr_to_scan" entries, and nr_to_scan
> is always 128.

That's just because of the batching logic up in shrink_slab().  And iirc we
only break the scanning into lumps of 128 items so we can add a
cond_resched() into it.

> Someone who keeps a cursor will be disadvantaged: the other shrinkers
> could well get less effective on repeated calls, but we won't.  Someone
> who picks entries at random might have the same issue.

To examine the balancing one would need to examine the value of total_scan
in shrink_slab(), rather than looking at the value which shrink_slab()
passes into the callback.

> I think it is clearest to describe how we expect everyone to work, and
> let whoever is getting creative worry about it themselves.
> 
> How's this:
> ==
> Cleanup and kernelify shrinker registration.

hm, well, six-of-one, VI of the other.  We save maybe four kmallocs across
the entire uptime at the cost of exposing stuff kernel-side which doesn't
need to be exposed.

But I think we need to weed that crappiness out of XFS first.

-
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