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, INCLUDES_PATCH,MAILING_LIST_MULTI,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 6F74FC10F29 for ; Wed, 11 Mar 2020 05:23:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2619420873 for ; Wed, 11 Mar 2020 05:23:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2619420873 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 87E376B0003; Wed, 11 Mar 2020 01:23:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 807B36B0006; Wed, 11 Mar 2020 01:23:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71DC96B0007; Wed, 11 Mar 2020 01:23:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id 575A86B0003 for ; Wed, 11 Mar 2020 01:23:01 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 12CCF180AD81F for ; Wed, 11 Mar 2020 05:23:01 +0000 (UTC) X-FDA: 76581937362.18.bead46_1a4590b7cea2e X-HE-Tag: bead46_1a4590b7cea2e X-Filterd-Recvd-Size: 3355 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Mar 2020 05:23:00 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2020 22:22:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,539,1574150400"; d="scan'208";a="236305814" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga008.jf.intel.com with ESMTP; 10 Mar 2020 22:22:55 -0700 From: "Huang\, Ying" To: David Rientjes Cc: Andrew Morton , , , David Hildenbrand , "Michal Hocko" , Dave Hansen , "Mel Gorman" , Vlastimil Babka , Minchan Kim , Johannes Weiner , Hugh Dickins , Rik van Riel , Matthew Wilcox Subject: Re: [PATCH] mm: Add more comments for MADV_FREE References: <20200311011117.1656744-1-ying.huang@intel.com> Date: Wed, 11 Mar 2020 13:22:54 +0800 In-Reply-To: (David Rientjes's message of "Tue, 10 Mar 2020 22:08:54 -0700") Message-ID: <87imjbv51t.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: David Rientjes 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