Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3157827ybh; Mon, 16 Mar 2020 17:12:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vved2jOhm6trq7Aw2/A7/Ic6Gb0+ai6FwBGb39ik4G1ep5keq8uuP1uteD93RKGhr7/rban X-Received: by 2002:a9d:7085:: with SMTP id l5mr1449101otj.53.1584403947372; Mon, 16 Mar 2020 17:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584403947; cv=none; d=google.com; s=arc-20160816; b=I/oIp55DaATLOsHN4y4wjhlfG8OUXNL0gA8Zi/w8o3b6itfjJ+3TQFNlWTlALTYWC3 lHpkffZYniMTuDCJTNjuCa3LFoKhRyWwFssHWRQyjjsSnffXlsTzGiOkOToSoIVTABdb U3qTWS8dbk7yJkMfsq7p0U94V7kx1U8BXv29lAgx2+ICAn7yfLt1rxYaCTD5qctg9NzF cQqAgHqBCDNeTpckDVUQW2eEXbMVf7zmOWTIAKmV6miFIhir2s7MLIdMSjG6eTuQ1Qpv +Z6TzmItv7M78mO/Q3DC2ML9MWyzjv8db819InJLDlNbge1/7yzF7GvioVrPZcBA2vtO O1zQ== 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=FrVvr0ZsVA5AkQpF4pnS6WzI0neNC/+Q6FtALi9yj1Q=; b=Ve5Q03ILTtbo0gugJ9kI8f0PVCQREmQyBC7LpUj4AryJTyYIp0+xGbKM7co7pLFl+5 dUfs0cF2G++jAcC1oqQ/cVbN8qYticJ5i0gkKPSELyJRGMn0xk0igMFxwHiHULkC0XC6 kcE5ab6lD6pXqx7Whyj4FaaCNwGtIVLuAs1SjpgXwms6ilne5Yw6wNVBQwjVHT980kge n43dlccl/uw4fulp86MlIvGkQGe5ofxVLI5n17kCf+b6VV6ei8CyKvwQ+MtPZJh3SVcp dxlEUNCBh88Miv3kocAzlWYP4WVZbjTpSj6QVwsbJCCMB8h5yYn7sfVoYtL5UijCrSPS of6w== 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 l75si761325oig.59.2020.03.16.17.12.05; Mon, 16 Mar 2020 17:12:27 -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 S1733035AbgCQAJ6 (ORCPT + 99 others); Mon, 16 Mar 2020 20:09:58 -0400 Received: from mga03.intel.com ([134.134.136.65]:38425 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733023AbgCQAJ6 (ORCPT ); Mon, 16 Mar 2020 20:09:58 -0400 IronPort-SDR: 406hLhuOexCsEZ8NRv3Vatgd1ifZPAmg9jKWzHrYLfT2/cTPSkCfa2AdxYsjL6YqQFFnrBXGWr kqUNGnjYp1jA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2020 17:09:57 -0700 IronPort-SDR: 1mju6VfkWy0cor19qBf5YzeF+KyO2QIqmzxPUyz9i+5AfpCwdqgIo9CENHwv+zBXU83VEsBzM4 Bl3ljq7KfSeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,562,1574150400"; d="scan'208";a="417355196" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga005.jf.intel.com with ESMTP; 16 Mar 2020 17:09:54 -0700 From: "Huang\, Ying" To: Vlastimil Babka Cc: Andrew Morton , , , David Hildenbrand , Johannes Weiner , David Rientjes , Michal Hocko , Pankaj Gupta , Dave Hansen , Mel Gorman , Minchan Kim , Hugh Dickins , Rik van Riel Subject: Re: [PATCH -V2] mm: Code cleanup for MADV_FREE References: <20200316063740.2542014-1-ying.huang@intel.com> Date: Tue, 17 Mar 2020 08:09:53 +0800 In-Reply-To: (Vlastimil Babka's message of "Mon, 16 Mar 2020 18:17:23 +0100") Message-ID: <878sjzsuy6.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 Vlastimil Babka writes: > 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. ... Thanks! Will update patch with this. Best Regards, Huang, Ying >> + * 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); >> }