Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5120494ybf; Wed, 4 Mar 2020 17:45:51 -0800 (PST) X-Google-Smtp-Source: ADFU+vswOGoQVWYypz28n7rTnCDc5T2QTTDd9ddyb2ih0mEMLz9d2ZRnElv50dj84MwAJkLBY5ak X-Received: by 2002:aca:d68a:: with SMTP id n132mr3988189oig.40.1583372751788; Wed, 04 Mar 2020 17:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583372751; cv=none; d=google.com; s=arc-20160816; b=wBXG6I4f8e5i1MD/Astv2Dpves3VESiLr/CvVbNJuiwBhT+dDA140Kzzezu7q6hZyI hO/c0wQxKbw4cVEXo+f75OVg0W6sD3o8llcdpH1ugKWGqzSE9kxC7VoQOQsDvmxeT1ph jCSIvd8KKU9cadtn0pNJ2mJXixmDNv8ha1u5+uzvnVsqSUfWeA0oUkQYsFw040lFzT0T k/z13ilgF1Z3ZYArTmE6ZqklE1VFt4P+cPWjF1pHvqFdXBWS3S7ldkWx2ikERxq3H6Cg FKtF3wNPRqssOkc+JS++xziguY0XPY1C4/n44Zcf9yJj/TTvdOge0GTXTBhdd9QCq9H3 P9SQ== 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=GrtPzwA5Y6ubdf1Ffv5zQfLKmraAVV7mz3cokNjhwTg=; b=LxxH8XkR2WyBaA6EHF8ykmukvVlmoUGJBmK8lufKZ5pW8/AnOxeU41sb8AtFTxTrip sLQkZGW2hGFKH5kJigUqeKuROWYqp1kqkP96Zd65inXA+FYpL6A1EmFm7sb6YjQobh74 +SK4vlnRyd3uHKs5F53sKUAryO3TUa/uUTbhlU1eOAgxHHmJlUcoDiuM4EFgfBtECEVf OZ7G/ukv2eXU+cHnxbh1QXHDyweQyPACS40T6sR93R9tPydJauOK56szjHhdAeV8QjxV GX7/LaxWsutr26bDym5ZGyrMl/G0m8K4mQLQ8k25Yffd6w4sgzVJvTrGd0SzR71y1ZoW LRvA== 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 d3si2140099oia.236.2020.03.04.17.45.40; Wed, 04 Mar 2020 17:45:51 -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 S1725975AbgCEBpQ (ORCPT + 99 others); Wed, 4 Mar 2020 20:45:16 -0500 Received: from mga17.intel.com ([192.55.52.151]:6212 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbgCEBpQ (ORCPT ); Wed, 4 Mar 2020 20:45:16 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Mar 2020 17:45:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,516,1574150400"; d="scan'208";a="263809050" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.159.23]) by fmsmga004.fm.intel.com with ESMTP; 04 Mar 2020 17:45:12 -0800 From: "Huang\, Ying" To: Michal Hocko Cc: Mel Gorman , 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> <20200304112653.GH16139@dhcp22.suse.cz> Date: Thu, 05 Mar 2020 09:45:11 +0800 In-Reply-To: <20200304112653.GH16139@dhcp22.suse.cz> (Michal Hocko's message of "Wed, 4 Mar 2020 12:26:53 +0100") Message-ID: <8736an3788.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 Wed 04-03-20 19:15:20, Huang, Ying wrote: >> Michal Hocko writes: >> >> > On Tue 03-03-20 19:49:53, Huang, Ying wrote: > [...] >> >> Because the penalty difference is so large, I >> >> think it may be a good idea to always put clean MADV_FREE pages at the >> >> tail of the inactive file LRU list? >> > >> > You are again making assumptions without giving any actual real >> > examples. Reconstructing MADV_FREE pages cost can differ a lot. >> >> In which situation the cost to reconstruct MADV_FREE pages can be higher >> than the cost to allocate file cache page and read from disk? Heavy >> contention on mmap_sem? > > Allocating a page might be really costly but even without that. File cache page needs to be allocated too. > Reconstructnig the content of the page can be really high and actually > much larger than an IO to get a page from the storage. Consider > decompression or some other transformations to get the content. > Userspace has means to detect that the content is still up-to-date as > already has been mentioned so all those steps can be avoided. Although I don't believe someone has really done this. It's possible at least in theory. Best Regards, Huang, Ying