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]
Message-ID: <87imjbv51t.fsf@yhuang-dev.intel.com>
Date:   Wed, 11 Mar 2020 13:22:54 +0800
From:   "Huang\, Ying" <ying.huang@...el.com>
To:     David Rientjes <rientjes@...gle.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>,
        David Hildenbrand <david@...hat.com>,
        "Michal Hocko" <mhocko@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "Mel Gorman" <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
        Minchan Kim <minchan@...nel.org>,
        Johannes Weiner <hannes@...xchg.org>,
        Hugh Dickins <hughd@...gle.com>,
        Rik van Riel <riel@...riel.com>,
        Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH] mm: Add more comments for MADV_FREE

David Rientjes <rientjes@...gle.com> writes:

> On Wed, 11 Mar 2020, Huang, Ying wrote:
>
>> diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
>> index 6f2fef7b0784..01144dd02a5f 100644
>> --- a/include/linux/mm_inline.h
>> +++ b/include/linux/mm_inline.h
>> @@ -9,10 +9,11 @@
>>   * page_is_file_cache - should the page be on a file LRU or anon LRU?
>>   * @page: the page to test
>>   *
>> - * Returns 1 if @page is page cache page backed by a regular filesystem,
>> - * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed.
>> - * Used by functions that manipulate the LRU lists, to sort a page
>> - * onto the right LRU list.
>> + * Returns 1 if @page is page cache page backed by a regular filesystem or
>> + * anonymous page lazily freed (e.g. via MADV_FREE).  Returns 0 if @page is
>> + * normal anonymous page, tmpfs or otherwise ram or swap backed.  Used by
>> + * functions that manipulate the LRU lists, to sort a page onto the right LRU
>> + * list.
>
> The function name is misleading: anonymous pages that can be lazily freed 
> are not file cache.  This returns 1 because of the question it is asking: 
> anonymous lazily freeable pages should be on the file lru, not the anon 
> lru.  So before adjusting the comment I'd suggest renaming the function to 
> something like page_is_file_lru().

Yes.  I think page_is_file_lru() is a better name too.  And whether
tmpfs pages are file cache pages is confusing too.  But I think we can
do that after this patch if others think this is a good idea too.

Best Regards,
Huang, Ying

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ