Re: [PATCH 2/3] mm: compaction: detect when scanners meet in isolate_freepages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2014-07-09 at 16:36 +0200, Vlastimil Babka wrote:
> On 07/08/2014 07:09 PM, Ben Hutchings wrote:
> > On Mon, 2014-06-09 at 11:39 +0200, Vlastimil Babka wrote:
> >> commit 7ed695e069c3cbea5e1fd08f84a04536da91f584 upstream.
> >>
> >> Compaction of a zone is finished when the migrate scanner (which begins
> >> at the zone's lowest pfn) meets the free page scanner (which begins at
> >> the zone's highest pfn).  This is detected in compact_zone() and in the
> >> case of direct compaction, the compact_blockskip_flush flag is set so
> >> that kswapd later resets the cached scanner pfn's, and a new compaction
> >> may again start at the zone's borders.
> > [...]
> >
> > This can be applied to 3.2 (with some fuzz), but is it a worthwile fix
> > there?
> 
> Hi, I think 3.2 is fine. While free scanner might miss the scanners 
> meeting, there's this code in isolate_migratepages() that ensures the 
> scanners cross:
> 
>          /* Do not scan outside zone boundaries */
>          low_pfn = max(cc->migrate_pfn, zone->zone_start_pfn);
> 
>          /* Only scan within a pageblock boundary */
>          end_pfn = ALIGN(low_pfn + pageblock_nr_pages, pageblock_nr_pages);
> 
>          /* Do not cross the free scanner or scan within a memory hole */
>          if (end_pfn > cc->free_pfn || !pfn_valid(low_pfn)) {
>                  cc->migrate_pfn = end_pfn;
>                  return ISOLATE_NONE;
>          }
> 
> The important part is "cc->migrate_pfn = end_pfn;".

Thanks for checking.

Ben.

> > (The other 2 compaction fixes you found don't seem to be applicable.)
> >
> > Ben.
> >
> 

-- 
Ben Hutchings
All the simple programs have been written, and all the good names taken.

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]