From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13681C3F2D1 for ; Wed, 4 Mar 2020 11:26:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D353720848 for ; Wed, 4 Mar 2020 11:26:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D353720848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6C11F6B0003; Wed, 4 Mar 2020 06:26:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 670D96B0005; Wed, 4 Mar 2020 06:26:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55F036B0006; Wed, 4 Mar 2020 06:26:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 3F6396B0003 for ; Wed, 4 Mar 2020 06:26:56 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ABC6C1D5A4 for ; Wed, 4 Mar 2020 11:26:55 +0000 (UTC) X-FDA: 76557452790.10.top41_1f5b3f4ce210a X-HE-Tag: top41_1f5b3f4ce210a X-Filterd-Recvd-Size: 4055 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Wed, 4 Mar 2020 11:26:55 +0000 (UTC) Received: by mail-wr1-f54.google.com with SMTP id j7so1906444wrp.13 for ; Wed, 04 Mar 2020 03:26:55 -0800 (PST) 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:references :mime-version:content-disposition:in-reply-to; bh=bH3fISo8TLwz0Zch/JAF6ezBy0LKas5gSdqAMX74AuQ=; b=qinYfwL7SOiSgjFyOCI9HBk1gb1ibKEwpcLePLWbjRcuzvh44f4EnHhCMVeD6E5saY QIdrXFTtCSGMfl86C11jpEPqKJsjQKDGEQpI+ZDbCiUPJvebEWBbyTlmqHFQW6TuUcw/ c5y+5/yLVLqHmOOQQpy7dK/QYyhySqQqJejzbaqytoZRVAyRLelroOrMyU7hr7ttjh58 KKBCu9i5tTfyUat55cvzhyrO0J7GKtFqZuTGWMn9zhmVv4ZXXXTVLLA/OPIXM/HVJsiC biWECJMMjlpqcoujPvqZDYo2iPmcOx8bJ7F9m0JEWNKDrGzmYZlyQrjW8+7JOO7FtRSO JZOg== X-Gm-Message-State: ANhLgQ10vPluvep/nwAB7iHgtS9cx6qGnXfILfAtqpDVB7xvOqJomOoZ p0YZPy8dbdQcgQm/g/P4K/s= X-Google-Smtp-Source: ADFU+vtivAUEm4FokWwu4Bokvv9b1dtgYKE4mT5/AUo0fk+wRLC+rDkVCCGO8bokCPMlXeezzk9cgA== X-Received: by 2002:adf:e98f:: with SMTP id h15mr3788899wrm.263.1583321214487; Wed, 04 Mar 2020 03:26:54 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id i1sm17963622wrs.18.2020.03.04.03.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 03:26:53 -0800 (PST) Date: Wed, 4 Mar 2020 12:26:53 +0100 From: Michal Hocko To: "Huang, Ying" Cc: Mel Gorman , David Hildenbrand , Johannes Weiner , Matthew Wilcox , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, 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 Message-ID: <20200304112653.GH16139@dhcp22.suse.cz> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87blpc2wxj.fsf@yhuang-dev.intel.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. 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. -- Michal Hocko SUSE Labs