lkml.org 
[lkml]   [2010]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/7] mm: vmscan: Convert lumpy_mode into a bitmask
    On Wed, Dec 01, 2010 at 11:56:33AM +0000, Mel Gorman wrote:
    > On Wed, Dec 01, 2010 at 12:21:16PM +0100, Johannes Weiner wrote:
    > > On Wed, Dec 01, 2010 at 10:50:29AM +0000, Mel Gorman wrote:
    > > > 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:
    > > > > > + * 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.
    > >
    > > Sounds like a boolean value to me. And it shows: you never actually
    > > check for RECLAIM_MODE_ASYNC in the code, you just always set it to
    > > the opposite of RECLAIM_MODE_SYNC - the flag which is actually read.
    >
    > If you insist, the ASYNC flag can be dropped. I found it easier to flag
    > what behaviour was expected than infer it.

    It seems to be a matter of taste and nobody else seems to care, so I
    am not insisting. Let's just keep it as it is.


    \
     
     \ /
      Last update: 2010-12-02 12:07    [W:0.022 / U:0.500 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site