Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1066114ybh; Wed, 11 Mar 2020 16:54:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvsVzrumh3isO2ctHwCPjht7H4MTR+46wGFt+PRlNvfhiglWY183NYOKUaVCAxgeuK8x/K3 X-Received: by 2002:aca:3101:: with SMTP id x1mr772376oix.15.1583970873349; Wed, 11 Mar 2020 16:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583970873; cv=none; d=google.com; s=arc-20160816; b=RyYTQLiCBUSyjFvHKYHpdLodcqEq0y/VRB34n162F0NxmdDNuqqa2OrfA38d9HI9HY GEfELXim+ulX18/YTJSQu6P0GH8fASBg4ZKVf6yxNAc4LhpkjRsy61jH8bxWMKrfqiRA GQGJnhJ+Ql04jm/mW8YMjWQug6/B0yBWSUyvva3gDl40kXnAh3NkD+avHcEbumP4u/ts J5I1y505zRo+fbzNw5hLC9kCyJF8oB+DvjTWeHYk2/g0uo2i4wx24aST2jdRZNWLSLNI 8nWS/5SuNOOvghrwooTRn5KSTRd96M8jZ8lhCwsA3YIQxLjwk2lrEITY5PKRtDlBcBc9 RTXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BISaxEO3tLmHtOALupu+vtL3eE8hw9R6Yq+1E8T9jfo=; b=LvYIrmXrohFW+iGSCTux9ioTJ5bPo9OFcc0EkhgQUT6svIsk3hDr1px4/SvTZ11CEs 80aaXJ6XyhSc+JZSLT2o2lK4hMm9IgQzbJWDhlBOFdrMOSNVPa7k3AFstZJrkH1BCAUp kzWFY1PCV6OhGYRIAx+fhFgCnVZ5tzFh17bX/cadIrVEFxHnX/Q8NBcPfiHv7kCw9MXy Qk3G0ByTCBsYuoPoROulIzRCOjUko6ZnbmVj8AOtVHTibPxmvkzcqAZPHPZFFNd5xITp xlYUuAmVgnzkJZP+0X+qFIYoOVJrySf5l2xG6gc4xVyUkY9fSd9MgM6mHtnpOTurzMsr P3bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=M3r0aoC8; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u135si1856092oif.248.2020.03.11.16.54.19; Wed, 11 Mar 2020 16:54:33 -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=pass header.i=@google.com header.s=20161025 header.b=M3r0aoC8; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731506AbgCKXx3 (ORCPT + 99 others); Wed, 11 Mar 2020 19:53:29 -0400 Received: from mail-ot1-f53.google.com ([209.85.210.53]:40421 "EHLO mail-ot1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731399AbgCKXx3 (ORCPT ); Wed, 11 Mar 2020 19:53:29 -0400 Received: by mail-ot1-f53.google.com with SMTP id h17so4119274otn.7 for ; Wed, 11 Mar 2020 16:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BISaxEO3tLmHtOALupu+vtL3eE8hw9R6Yq+1E8T9jfo=; b=M3r0aoC8VOwSKTLuSsCRfJBVH1YnEi930Q0zsoqxBU0YXNRNmHe63uoustvkh7YyFF E6CTrkh6gn/dbQfxpVEWqE3X+ZOv+cxeJg/sLWcU43h9CahbGYcje3EaHoZYBBBbxiDs lI0xioErrP/uWf69i4EkxpX19QrunfW/e2gI0P2aclQKfwRYO1B6QuWy+axRKHb9jKiz 5F+ybwjTNafCUTNTdPf4Zxyj2WgKQ+l7ypXg/gKsQWbbKyeHeZSjpkejOHpVW9fpYPo6 jyY/z0Q8uK+G6hWaYP/zToI4BkNhNau1znGna0o9240neDIIHW+ROUZ+UGCP10q/CkNp R01Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BISaxEO3tLmHtOALupu+vtL3eE8hw9R6Yq+1E8T9jfo=; b=WxI9EPc3WjOvA3jmlEuhrWw4a6evXsvO55d0HAR47NH+jOwivGYvMOY/KV5TPouA3S QcipJLXRryiYTrDF8QFSnO9gCI8oLUg6NNkqmGetOSCEke0tDc9+xR8d3xsJKjl+Vowr 63yaSk0n8RSy0YRyOmxOotdZByTHEdlZ1Tf8uKv44WQUUgG54FvxPPplZDrAIAd+f9Vk UUMvrAHKdhfYNmLot9Z5/YHAeHKMGPzQnMozhyNQ7ZNW+9q5M4BDsPebI3MBHn0pos5S b3Dfdp/8c1VtiM4PMkK49anhOosPjlBsXpcyiHwL58L48cOFfTvr6Cx/VIXQogHMpLvE 9ICg== X-Gm-Message-State: ANhLgQ3bj7UTLZ/DbCZyzNvIkdKBLkvFmxvzC6PakEeOVzTtKDqqbXXz bAyWd2LumwFiGA/PeJ36rHTflBh3AWnrODoJsnMFwQ== X-Received: by 2002:a9d:6c99:: with SMTP id c25mr4022491otr.124.1583970808405; Wed, 11 Mar 2020 16:53:28 -0700 (PDT) MIME-Version: 1.0 References: <20200310184814.GA8447@dhcp22.suse.cz> <20200310210906.GD8447@dhcp22.suse.cz> <20200311084513.GD23944@dhcp22.suse.cz> In-Reply-To: <20200311084513.GD23944@dhcp22.suse.cz> From: Shakeel Butt Date: Wed, 11 Mar 2020 16:53:17 -0700 Message-ID: Subject: Re: interaction of MADV_PAGEOUT with CoW anonymous mappings? To: Michal Hocko Cc: Dave Hansen , Minchan Kim , Jann Horn , Linux-MM , kernel list , Daniel Colascione , "Joel Fernandes (Google)" Content-Type: text/plain; charset="UTF-8" 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 1:45 AM 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. > What about the remote_madvise(MADV_PAGEOUT)? Will your patch disable the pageout from that code path as well for pages with mapcount > 1?