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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <483D7D7C.70607@mtf.biglobe.ne.jp>
Date:	Thu, 29 May 2008 00:42:52 +0900
From:	Daisuke Nishimura <d-nishimura@....biglobe.ne.jp>
To:	Rik van Riel <riel@...hat.com>
CC:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Lee Schermerhorn <lee.schermerhorn@...com>,
	Kosaki Motohiro <kosaki.motohiro@...fujitsu.com>
Subject: Re: [PATCH -mm 07/16] second chance replacement for anonymous pages

Rik van Riel wrote:
> On Wed, 28 May 2008 14:36:56 +0900
> Daisuke Nishimura <nishimura@....nes.nec.co.jp> wrote:
> 
>>>  	/*
>>> +	 * Count the referenced anon pages as rotated, to balance pageout
>>> +	 * scan pressure between file and anonymous pages in get_sacn_ratio.
>>> +	 */
>>> +	if (!file)
>>> +		zone->recent_rotated_anon += pgmoved;
>>> +
>> Shouldn't 'pgmoved' be cleared to 0 before scanning l_hold?
>> It's used to store the result of sc->isolate_pages() before
>> scanning l_hold.
> 
> It is zeroed 2 statements down.
> 
>         if (!file)
>                 zone->recent_rotated_anon += pgmoved;
> 
>         /*
>          * Now put the pages back on the appropriate [file or anon] inactive
>          * and active lists.
>          */
>         pagevec_init(&pvec, 1);
>         pgmoved = 0;
> 

When all the patches applied, shrink_active_list() looks like:

   1135         pgmoved = sc->isolate_pages(nr_pages, &l_hold, &pgscanned, sc->order,
   1136                                         ISOLATE_ACTIVE, zone,
   1137                                         sc->mem_cgroup, 1, file);
     :
   1150         if (file)
   1151                 __mod_zone_page_state(zone, NR_ACTIVE_FILE, -pgmoved);
   1152         else
   1153                 __mod_zone_page_state(zone, NR_ACTIVE_ANON, -pgmoved);
   1154         spin_unlock_irq(&zone->lru_lock);
   1155 
   1156         while (!list_empty(&l_hold)) {
     :
   1166                 if (page_referenced(page, 0, sc->mem_cgroup) && file) {
   1167                         /* Referenced file pages stay active. */
   1168                         list_add(&page->lru, &l_active);
   1169                 } else {
   1170                         list_add(&page->lru, &l_inactive);
   1171                         if (!file)
   1172                                 /* Anonymous pages always get deactivated. */
   1173                                 pgmoved++;
     :
   1178                 }
   1179         }
   1180 
   1181         /*
   1182          * Count the referenced anon pages as rotated, to balance pageout
   1183          * scan pressure between file and anonymous pages in get_sacn_ratio.
   1184          */
   1185         if (!file)
   1186                 zone->recent_rotated_anon += pgmoved;

So, I wondered that there is no need to clear pgmoved before 1156 line.


Thanks,
Daisuke Nishimura.


--
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