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, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 65EE5C10F29 for ; Mon, 16 Mar 2020 01:42:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2F21320663 for ; Mon, 16 Mar 2020 01:42:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F21320663 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 AEF5E6B0003; Sun, 15 Mar 2020 21:42:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA01F6B0005; Sun, 15 Mar 2020 21:42:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B6D46B0007; Sun, 15 Mar 2020 21:42:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 86E6C6B0003 for ; Sun, 15 Mar 2020 21:42:12 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3D3BB180AD838 for ; Mon, 16 Mar 2020 01:42:12 +0000 (UTC) X-FDA: 76599524904.28.unit17_879394db94133 X-HE-Tag: unit17_879394db94133 X-Filterd-Recvd-Size: 3604 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 01:42:11 +0000 (UTC) IronPort-SDR: O3YWxoVDv+xtMtlElIG2oqOTv9mQLQ3ye887mFoOKNt8OCLHxWihzi/Zhz9FB1FUi22l2lAYcJ uHdViH4P3LlA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.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 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: 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