Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp985559ybh; Wed, 11 Mar 2020 15:03:29 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsTqi7NCpv4diIGzKOIGQnoKPev+udZQSc7jESOSPpFpEsEvCW4GmoD0OsdpDTMjh6CAKne X-Received: by 2002:a9d:7e8b:: with SMTP id m11mr4074708otp.83.1583964209521; Wed, 11 Mar 2020 15:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583964209; cv=none; d=google.com; s=arc-20160816; b=mG9mNDP1ce5tHrh0MiqWwqffas+4boUK8AOapJMKxpgpqwfqggmj6KVz7pU7E6hAzn ANCOBsqArX7FMzqji4hstV/w6AyOaPdvMohCzW/F8oqeRb4TrR8MS4HR0d8NwiNtocLd cbFRw7GnEzyMv3ufqdG8tpREet0PHkiZ91kxtLWb87oSO7S+BpbjT4pm7c5Nw46VGG3L jNybUl2DiU7cgBATdcDZnnKBX9cGS4Gg3Uvq+Zg+m8h8CETcG3queWft2/eJDUN+ToxM q0XC7FN8DwGl0vwuWZVh0BzvihIFMLp9TrLUbH8lIAownHmg4MG8HPvs4C+PiPkLAWho 8iQw== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=3iE2aDq3GTpvrSPuFDVQi35URZrSY5lu16FU58AXYfg=; b=NQ82Eufdda5oTsaV6fMC6BF0hWLRmOoZ/xySB2meIdTvEgRYLR5KyWCrYMOkqcELh2 AIxXIAewYXuWWiwZMmYpCGbXfY76r5yxVKuJYGZb+Nj7VAy1lAZB44mYpTSRx8yAuxPw 1Yfu/sfwnrk4tNeD2i1kUmsHf7JVklPK5xJ8k+yMDm1l0R3Wa+xr4C6O8BmNs/OQUMg7 s0kxFT1CtSdEzTZOpWw+++Hp3z3bHkThA71UAnDTN4MVZ7uy04CDv4HKERu+8R5fAoAV c3Wr9E3MB7okMijB77hVCpR6cVafbUcyqRfzlzA7LiEWlF3m6IhkwH/8FFL717UaiRhK DARQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FpIFqf52; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si772227otp.267.2020.03.11.15.03.01; Wed, 11 Mar 2020 15:03:29 -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=fail header.i=@gmail.com header.s=20161025 header.b=FpIFqf52; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729530AbgCKWCq (ORCPT + 99 others); Wed, 11 Mar 2020 18:02:46 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:37094 "EHLO mail-pg1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729223AbgCKWCp (ORCPT ); Wed, 11 Mar 2020 18:02:45 -0400 Received: by mail-pg1-f181.google.com with SMTP id a32so1083838pga.4 for ; Wed, 11 Mar 2020 15:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3iE2aDq3GTpvrSPuFDVQi35URZrSY5lu16FU58AXYfg=; b=FpIFqf52l4N0Bk/gaxJ14yLDj94qCfKyrcTpcFNDiURdFNH0NC/dnSCXnb38EFA773 y2NhcaRzUDo+YFDy+PdU8XIH6nV7zEfPq4943R3UKpoFa79ze6YFdL9SsZRkBIPhPfUa mv4AD1GrmzS0MHSZmORWkG+sQ8koe5Nzan6dEWhXo5SrcohWY0jDN3R1gHDoJLpE0f2P YEUgYoI9ZdMvgW6I9gJRx2L5ruWyQfibF5wN5bkpgvtK1+WEh9pUhHtq4hkzDizBqY95 nLozpnJGhD7q/vhRKbKF7dkog4oXh37yfubqAFxD32DAQWX/RSr9HtporoowTU9PDaTr H2UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=3iE2aDq3GTpvrSPuFDVQi35URZrSY5lu16FU58AXYfg=; b=UDVpGkSFAmhSiJEGIwPES3xodIRPbEiSu3TQZh6kI1YMEIeWAPXButTGKqESS1Jxn2 TkhgA8GZ1mJrjkguAr5UUzhXlPNMywV9TaZWnM7RW5KM1OweoUGrIE65IvR5A8dSQ0nH pg+fkEMV8iSoIDGwrg/lc935FVvanjhIaM7FkekIepqY3U+ElRVWRS5+KhmMVcfxczAy XEnbWSxDk9Ni1qV33MKkIH90OZUbvYEmUx+ipffKPdEm4kWmq0S7YJMqRdLWHERixxUu KVktNVecyp5tKH5tvHXSMhzBz32kj+zlPm4B0mTUJKCO90T/TwNAIzBLN6j/usOVFSG/ MnjA== X-Gm-Message-State: ANhLgQ0bwwW6n4mtL4fME9yH6GFtVmTSY5lV/IwB+Td5h9mJOcHrhowf 61UPGNkG5HVpsItzFTszdNMRby8c X-Received: by 2002:aa7:9906:: with SMTP id z6mr4997401pff.112.1583964164216; Wed, 11 Mar 2020 15:02:44 -0700 (PDT) Received: from google.com ([2620:15c:211:1:3e01:2939:5992:52da]) by smtp.gmail.com with ESMTPSA id c18sm50034963pgw.17.2020.03.11.15.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 15:02:42 -0700 (PDT) Date: Wed, 11 Mar 2020 15:02:41 -0700 From: Minchan Kim To: Michal Hocko Cc: Dave Hansen , Jann Horn , Linux-MM , kernel list , Daniel Colascione , "Joel Fernandes (Google)" Subject: Re: interaction of MADV_PAGEOUT with CoW anonymous mappings? Message-ID: <20200311220241.GA252592@google.com> References: <20200310184814.GA8447@dhcp22.suse.cz> <20200310210906.GD8447@dhcp22.suse.cz> <20200311084513.GD23944@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200311084513.GD23944@dhcp22.suse.cz> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 11, 2020 at 09:45:13AM +0100, Michal Hocko wrote: > On Tue 10-03-20 15:48:31, Dave Hansen wrote: > > Maybe instead of just punting on MADV_PAGEOUT for map_count>1 we should > > only let it affect the *local* process. We could still put the page in > > the swap cache, we just wouldn't go do the rmap walk. > > Is it really worth medling with the reclaim code and special case > MADV_PAGEOUT there? I mean it is quite reasonable to have an initial > implementation that doesn't really touch shared pages because that can > lead to all sorts of hard to debug and unexpected problems. So I would > much rather go with a simple patch to check map count first and see > whether somebody actually cares about those shared pages and go from > there. > > Minchan, do you want to take my diff and turn it into the proper patch > or should I do it. Hey Michal, It would be great if you could send it. Thanks.