Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp179344ybh; Tue, 10 Mar 2020 22:24:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtqbQfltVj+I8sJI0ZDNv8VdQshIJhhGY7EnnNFFdM+mPyAcQb3sNagrMmTXn7so3+8OGp0 X-Received: by 2002:a05:6808:646:: with SMTP id z6mr760884oih.163.1583904271536; Tue, 10 Mar 2020 22:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583904271; cv=none; d=google.com; s=arc-20160816; b=yEhzCt3Klkh3ApOYJvZqoItSierOTdfIw49heBd8qt/44DEisVyjxl30EMxZXmkrN7 FgmI7p2h+vtvs6PpS+wDSGi+dhZ77+MAg/tlm33ielBOzMbFEaimJeTnEcl4MsEc1uy5 n7Bj4PA8MxUwEZFVTpuQ4+/Y3QGR9ioZllm0P4Cl67L9Xgs7wlnlBHzT4yiimI5Obx14 hKfKsX/yqZL6OusIlYFdto6qClq6CeEIorogajX5VGw+WyEWX5yJgd7rwgYxxPvSA2dv GlvYNZz28fDopFCHPG24jvmWMatdGSRYl+yevi/DtL34/wyuDX3c+YMSeQzOHtNEjuHA Gv0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=2ci7vm7cIp4GaeC7n/cSOqH7zCy9aURmyHl9wwcSR/c=; b=awzGALU/jb50i62ZhhFWsEsXDE3spj783azsZKyS53LhCETDnFtkMs2wK7ve2HkrZv ZyYGpOVFhXYI4R5xTu1kx63fw5GtfVHskoRfbpnZhgqVuPgIeJYoD7VOKYXAeU83veiO PaJQtUvSwfGw3yj85WKGNIpkG7VOGNnLh+ZoWoNGMZIb/vyZdhEd1uX1Hnw0ZIKVDL75 K7NkKtcrn8y+xSCbPbGV+70ZS6I9p5Ygahk//eOsBhuMNVn69iH5hbST+EH2q02zrKPA Chv8+u+JTPN35FiCQgW9D5th9qR7inecw+aU1mnnAjOQ7KSRNjxp9HG/Xr3c6fN3bakX 310Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si503404otc.192.2020.03.10.22.24.19; Tue, 10 Mar 2020 22:24:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbgCKFW7 (ORCPT + 99 others); Wed, 11 Mar 2020 01:22:59 -0400 Received: from mga03.intel.com ([134.134.136.65]:27105 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbgCKFW7 (ORCPT ); Wed, 11 Mar 2020 01:22:59 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2020 22:22:59 -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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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