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=-4.0 required=3.0 tests=MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 CBB59C10DCE for ; Fri, 13 Mar 2020 15:41:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7ADD1206E2 for ; Fri, 13 Mar 2020 15:41:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ADD1206E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DCC936B0005; Fri, 13 Mar 2020 11:41:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D7E2E6B0006; Fri, 13 Mar 2020 11:41:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C96546B0007; Fri, 13 Mar 2020 11:41:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0134.hostedemail.com [216.40.44.134]) by kanga.kvack.org (Postfix) with ESMTP id B51266B0005 for ; Fri, 13 Mar 2020 11:41:14 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 77E6A52AD for ; Fri, 13 Mar 2020 15:41:14 +0000 (UTC) X-FDA: 76590752868.26.fifth57_ac9e28125208 X-HE-Tag: fifth57_ac9e28125208 X-Filterd-Recvd-Size: 4137 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Fri, 13 Mar 2020 15:41:14 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id 25so10495781wmk.3 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=EAZ05NMjpMeRCgpOCO3DjD6ufeYo2auwlkLCreQQHGjrM7DNXFAHWO4G6MKIa0HqT0 YzhMaBdCIj4Dl48J/JyLb+xDpfg0wp4P6VcRblGoAD6YXPWReTpIEATT3XmcTFKCzY5I XcJg3ROlDkekhpfvGbeDrFdv9S2GZpp/JfUyVb4UIDEjfKDgcy4015LG8o+8t9l6RpMV kBcKLN9i2Xx5BpjetJsKflHh7pF4JLVUpxTNXEyIfn43HGq4NyJ3u0Fst/Z/2LG4RQQJ 2uRFjCoDOcR0DzfBBusje147e2YeeHl67LA+YBrLc7z1HKIW3slm3W0mbDR9lTZY6d17 J3jg== X-Gm-Message-State: ANhLgQ0Y3Ylf7mRq1mMws8Lfa7MIKEIOpkL3B3dv1k/+we9OgflJ0+08 32dxRCuT35tRXjQDMjO8a6w= X-Google-Smtp-Source: ADFU+vubCQz/pw1/gHUN38Gv+kKTeEXfXIKG6z5UA/SluUtT62FiwYYo+OtYH4Tq/5PNvVY33Ih1hg== 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> 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: 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