Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3087291ybh; Mon, 16 Mar 2020 15:38:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvGqwjA9Fx33KE2YFcPCSyVQN0N3DVeHsnBYRYpsW7Z9NkjoZLBHWPIf1nyYvQo+1IAJ1tc X-Received: by 2002:a05:6830:1697:: with SMTP id k23mr1336649otr.155.1584398339315; Mon, 16 Mar 2020 15:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584398339; cv=none; d=google.com; s=arc-20160816; b=HBbMvVTGs1nZbvaoPrG4vRxPLxsyg6dR9vN3DU4mYhyoOsWh9EoK6oalwLo/DzUZ2d i6ju2onh0tdcWGxp3ICyS358w1kf+IFLi5AyxPQPJ75CvRxrSt4oqEuOVzUzV2QUsoCP 8zdJlUrv5vPku4cf8eoTW3B3SLh9k+vUXt4/rtjWMCOQo+tpm3KlxrAD2YRGymsKpW8t lK7D85sUDnfThn0PzxQKhR0CDVpnmTJrDH3G+oOGk+82QQvU4yIjAW/XKeYkqpkfQu7f Zp3exYR+L+G0u7FlxXLU6yMpXCd/nEHHreNw4rN1s5AwAE7rcnzBsMYIoTjo/Lwdhks0 4ytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=1fBBOx02VcEYppdCNi5Xl2Em7WTei4uipjmvF9jzRYs=; b=mYkZjD0/vNdLRPo59wnr7fTx9rj+k32ZlLeqWHTYy2Tnso+pZHGygDjf5lUBNMGou3 WI+7T2QHHHU3dfMwl89RmuQgxjlQ07Yjjv6xkqIzZ70Fopps3GmA79OvI/BQI+hJks0T cxsQODlr+GR9TG/7LW1VHRz8MOjmmmPb4HkJ9HLnohHxkxr8w2F4U6mVHrAfAYYmsPEH MmmF2iRG2UKcrplsK0/ZhUy4EhkPt27XoHWJY0Z+fdMOu9WZa5IeHLxA/FS+pk3vynoX PT5IjbzN7BtiTfHlsfiomXzi0BF2jV2bvDk7GrufsijxEGjLaH3syWLXxmMx2mZUmOhd 4SCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="VIU/bY9A"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g25si690821otn.258.2020.03.16.15.38.46; Mon, 16 Mar 2020 15:38:59 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="VIU/bY9A"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732842AbgCPWiS (ORCPT + 99 others); Mon, 16 Mar 2020 18:38:18 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55158 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732739AbgCPWiS (ORCPT ); Mon, 16 Mar 2020 18:38:18 -0400 Received: by mail-wm1-f68.google.com with SMTP id n8so19452628wmc.4 for ; Mon, 16 Mar 2020 15:38:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1fBBOx02VcEYppdCNi5Xl2Em7WTei4uipjmvF9jzRYs=; b=VIU/bY9At5xVG9wGhnfLBhqN5QhHGKCCXmnN0KqYvjF5a52JUlieZIV/k3W7Zj8g1F MFNBVubiu0gUfDZ9X2oPNmd5daPqxz2V2TAmpJkUMKOmsWxB11u4e9+XB4aMZZpiWATd aLmESwpnTHPZNYPpBtRmFdVWiS/8d3rxkCcyUENSLnbb/NZq2Su3zNs3hOJJ4Iwsv6kY 6OAmsB+ki3dgNsnGBnnPErL28p9mGumyb/c6ufE/eE0zt4wX7PLbjPI09wsx+mjohR2y XeRLugX//utJqPKRSD2TAVvv1avqSVifEO0XR1NrCG75QuxCio5D4R8Qb/FXNN/Sp+lD Ml2A== 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:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=1fBBOx02VcEYppdCNi5Xl2Em7WTei4uipjmvF9jzRYs=; b=o56cAxHzXi+eIwUuB7gBXD0vJPN4K9b0nUZfO6GMZrO53ftQckWFuRcle3uWOsq9sQ nfqDRo+jRPIAzNK5F9kLVVubIqrIcr4E5g1qoA+iDwQBXhh+1+rir3U5t3lk8gnGWo7N /BpuHGtwnNIzhOVJwFgWZU95YQSZLjumCin2SxtVkiW/GF7kbyvA6ulhIFlYp0Uu4hI/ PAnfrU/Dbj65aBqhCyIRVecZ2stYJmYK4Jpq+3CGZeGFhfRl5Dm2IX/phez24jLn/ILR H6762d9dXHKnVMdWEyzFVaQbTv5vzsIrB5EeBg5TUWsAhoAjeQeKPEmTnycfQJoG8DIj 2YDA== X-Gm-Message-State: ANhLgQ35ODq7xy/b/80D2UJ4AAhNgZ5g2fA5JhciLjChTwsGF9LIfQHo c3hytMM58ok8pWI7nRB39k8= X-Received: by 2002:a1c:3dd7:: with SMTP id k206mr1292164wma.147.1584398296193; Mon, 16 Mar 2020 15:38:16 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id w204sm1427927wma.1.2020.03.16.15.38.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Mar 2020 15:38:15 -0700 (PDT) Date: Mon, 16 Mar 2020 22:38:14 +0000 From: Wei Yang To: "Huang, Ying" Cc: Wei Yang , Mika Penttil?? , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Hansen , David Hildenbrand , Mel Gorman , Vlastimil Babka , Zi Yan , Michal Hocko , Peter Zijlstra , Minchan Kim , Johannes Weiner , Hugh Dickins Subject: Re: [RFC 2/3] mm: Add a new page flag PageLayzyFree() for MADV_FREE Message-ID: <20200316223814.dpzlmfpb6a2cus25@master> Reply-To: Wei Yang References: <20200228033819.3857058-1-ying.huang@intel.com> <20200228033819.3857058-3-ying.huang@intel.com> <20200315081854.rcqlmfckeqrh7fbt@master> <92d4b0fe-f592-8da6-0282-2ea8a015b247@nextfour.com> <20200315122217.45mioaxzuulwvx2f@master> <87pnddrt5t.fsf@yhuang-dev.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87pnddrt5t.fsf@yhuang-dev.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 16, 2020 at 09:21:34AM +0800, Huang, Ying wrote: >Wei Yang writes: > >> On Sun, Mar 15, 2020 at 10:54:03AM +0200, Mika Penttil?? wrote: >>> >>> >>>On 15.3.2020 10.18, Wei Yang wrote: >>>> On Fri, Feb 28, 2020 at 11:38:18AM +0800, Huang, Ying wrote: >>>> > From: Huang Ying >>>> > >>>> > Now !PageSwapBacked() is used as the flag for the pages freed lazily >>>> > via MADV_FREE. This isn't obvious enough. So Dave suggested to add a >>>> > new page flag for that to improve the code readability. >>>> I am confused with the usage of PageSwapBacked(). >>>> >>>> Previously I thought this flag means the page is swapin, set in >>>> swapin_readahead(). While I found page_add_new_anon_rmap() would set it too. >>>> This means every anon page would carry this flag. Then what is this flag >>>> means? >>>> >>>> >>> >>>But not all PageSwapBacked() pages are anon, like shmem. >>> >> >> Yes, while it looks shmem is the only exception. > >Another exception is the pages freed lazily via MADV_FREE. > >> I am still struggling to understand the meaning of this flag. > >You can use `git blame` to find out the commit which introduces this >flag. Which describes why this flag is introduced. Thanks, I see the purpose is to distinguish a page: a) file backed b) or otheres This sound more clear. And now this flag is also used for MADV_FREE, which sounds a little abuse. This is the purpose of this patch to make a dedicate flag for MADV_FREE. BTW, the name, swapbacked, is a little misleading. Maybe just to me. But I can't come up with better naming. :-) > >Best Regards, >Huang, Ying > >>> >>>--Mika -- Wei Yang Help you, Help me