lkml.org 
[lkml]   [2011]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] mm: compaction: Abort compaction if too many pages are isolated and caller is asynchronous
    On Mon, Jun 06, 2011 at 02:38:51PM +0200, Andrea Arcangeli wrote:
    > On Mon, Jun 06, 2011 at 11:39:24AM +0100, Mel Gorman wrote:
    > > Well spotted.
    > >
    > > Acked-by: Mel Gorman <mgorman@suse.de>
    > >
    > > Minor nit. swapper_space is rarely referred to outside of the swap
    > > code. Might it be more readable to use
    > >
    > > /*
    > > * swapcache is accounted as NR_FILE_PAGES but it is not
    > > * accounted as NR_SHMEM
    > > *
    > > if (PageSwapBacked(page) && !PageSwapCache(page))
    >
    > I thought the comparison on swapper_space would be faster as it was
    > immediate vs register in CPU, instead of forcing a memory
    > access. Otherwise I would have used the above. Now the test_bit is
    > written in C and lockless so it's not likely to be very different
    > considering the cacheline is hot in the CPU but it's still referencing
    > memory instead register vs immediate comparison.

    Ok, I had not considered that. That is a micro-optimisation but it's
    there. I thought my version is more readable and migration is not
    really a fast path but yours is still better.

    --
    Mel Gorman
    SUSE Labs


    \
     
     \ /
      Last update: 2011-06-06 16:57    [W:4.504 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site