From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88B41C18E5B for ; Tue, 17 Mar 2020 00:10:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 53ECB205ED for ; Tue, 17 Mar 2020 00:10:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53ECB205ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EEBED6B0003; Mon, 16 Mar 2020 20:10:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9BF66B0005; Mon, 16 Mar 2020 20:10:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB1CE6B0007; Mon, 16 Mar 2020 20:10:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id BD2226B0003 for ; Mon, 16 Mar 2020 20:10:01 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 96F47824C740 for ; Tue, 17 Mar 2020 00:10:01 +0000 (UTC) X-FDA: 76602921402.12.cars15_748aecd22554a X-HE-Tag: cars15_748aecd22554a X-Filterd-Recvd-Size: 4539 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 00:10:00 +0000 (UTC) IronPort-SDR: rfzzKiKHY79SUMFuXQsIdhnJxRWnB5QYmstSoq8Y6c19NUOQQ4iPUkPXRVkOjsGDAT/0XgmuTs cfBYz5VogLig== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2020 17:09:58 -0700 IronPort-SDR: 1mju6VfkWy0cor19qBf5YzeF+KyO2QIqmzxPUyz9i+5AfpCwdqgIo9CENHwv+zBXU83VEsBzM4 Bl3ljq7KfSeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,562,1574150400"; d="scan'208";a="417355196" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga005.jf.intel.com with ESMTP; 16 Mar 2020 17:09:54 -0700 From: "Huang\, Ying" To: Vlastimil Babka Cc: Andrew Morton , , , David Hildenbrand , Johannes Weiner , David Rientjes , Michal Hocko , Pankaj Gupta , Dave Hansen , Mel Gorman , Minchan Kim , Hugh Dickins , Rik van Riel Subject: Re: [PATCH -V2] mm: Code cleanup for MADV_FREE References: <20200316063740.2542014-1-ying.huang@intel.com> Date: Tue, 17 Mar 2020 08:09:53 +0800 In-Reply-To: (Vlastimil Babka's message of "Mon, 16 Mar 2020 18:17:23 +0100") Message-ID: <878sjzsuy6.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Vlastimil Babka writes: > On 3/16/20 7:37 AM, Huang, Ying wrote: >> From: Huang Ying >> >> Some comments for MADV_FREE is revised and added to help people understand the >> MADV_FREE code, especially the page flag, PG_swapbacked. This makes >> page_is_file_cache() isn't consistent with its comments. So the function is >> renamed to page_is_file_lru() to make them consistent again. All these are put >> in one patch as one logical change. >> Signed-off-by: "Huang, Ying" >> Suggested-by: David Hildenbrand >> Suggested-by: Johannes Weiner >> Suggested-and-acked-by: David Rientjes >> Acked-by: Michal Hocko >> Acked-by: Pankaj Gupta >> Cc: Dave Hansen >> Cc: Mel Gorman >> Cc: Vlastimil Babka >> Cc: Minchan Kim >> Cc: Hugh Dickins >> Cc: Rik van Riel > > Acked-by: Vlastimil Babka > > Thanks! A grammar nit below: > >> --- a/include/linux/mm_inline.h >> +++ b/include/linux/mm_inline.h >> @@ -6,19 +6,20 @@ >> #include >> >> /** >> - * page_is_file_cache - should the page be on a file LRU or anon LRU? >> + * page_is_file_lru - 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 > > a lazily freed anonymous page (e.g. ... Thanks! Will update patch with this. Best Regards, Huang, Ying >> + * 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. >> * >> * We would like to get this info without a page flag, but the state >> * needs to survive until the page is last deleted from the LRU, which >> * could be as far down as __page_cache_release. >> */ >> -static inline int page_is_file_cache(struct page *page) >> +static inline int page_is_file_lru(struct page *page) >> { >> return !PageSwapBacked(page); >> }