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 93650C2BB1D for ; Tue, 17 Mar 2020 08:10:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 59AD4206EC for ; Tue, 17 Mar 2020 08:10:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59AD4206EC 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 DAB086B0005; Tue, 17 Mar 2020 04:10:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5B236B0006; Tue, 17 Mar 2020 04:10:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C98EA6B0007; Tue, 17 Mar 2020 04:10:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id AF4806B0005 for ; Tue, 17 Mar 2020 04:10:38 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8146B180AD81A for ; Tue, 17 Mar 2020 08:10:38 +0000 (UTC) X-FDA: 76604132556.01.start60_5cd426881740e X-HE-Tag: start60_5cd426881740e X-Filterd-Recvd-Size: 4835 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 08:10:37 +0000 (UTC) IronPort-SDR: PAHbzyx6Mr4hsUN0PwStcqJmWdrc7x7i1JPKqfVVrXqNJQdnawe3lg1PkgJrIxrSBshlt3PBne aCQNwYxInelA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 01:10:36 -0700 IronPort-SDR: K2hESqp48NSCqGFGaKbO3ciySRYdVROgOrIRP4l7rCNs+3TAxWjTlBB5/yV5NiEbmvgBlQSO2b P63UR/LO6fXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,563,1574150400"; d="scan'208";a="262954250" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga002.jf.intel.com with ESMTP; 17 Mar 2020 01:10:32 -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 16:10:30 +0800 In-Reply-To: (Vlastimil Babka's message of "Mon, 16 Mar 2020 18:17:23 +0100") Message-ID: <87v9n3qu4p.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. ... Thought again. Should we make the 2 sub-clauses consistent? That is, either if @page is page cache page backed by a regular filesystem or anonymous page freed lazily or if @page is a regular filesystem backed page cache page or a lazily freed anonymous page But I know that my English grammar isn't good enough :-( 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); >> }