Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2820342ybh; Mon, 16 Mar 2020 10:18:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsYM3dEMxSdS/0vla0e+DNu/ehMG36yKI0e3E0rAv/47PdZG75lu2x8EAkrKMip853qFcSL X-Received: by 2002:aca:4243:: with SMTP id p64mr417558oia.21.1584379115483; Mon, 16 Mar 2020 10:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584379115; cv=none; d=google.com; s=arc-20160816; b=Czl4ZGIPpj/7auWBPxdxe+kO0DjqBseK9VnxmU6Lt1mH2NqIgglXLAK5VHSXZ+FnAL ENrN1QxRmnKqMwjwrszZOb0KolUP24jsdZpcVvmZWaBuX9qgeVcPdjs/VBUN1Ol1yRWp v7snWwklFX/mWH0NZ5UYugAGtMUacgCTPFMd7gheKVX4OtUJIdvUGGyfHTkFq3xzIzGy 1UMzjShTLwVFSjp4SmvLErG1KwCtriX2KFAUYKnCq2H9aErJi3SNm1FJs4JwJEC6KpXB Pj2rqjpCvQpDYZb53ulJl+wmOwQItZ59MSvmW8U+KIpNG9fRA5qaPebRLTmLGICpppCR e91g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ptDZGW2Q9xCQbIeKzlcVKK3Z8gI3BZpnmx2b10FmeMA=; b=TNRis/a4vk5aTMidJmF06IE60Lf3N94jYgV+k6Qif9Nd21oLbrH0kdmVPRUMCGWLpr Dsx0pLHW540TbDHuYeY3/d3xtsSyL5ri1ZgQq/eEjl6nteTPbvO3bCvpJZ3VwWxu1E4e E7BQUlV0C9ISPB6EDw2oMalCdHbRHKwfGlaCY2M/eMP5JFxlKxzjLIBXh0XItEz/x0DM IboyK4pTNECCXxZJMSqggOVV8suqY4QE9ssg61FHZyHSPacN2s3X4c7FQzHwOMbfZLJ/ mci2L95wjqkbU4SQqJB/7lRNm7h+IVzuPtTS2Of8wOiIIgA/F2ozSaTW0+ZE9+wSwzG4 TJ/g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f129si271894oia.243.2020.03.16.10.18.22; Mon, 16 Mar 2020 10:18:35 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732070AbgCPRRa (ORCPT + 99 others); Mon, 16 Mar 2020 13:17:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:51956 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731507AbgCPRRa (ORCPT ); Mon, 16 Mar 2020 13:17:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 146E8AF77; Mon, 16 Mar 2020 17:17:27 +0000 (UTC) Subject: Re: [PATCH -V2] mm: Code cleanup for MADV_FREE To: "Huang, Ying" , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Hildenbrand , Johannes Weiner , David Rientjes , Michal Hocko , Pankaj Gupta , Dave Hansen , Mel Gorman , Minchan Kim , Hugh Dickins , Rik van Riel References: <20200316063740.2542014-1-ying.huang@intel.com> From: Vlastimil Babka Message-ID: Date: Mon, 16 Mar 2020 18:17:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200316063740.2542014-1-ying.huang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/16/20 7:37 AM, 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-and-acked-by: David Rientjes > Acked-by: Michal Hocko > Acked-by: Pankaj Gupta > Cc: Dave Hansen > Cc: Mel Gorman > Cc: Vlastimil Babka > Cc: Minchan Kim > Cc: Hugh Dickins > Cc: Rik van Riel Acked-by: Vlastimil Babka Thanks! A grammar nit below: > --- a/include/linux/mm_inline.h > +++ b/include/linux/mm_inline.h > @@ -6,19 +6,20 @@ > #include > > /** > - * page_is_file_cache - should the page be on a file LRU or anon LRU? > + * page_is_file_lru - 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 a lazily freed anonymous page (e.g. ... > + * 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. > * > * We would like to get this info without a page flag, but the state > * needs to survive until the page is last deleted from the LRU, which > * could be as far down as __page_cache_release. > */ > -static inline int page_is_file_cache(struct page *page) > +static inline int page_is_file_lru(struct page *page) > { > return !PageSwapBacked(page); > }