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=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 DAE99C18E5B for ; Mon, 16 Mar 2020 17:17:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A89C620409 for ; Mon, 16 Mar 2020 17:17:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A89C620409 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 461086B0003; Mon, 16 Mar 2020 13:17:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EA3B6B0005; Mon, 16 Mar 2020 13:17:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FFB16B0007; Mon, 16 Mar 2020 13:17:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id 122D16B0003 for ; Mon, 16 Mar 2020 13:17:32 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C084D3489 for ; Mon, 16 Mar 2020 17:17:31 +0000 (UTC) X-FDA: 76601881902.02.cub58_770fd388e001 X-HE-Tag: cub58_770fd388e001 X-Filterd-Recvd-Size: 3854 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 17:17:31 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 146E8AF77; Mon, 16 Mar 2020 17:17:27 +0000 (UTC) Subject: Re: [PATCH -V2] mm: Code cleanup for MADV_FREE To: "Huang, Ying" , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Hildenbrand , Johannes Weiner , David Rientjes , Michal Hocko , Pankaj Gupta , Dave Hansen , Mel Gorman , Minchan Kim , Hugh Dickins , Rik van Riel References: <20200316063740.2542014-1-ying.huang@intel.com> From: Vlastimil Babka Message-ID: Date: Mon, 16 Mar 2020 18:17:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200316063740.2542014-1-ying.huang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: 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. ... > + * 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); > }