Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3506213ybh; Tue, 17 Mar 2020 01:11:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs17/nJmT6+IIRoLN0mVrIeanMW+HdjBRuGN232/WKGL9xTA5Dx14u31nCdIyJE4TIU21Nt X-Received: by 2002:a9d:837:: with SMTP id 52mr2611722oty.354.1584432676517; Tue, 17 Mar 2020 01:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584432676; cv=none; d=google.com; s=arc-20160816; b=icEyMoweYd2CkEHpOGLM0Qo1K7s2JL0SpLO+IonPnDYvuc9EYGUbk4IWriN6rT6Zew 1uL9y5p4pqk6Fwz62PhrBbrvqXRqVTX1QoRnihbtWR5G7+asb+QDzou7T3PapRLR24tJ Yj3YpcFIwZDnKMtdK8hgFu+pi9mZ0JkI7f8Ej/pGpRBVOLVPgGyeHi818XRVTJ78w2Eo BU7wChwTv1C0fkt77fMeUjGlXaLD205fjKq3D/MfgC9x3e6fQHhpyp5PjwFU79PIdGRC aVDNxO217pZsg4utZSEWsYUDQTNSOJ2gtbYiuYIwrdDB4MMPZilI+hjZSACys6iC2Cxt SLFw== 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=J2EYlhCuYpm5Hoy4ntfLCXAFrS7yJ4Zr7LjLzakbQBQ=; b=H2AvpF/MuKJg1lEwTWuYT0RMs8QDQkM/IQkC0nkgb19B4FblaIHDjmTUAEwaH8meP/ 0/kFRscCHtDpS4hEIZ7GK9NbfO6Q7P1XP97piDrQAup50h8XG0FHf9aWE88hYP/X94D1 6IJQjZSrTnIEJmwPPn0dBlDEQI9PJKsEHbuihF/xNhePumvLG20M8ZYou4hDKYj59B/Q MKE2hAyJXY8Nc4Z+N6Uu0fX7g2qDOMjEzuxlodwIcAZiJVyCqFIr0WWdvgbZBmsG/btI 6VCCi/nbqlXJ74QVGUqLHuG3fyXuqkZKYMbJIbofJcCfmMBOH10ohARRSo43LMEvBl/u 0GcQ== 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 q26si1359451otn.296.2020.03.17.01.11.02; Tue, 17 Mar 2020 01:11:16 -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 S1725962AbgCQIKh (ORCPT + 99 others); Tue, 17 Mar 2020 04:10:37 -0400 Received: from mga18.intel.com ([134.134.136.126]:46845 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbgCQIKh (ORCPT ); Tue, 17 Mar 2020 04:10:37 -0400 IronPort-SDR: mytqB5Eott+JlRVvCMg/6juDbVpJTbkD7nJ9csY4gidfhlV1O0Agoz1vfSJOH33STI9HM5Tleo 3denp2i8aHXA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 01:10:36 -0700 IronPort-SDR: K2hESqp48NSCqGFGaKbO3ciySRYdVROgOrIRP4l7rCNs+3TAxWjTlBB5/yV5NiEbmvgBlQSO2b P63UR/LO6fXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,563,1574150400"; d="scan'208";a="262954250" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga002.jf.intel.com with ESMTP; 17 Mar 2020 01:10:32 -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 16:10:30 +0800 In-Reply-To: (Vlastimil Babka's message of "Mon, 16 Mar 2020 18:17:23 +0100") Message-ID: <87v9n3qu4p.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. ... Thought again. Should we make the 2 sub-clauses consistent? That is, either if @page is page cache page backed by a regular filesystem or anonymous page freed lazily or if @page is a regular filesystem backed page cache page or a lazily freed anonymous page But I know that my English grammar isn't good enough :-( 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); >> }