Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2111347ybh; Sun, 8 Mar 2020 22:27:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtR9x0m6UNhxdXszX6I9WgiyHTZ5WUzEefiuhlAMTu2EDF7VHzhnd7/J9Z4FCdrTvR2YvLk X-Received: by 2002:aca:d985:: with SMTP id q127mr9852911oig.132.1583731640307; Sun, 08 Mar 2020 22:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583731640; cv=none; d=google.com; s=arc-20160816; b=QbU4n5QdwdEtJZYjUaAUZZOq62lh2Jhna3umdJYsEvRPU+QnJIpgmtd3ViKLuy3yVJ kDDG41+rxgv1dpgzG5Eh65qG7Hm5Szj7mdRZAr3u7ZcxZsJb9YVj3KOa+1UJA/mwrNu0 cy0/98UNDAZOB3ir5zKVYE7cSau2lHhXJJpsb/BP2x0fxFmEU2XWopSPLaSyx4GIrtb4 uonvszw5DpystjQoahaiaIpD0xJn5o30xl2gED45nii7+gTap+y05hzF0lvH9IsKNjHj /SSf0VsLbLcMbqgUDXMFPgCXIUEZF4cVPcP975NmfgakBisDoFZNS5vuopmubCWdU3TM 4/VA== 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; bh=dWbehYUj0/YHouKwgopDKoa4SKjt90/z/jYsPGmI3nk=; b=zhWcIZrEd5R8+1SCmHTlMV5h6BfxoLxG1xw+8bjzLyM0gF5KrJYftqmeNJTYj9PpVh O/jLf9w5gO1Sy8fyiOR9xVk9OYxdC/UTpaBtPIVjLigpiwQBld+xgBXqYK4M+O6jVLZ9 +dN23XA3pc7qZFvsZ3K4vqHlzGCqCuchRzL59AYmi1TyTFx/6GEAvu5ZnKfYuDN6oEht iMzaC1EY8sxwGAB++9RB4aDVvM/hx+0yQoj8IlVr8uFh8gNgeb7t2pMjEvQUvQr8JT4c 9IJcFVhyO9xPPjZ5BhGpGEy4Bo1/P7nLn0CSJg3XqT4vZGdOMt7QNiv9iDn7fob16LuZ GIIA== 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 e63si3937209oib.19.2020.03.08.22.27.06; Sun, 08 Mar 2020 22:27:20 -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 S1726248AbgCIF0e (ORCPT + 99 others); Mon, 9 Mar 2020 01:26:34 -0400 Received: from mga12.intel.com ([192.55.52.136]:60447 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbgCIF0e (ORCPT ); Mon, 9 Mar 2020 01:26:34 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2020 22:26:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,532,1574150400"; d="scan'208";a="265139337" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by fmsmga004.fm.intel.com with ESMTP; 08 Mar 2020 22:26:30 -0700 From: "Huang\, Ying" To: Mel Gorman Cc: Michal Hocko , David Hildenbrand , Johannes Weiner , Matthew Wilcox , Andrew Morton , , , Vlastimil Babka , Zi Yan , Peter Zijlstra , Dave Hansen , Minchan Kim , Hugh Dickins , Alexander Duyck Subject: Re: [RFC 0/3] mm: Discard lazily freed pages when migrating References: <20200228094954.GB3772@suse.de> <87h7z76lwf.fsf@yhuang-dev.intel.com> <20200302151607.GC3772@suse.de> <87zhcy5hoj.fsf@yhuang-dev.intel.com> <20200303080945.GX4380@dhcp22.suse.cz> <87o8td4yf9.fsf@yhuang-dev.intel.com> <20200303085805.GB4380@dhcp22.suse.cz> <87ftep4pzy.fsf@yhuang-dev.intel.com> <20200304095802.GE16139@dhcp22.suse.cz> <87blpc2wxj.fsf@yhuang-dev.intel.com> <20200305104859.GG3772@suse.de> Date: Mon, 09 Mar 2020 13:26:29 +0800 In-Reply-To: <20200305104859.GG3772@suse.de> (Mel Gorman's message of "Thu, 5 Mar 2020 10:48:59 +0000") Message-ID: <874kuyyu7u.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 Mel Gorman writes: > I think the only concrete outcome has been that userspace potentially > benefits if the total number of MADV_FREE pages is reported > globally. Even that is marginal as smaps has the information to tell > the difference between high RSS due to a memory leak and high RSS > usage due to MADV_FREE. The /proc/vmstats for MADV_FREE are of > marginal benefit given that they do not tell us much about the current > number of MADV_FREE pages in the system. We can implement a counter for MADV_FREE that increases when we ClearPageSwapBacked() and decrease when we SetPageSwapBacked() for an anonymous page. But this cannot count lazily freed pages correctly. Because when a clean MDV_FREE page becomes dirty, there's no page fault so we will not be notified. And you have never run into the MADV_FREE issues other than the memory leaking debugging... Best Regards, Huang, Ying