Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp170552ybh; Tue, 10 Mar 2020 22:11:08 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvhuY3FiY3tcghrybYGlDfAhQnfvdGat2nAXdon4XSp74FDQTpOX4JdWK2CckUiX8O2hqtm X-Received: by 2002:a9d:7e82:: with SMTP id m2mr990089otp.300.1583903468553; Tue, 10 Mar 2020 22:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583903468; cv=none; d=google.com; s=arc-20160816; b=sk0qDcKTiVbx0z6aIDVYTTQrxotRJqv8zbe9AbLbbzdlR0+kpdf+cAsWDUBPf2A8yJ oTusqXFaPTo0HjemM0RFrU1HbKK0fA2QHXMaAnkUl5XBgpA030k7mBKeUdJGsqkkv1d0 LlJowFvqTBGVxcnSc4L5S4b1a+HgsQ9YJ1jH3Fxb9tfRmhvezQvB6m5pyb5lMQEpsJii sU16W+mu90EWUjd/ekwrHubUDOqo+Tf1d676uhSt43R8UaGlEZrpFFmhq5z6ixwpDjnM PH9cfiJEChyXufoGu9bbNWrhnZbjM6xpgyj9/1jrSzaclEhxFBvlYP3BVaet0dqWq/NT TKHg== 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:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=upcYox+hR0ff8PbXC/tjXbgIwJyTE9zI/gU5bKsBrcE=; b=wmpeT6cB+9PySqtHl91lDcBrt7AE746oyg0KBphCNlggPWH4/Oh0PVjzsHfJlfuXso yrwYmcEKooNlkQmh5i36w50y5HB4l93XCgfXdvNvdEo8jps54aNvmjNPXkG7idKEA84U yxKiO/3S3BGGS+W/RtJF9Wh6F2sFA0CgM7R1zTKSlWb/Sx9G22xcNNVV3zPEsYb7Z8Hv Qjkfbzp/YFJ6AISBKzlLwjaHOS0P93TGiODpmhlq/tN4hAUSNb+JGnFmwKF8woIIjudQ qN5cKYBAbPCa52okTAbI7hkKDyjpnw5pH4HwQfEd9ALqVTJo1M48Tot/IFP4gE9HJJlt KL5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=G3nvp3iV; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v15si552837oth.307.2020.03.10.22.10.56; Tue, 10 Mar 2020 22:11:08 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=G3nvp3iV; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726895AbgCKFI5 (ORCPT + 99 others); Wed, 11 Mar 2020 01:08:57 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:39370 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbgCKFI5 (ORCPT ); Wed, 11 Mar 2020 01:08:57 -0400 Received: by mail-pj1-f65.google.com with SMTP id d8so365018pje.4 for ; Tue, 10 Mar 2020 22:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=upcYox+hR0ff8PbXC/tjXbgIwJyTE9zI/gU5bKsBrcE=; b=G3nvp3iVpVC+yHQkmM1FUvj/OVrYCTe+/dsoBxZEEtfC1hTuasXwqna9yAt1P/K0nE 0ki9mJaOhcAhhTHguCjns0Wm6eO+AxFLXS+Khmi3iBUY27t+SCI8cOoDxJfy7Isd6fvX Mu/DS3uKKOBVRg7kWVV94+e+N2lKLD2uSlV/Zme8Gbpl/6C7QV1QrhNN41ylEOoRmBMS KVUowSNqsYyS9rRl4wDU2xUuVSWErgbs8GtxYB3DCQ6wTFvodblK0mEVkLf/TnNXM8Bo GnRLy/4G0dZ10SiSmYK7fQ8dkobJaCEEy62h0tlVic2Vlf3D2iB9CrdrPW4NKHlRaePG PCvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=upcYox+hR0ff8PbXC/tjXbgIwJyTE9zI/gU5bKsBrcE=; b=QNT2SyalOGrH1ViGtq7K5lSmqJ59YGMllYYAZTzfWbM0kl15MNUl3WFHM7fOzZYJ8+ yVOmNJh7IScDp9cjCw4cBg70rS+uEIY7oLWEDhLhj2yc54iJKZj32JsUT8daQnPUwl3E a21Btu+JGtGRpZOMbazeDm2UrK6gL1BGRghqFlV+Kr9FtFSBYSmzJk+fVFZbjLHkY5Cq Gaq/xAhGpn8718GgGvFj5FbwtyIHqI13YZCGLiwSw3kBGv7mscqOO9UpGHzfCt9Rv28k Rojr8rUR1hESJE5PaxWQCVlfB2Q3bfeoOJjJlsPb+tjreJdLlASpHVRjXyyQsFkPKPqT jlyQ== X-Gm-Message-State: ANhLgQ3QaWXmW2K2JO6vbq1vQqnDlzj/+jP5AW2ZvX+6yRFBohtodpCp FNBJIP0ku3ZQe0d3zLMrZTeFng== X-Received: by 2002:a17:902:7794:: with SMTP id o20mr1418285pll.312.1583903335973; Tue, 10 Mar 2020 22:08:55 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id o128sm16053078pfg.5.2020.03.10.22.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 22:08:55 -0700 (PDT) Date: Tue, 10 Mar 2020 22:08:54 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: "Huang, Ying" cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Hildenbrand , Michal Hocko , Dave Hansen , Mel Gorman , Vlastimil Babka , Minchan Kim , Johannes Weiner , Hugh Dickins , Rik van Riel Subject: Re: [PATCH] mm: Add more comments for MADV_FREE In-Reply-To: <20200311011117.1656744-1-ying.huang@intel.com> Message-ID: References: <20200311011117.1656744-1-ying.huang@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). The rest looks fine.