Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp324899ybh; Wed, 11 Mar 2020 01:46:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsB7EZsn4XYbcPcd7OXLo3YR1VMFYGZ7xqZ65fY6NUFjFVMI9IOqsMgF5aSSnMo0+qnjScZ X-Received: by 2002:a9d:7c9a:: with SMTP id q26mr1553509otn.206.1583916379281; Wed, 11 Mar 2020 01:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583916379; cv=none; d=google.com; s=arc-20160816; b=xUxB+KwTXveQZw1vO3GmoBdfId1D+rLmdMKCNx9OV/fff/cehrzCRQ16hsjB/zDmSf Mz4wwdoYASJLavxwFxIRtPMoaTUhUmpzNnJqx1zWIaMQo7LZ9br+0cJHf0iulZ0gXKwb e5LV7yPY9+M0dpi9xLpfMjhYTZPMdclpLrNFyVdcT1Wc2WxO6YE+Mm6IyH/FtwEqhUOK 9Di4hRk0VYEn1nsWQy2ZL2FOKCiQTLjDvLkxYbUoYyg44LSrIYI7f8FIURgEh5TQlR6g 37zaWRAHNNhJ8cLo3oXYvhz5PKZLAQh8lGu0lr5jwb1W42GFjHpfbeLCdjmdNXBMgDiu a9Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pRBMlMBO4NTBoT2wAbroYDijV50kCEx9++6sottZmCc=; b=rRie9IgSNwY2NBy4JotZ1PHvHyFqC9etpcwtRQe1tjhvXDv58xG5MhudjR/yFJY+Yk +AeJEuTcdiMDL5hXKpBARTyEMIuEIhBVtZrizksJp7EdcMFW/ihmm06SJfe1OD6IK2OL qLBBIQwU5nkNKm29DOCDGcRiRfXSUEnC7aThasZd8t/N+yCEBefqTYLL3r0ibA5VLWtt sYUt2dgBk6iHirnbE0GBh837FCm9Lsom7kjlHISIBggjja6ECfq0Ih1QhMSgh8J5SeEd VW6AyL6fbJvOMBnaNLSenq+Qr9rkh5t+G+cSllpQXL1f1Uokyl9hhv6QGbY+rwwIqwNM dl1w== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 48si820033otv.320.2020.03.11.01.46.06; Wed, 11 Mar 2020 01:46:19 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728547AbgCKIpR (ORCPT + 99 others); Wed, 11 Mar 2020 04:45:17 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:53765 "EHLO mail-wm1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728146AbgCKIpR (ORCPT ); Wed, 11 Mar 2020 04:45:17 -0400 Received: by mail-wm1-f41.google.com with SMTP id 25so1093742wmk.3 for ; Wed, 11 Mar 2020 01:45:15 -0700 (PDT) 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=pRBMlMBO4NTBoT2wAbroYDijV50kCEx9++6sottZmCc=; b=LP9oSiYaVmWOjJaulSTb/S4YhuZ9DEMP2X5f6WT14FgPVvsRPgFK89PIcrurHAW7Jb ZJj956ETwzNyiRIjOG5WmPlqeoiMSS6OHNe2URHegvgyYfAIheo992pD0bX+C0XnHKUP LK+xhh+0dl9Z1Xb+uvUVZNfE28/RDuCo9K+VGrpolWMXUgKy49i6N6T6JKaV/dKSKyrx ACtVSsvJcKPPa3fV+BFK+WOoXEcw3AuZQ6siM0kldxOPMb52AcXW5oBDMzIzrLwL8PRY cZr+AMtUM2YMLGFxsZ4g6n4a1edL/nOGEGRw8UBnspZA6MTXCERPdMHxm2BSBzQeoRWh KNdQ== X-Gm-Message-State: ANhLgQ2BWuV4yqDiYDvjXTw82C1MrkU5MFJ2KyMselwyAH1BQNVZFqQk BzId3DsnHObn8cCxNPBWXj4= X-Received: by 2002:a1c:6108:: with SMTP id v8mr2523779wmb.58.1583916315039; Wed, 11 Mar 2020 01:45:15 -0700 (PDT) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id c85sm7752772wmd.48.2020.03.11.01.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 01:45:13 -0700 (PDT) Date: Wed, 11 Mar 2020 09:45:13 +0100 From: Michal Hocko To: Dave Hansen , Minchan Kim Cc: Jann Horn , Linux-MM , kernel list , Daniel Colascione , "Joel Fernandes (Google)" Subject: Re: interaction of MADV_PAGEOUT with CoW anonymous mappings? Message-ID: <20200311084513.GD23944@dhcp22.suse.cz> References: <20200310184814.GA8447@dhcp22.suse.cz> <20200310210906.GD8447@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Michal Hocko SUSE Labs