Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3313145ybf; Tue, 3 Mar 2020 03:45:32 -0800 (PST) X-Google-Smtp-Source: ADFU+vssM+DNOml0bBF8dt/Ias6WZztfll7rdviDZwI5H7eDp/aJoyhxFMI5iReXl2h0Nlakk6NE X-Received: by 2002:aca:fdc6:: with SMTP id b189mr2080966oii.10.1583235932548; Tue, 03 Mar 2020 03:45:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583235932; cv=none; d=google.com; s=arc-20160816; b=hTDz0hTiZGIc3qWdpokR2SecFbEqvR+hbCvdQuM+OiH5C68MkwTlb1wIIckBODrWmG 92RSynKv0aSyCOiANhmcG02SAjWrs1VPhnGsByEYyUylJFET0whAjIVEbnfAKyAwmQlN FtRUnpsH/OB00I6yXj/UZXHPCPF/RYnZURG4Ev1c9v2eULVyID3yjmg11/P0KR75JTJQ 1vdGIWPuFoMdOQzj/QdJaEHAIUqxHVDrexSmxlGNquA0n5vKp0H7qx3MrxX71z+DtQAz EOQBUdqITOsfq7VJp28jKZi2W9mWDH5T51y9qxL7nRz8aZHi6saji8mVze6thDYyENiv brdw== 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=rrzGJFdHXlVPETX27PP5kEhfFIpHSpgHCINiCVEnhD8=; b=dWAbYCUMXnPxVX8/Mnr0BOfeQjD9eMXByDnnmY3IYBaGovPG7RdNMBDdPAUhOMuDDu eByAk8j90Q1LzXVkKuOINtjQm3lzcmHdYbnCV9l0xpN6Nw6olgTM1op3ZGPkANUsqfww 66zx1o6zLQ/ZvshuNdqjpPuTswhiBbkB09VrQGpp5xZ8WYXC04ZF2i6n1DToEDvw6HDw 2PbUi1+84c80ny6RFHBx91ZJS0i11u0APK+ccYQO32/dcOY5Y6GlSY/S6UQP7WDhxmDf 7thgOupSdifX15UopzVYmpYk93ESvqoKrnA3HrOlp3bbN7uL3odhUuc2lt2A/EA8Rd75 swUw== 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 v9si4900260ota.239.2020.03.03.03.45.21; Tue, 03 Mar 2020 03:45:32 -0800 (PST) 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 S1728275AbgCCLhD (ORCPT + 99 others); Tue, 3 Mar 2020 06:37:03 -0500 Received: from mga11.intel.com ([192.55.52.93]:48947 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727824AbgCCLhD (ORCPT ); Tue, 3 Mar 2020 06:37:03 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2020 03:37:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,511,1574150400"; d="scan'208";a="258350423" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by orsmga002.jf.intel.com with ESMTP; 03 Mar 2020 03:36:58 -0800 From: "Huang\, Ying" To: Michal Hocko Cc: David Hildenbrand , Matthew Wilcox , Andrew Morton , , , Mel Gorman , Vlastimil Babka , Zi Yan , Peter Zijlstra , Dave Hansen , Minchan Kim , "Johannes Weiner" , Hugh Dickins , "Alexander Duyck" Subject: Re: [RFC 0/3] mm: Discard lazily freed pages when migrating References: <20200228033819.3857058-1-ying.huang@intel.com> <20200228034248.GE29971@bombadil.infradead.org> <87a7538977.fsf@yhuang-dev.intel.com> <871rqf850z.fsf@yhuang-dev.intel.com> <20200228095048.GK3771@dhcp22.suse.cz> <87d09u7sm2.fsf@yhuang-dev.intel.com> <20200302142549.GO4380@dhcp22.suse.cz> <874kv66x8r.fsf@yhuang-dev.intel.com> <20200303081929.GY4380@dhcp22.suse.cz> Date: Tue, 03 Mar 2020 19:36:57 +0800 In-Reply-To: <20200303081929.GY4380@dhcp22.suse.cz> (Michal Hocko's message of "Tue, 3 Mar 2020 09:19:29 +0100") Message-ID: <87k1414qli.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 Michal Hocko writes: > On Tue 03-03-20 09:30:28, Huang, Ying wrote: > [...] >> Yes. mmap() can control whether to populate the underlying physical >> pages. > > right because many usecases benefit from it. They simply know that the > mapping will be used completely and it is worth saving overhead for #PF. > See. there is a clear justification for that policy. > >> But for migrating MADV_FREE pages, there's no control, all pages >> will be populated again always by default. Maybe we should avoid to do >> that in some situations too. > > Now let's have a look here. It is the userspace that decided to mark > MADV_FREE pages. It is under its full control which pages are to be > freed lazily. If the userspace wants to move those pages then it is > likely aware they have been MADV_FREE, right? If the userspace wanted to > save migration overhead then it could either chose to not migrate those > pages or simply unmap them right away. So in the end we are talking > about saving munmap/MAMDV_DONTNEED or potentially more move_pages calls > to skip over MADV_FREE holes. Which is all nice but is there any > userspace that really does care? Because this is a fundamental question > here and it doesn't make much sense to discuss this left to right unless > this is clear. Although I don't agree with you, I don't want to continue. Because I feel that the discussion may be too general to go anywhere. I admit that I go to the general side firstly, sorry about that. Best Regards, Huang, Ying