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:	Wed, 1 Dec 2010 10:50:29 +0000
From:	Mel Gorman <mel@....ul.ie>
To:	Johannes Weiner <hannes@...xchg.org>
Cc:	Andrea Arcangeli <aarcange@...hat.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rik van Riel <riel@...hat.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/7] mm: vmscan: Convert lumpy_mode into a bitmask

On Wed, Dec 01, 2010 at 11:27:32AM +0100, Johannes Weiner wrote:
> On Mon, Nov 22, 2010 at 03:43:50PM +0000, Mel Gorman wrote:
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -51,11 +51,20 @@
> >  #define CREATE_TRACE_POINTS
> >  #include <trace/events/vmscan.h>
> >  
> > -enum lumpy_mode {
> > -	LUMPY_MODE_NONE,
> > -	LUMPY_MODE_ASYNC,
> > -	LUMPY_MODE_SYNC,
> > -};
> > +/*
> > + * lumpy_mode determines how the inactive list is shrunk
> > + * LUMPY_MODE_SINGLE: Reclaim only order-0 pages
> > + * LUMPY_MODE_ASYNC:  Do not block
> > + * LUMPY_MODE_SYNC:   Allow blocking e.g. call wait_on_page_writeback
> > + * LUMPY_MODE_CONTIGRECLAIM: For high-order allocations, take a reference
> > + *			page from the LRU and reclaim all pages within a
> > + *			naturally aligned range
> 
> I find those names terribly undescriptive.  It also strikes me as an
> odd set of flags.  Can't this be represented with less?
> 
> 	LUMPY_MODE_ENABLED
> 	LUMPY_MODE_SYNC
> 
> or, after the rename,
> 
> 	RECLAIM_MODE_HIGHER	= 1
> 	RECLAIM_MODE_SYNC	= 2
> 	RECLAIM_MODE_LUMPY	= 4
> 

My problem with that is you have to infer what the behaviour is from what the
flags "are not" as opposed to what they are. For example, !LUMPY_MODE_SYNC
implies LUMPY_MODE_ASYNC instead of specifying LUMPY_MODE_ASYNC. It also
looks very odd when trying to distinguish between order-0 standard reclaim,
lumpy reclaim and reclaim/compaction.

> where compaction mode is default if RECLAIM_MODE_HIGHER, and
> RECLAIM_MODE_LUMPY will go away eventually.
> 
> Also, if you have a flag name for 'reclaim with extra efforts for
> higher order pages' that is better than RECLAIM_MODE_HIGHER... ;)
> 
> > +typedef unsigned __bitwise__ lumpy_mode;
> 
> lumpy_mode_t / reclaim_mode_t?
> 

It can't hurt!

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
--
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