Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1863050ybh; Fri, 13 Mar 2020 08:42:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvq15PefI9+axvNUIaKQ6k9Gs4ZyEd20uNPbgv6CSI9tzD/7n5rneCA8S28vXNb7tIoDtY3 X-Received: by 2002:aca:3b41:: with SMTP id i62mr7263779oia.55.1584114120413; Fri, 13 Mar 2020 08:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584114120; cv=none; d=google.com; s=arc-20160816; b=qARsO95LR3dNkCwnug46KVyJQqxDNkRIbFx3haGWMXC68KtMfzHoPz8cSFltt7bxj2 Lqc5uwvERLypRq+rjzDvldN355IKj5DItd1cONSf3I6hFEtQJfn7O2dRlE0gvi2U+ZS8 Gw6funu0j2t1wCAbSs/6VIG9Z5ehRqRnfJFoiyV3g7xDN0XIG1Bgn+bUQtaJ6wcTQuff QCgt/gkcC9bqFeWbckUgLMMli/aGP0xds6ET4Ez7yOvKBro2xNTq7LLOAztAiVL0CmVY VbBLd+sABxxvIFDL9jvB7lu/N416Sz9ajhMKbVB0966zj5Rk5EWbI5ZCJQFOtBQYVmON OhUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=gkOpGqZ4HZ0Gczdmy8fRkS4oC/ZNHjgZPtF1KgbpwK8=; b=lUjrr8B7usGoDr58CkIklGPXi3c3cIv3ub2ClHA9yMvCKuWbUWEgnIeSSfKScSiOvP x1VhZfp8vT8ClBwsN+dBqmNXFPcaNPUlmNag+7OgdkiswE68wfJbackuKC1OG0byOTmQ s1F1jBwc3k9AQS22jXOBx0VsMZ2BE6nO9zGg6tUFcHdhjdwZsZ5l13XNRv/GikAUHkM3 74klhFe7Z7UMb9rxYVnpdwo4HBDZNIcYeN5+zcsXG4VfYCAPuXV1gfDImYxtqlnB9kkD uL2EVq1COU+nAK0ZTexd2eJYs71ZmkpBcweIWgr6adSfxvkyQuMkUnSN6Ma13Xr41lzX HxqA== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w73si4223382oiw.206.2020.03.13.08.41.48; Fri, 13 Mar 2020 08:42:00 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726664AbgCMPlQ (ORCPT + 99 others); Fri, 13 Mar 2020 11:41:16 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51239 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbgCMPlQ (ORCPT ); Fri, 13 Mar 2020 11:41:16 -0400 Received: by mail-wm1-f68.google.com with SMTP id a132so10491692wme.1 for ; Fri, 13 Mar 2020 08:41:13 -0700 (PDT) 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=gkOpGqZ4HZ0Gczdmy8fRkS4oC/ZNHjgZPtF1KgbpwK8=; b=RlX3asRT/tnr6igLFmVaj3qmvuypOSE2YNCtWMs1+F7DI5I3BaP0aWk3zoR+Wr6lhw hzI2k+Yb2x5k4oA7xI4IozLzzeZmBLvET9PJjK+V0R18ebMeDnMv5Yi/i8ZxN69Nwk98 GwUkGDvDCUlLihIvoptHwuZkGCd0LKFvQnLCT/7yh0PYWIe0VykwUSrXsaeLQWK5NzbK hT4VJ/xW3FvNIrVyxYKfqSHjT4wkho4l+L5QPSAr/tO8TtnjF8R1YjhJi4XByhOhYlSx ecEoxH6+3mMbUjnCA4yTCY9/otelrl+Xp1gTQ9ZbW7r+bute9xk1ElabtOKmhDlmWyEm ilzA== X-Gm-Message-State: ANhLgQ1RImQBgEHvGbJe1o68un6x99syCY96EsUJ2Qz7sTXkwkZxQdDk HiBxvl66JVKGdRuQ82/zTA8= X-Received: by 2002:a7b:c456:: with SMTP id l22mr7278014wmi.184.1584114072890; Fri, 13 Mar 2020 08:41:12 -0700 (PDT) Received: from localhost (ip-37-188-247-35.eurotel.cz. [37.188.247.35]) by smtp.gmail.com with ESMTPSA id f15sm17298220wmj.25.2020.03.13.08.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 08:41:12 -0700 (PDT) Date: Fri, 13 Mar 2020 16:41:10 +0100 From: Michal Hocko To: "Huang, Ying" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, 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 Message-ID: <20200313154110.GH21007@dhcp22.suse.cz> References: <20200313090056.2104105-1-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200313090056.2104105-1-ying.huang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). -- Michal Hocko SUSE Labs