Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2084164ybh; Sun, 15 Mar 2020 18:45:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvVGJ72Y+ZLi6jkvcyslYNXmxnp0r7D230llCsPuNUXSHtDtISzKigcJOjMwLXJJ32iVMhM X-Received: by 2002:aca:cdd1:: with SMTP id d200mr15114361oig.153.1584323149487; Sun, 15 Mar 2020 18:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584323149; cv=none; d=google.com; s=arc-20160816; b=iPGTESsL4VbhjO9FiRXYwveS02KBtPM5AeDvNZhQYg7RHd2OGBL+NGSo89UmYGo0jt pY3YANf42YnVxCv63SbU/t1jNvK0mDzoAaxWKfgMhAr3EpJ1dowkDfZ1lbeCrGBHUkQY C4v0FZGNOvJUjc80yG/M7+OMobDQH9GA7qlb6mZ2Oi25MOiIFt9+Dp7RPPEDBTpM/vP4 +Z1QP99/WPWlARbGcbhfogpM5gY9XAR9p9qlr1gC61ue/nmy+O7kWITfdqmaV2s1ClZ9 qxhPbekG9gdyzysRxTA8K3SjMvDaSWUoiz2xwHzonoBBIN/ZfREtHRGFM+ghvODH8nop cFSA== 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:ironport-sdr :ironport-sdr; bh=dfmUrQ4Mkd6BlWlF6MBIvrwfmEz6zycuKIQ4zFXS+Kg=; b=w+xakkyYFwS1pstn3/QcRHXF3va9LZTNT7rl7VjONbMOgpwZPgw29mzfoN+By51tMB X1sF7UtBWjIajhc8wx5XZptVTu2X8c9TiP/kuyqG0kuXuzB1o45EDccEFfppjUWSj1mm ETL6efp3Hbkmk4X1hcCy5R0G/P8pWEWtKg7KtI6CSHHufmQ0uPz7apHHRXErh8szsBww /fwpnloLvSY+wflXQZdhd4OLTFbfTDDMUuZ2k31UaLjufHsTBjQUPXnsXcpLQpG3EEeI MVs3dpdlgWF0+gkTWAwF9kGjs/FoeeXVmNX+BW+Dn16W2OUfLyxwsSKXrcoIP0VdPfXJ jtdQ== 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 a185si8916759oii.252.2020.03.15.18.45.36; Sun, 15 Mar 2020 18:45:49 -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 S1729387AbgCPBmK (ORCPT + 99 others); Sun, 15 Mar 2020 21:42:10 -0400 Received: from mga03.intel.com ([134.134.136.65]:6368 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729334AbgCPBmK (ORCPT ); Sun, 15 Mar 2020 21:42:10 -0400 IronPort-SDR: O/Z2YOTLKLqoK0Fk5c+mgnq9OCGA7MrqfRqvIKQSu6cK3wbeo+jfRGPvgX75zyVdvhTaUNrKq+ 5IHFqPxwtwcQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2020 18:42:09 -0700 IronPort-SDR: lYtXIWizZOAFxPjagGVaF4ViQ1QnfLKlavNwEWajeu07MmSbJti9quaIsPEdONGfRUQppcMPDV Dw3YZ6VW3g5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,558,1574150400"; d="scan'208";a="278876272" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by fmsmga002.fm.intel.com with ESMTP; 15 Mar 2020 18:42:06 -0700 From: "Huang\, Ying" To: Michal Hocko Cc: Andrew Morton , , , David Hildenbrand , Johannes Weiner , David Rientjes , Dave Hansen , Mel Gorman , Vlastimil Babka , Minchan Kim , "Hugh Dickins" , Rik van Riel Subject: Re: [PATCH] mm: Code cleanup for MADV_FREE References: <20200313090056.2104105-1-ying.huang@intel.com> <20200313154110.GH21007@dhcp22.suse.cz> Date: Mon, 16 Mar 2020 09:42:06 +0800 In-Reply-To: <20200313154110.GH21007@dhcp22.suse.cz> (Michal Hocko's message of "Fri, 13 Mar 2020 16:41:10 +0100") Message-ID: <87lfo1rs7l.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 Michal Hocko writes: > On Fri 13-03-20 17:00:56, 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-by: David Rientjes >> Cc: Michal Hocko >> Cc: Dave Hansen >> Cc: Mel Gorman >> Cc: Vlastimil Babka >> Cc: Minchan Kim >> Cc: Hugh Dickins >> Cc: Rik van Riel > > Acked-by: Michal Hocko > > Although I would rephrased this a bit >> + * PG_swapbacked is cleared if the page is page cache page backed by a regular >> + * file system or anonymous page lazily freed (e.g. via MADV_FREE). It is set >> + * if the page is normal anonymous page, tmpfs or otherwise RAM or swap backed. >> + * > > PG_swapbacked is set when a page uses swap as a backing storage. This > are usually PageAnon or shmem pages but please note that even anonymous > pages might lose their PG_swapbacked flag when they simply can be > dropped (e.g. as a result of MADV_FREE). This looks better, Thanks! I will send a new version with this. Best Regards, Huang, Ying