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=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 1EBD1C2BB1D for ; Wed, 11 Mar 2020 23:53:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0B7B120759 for ; Wed, 11 Mar 2020 23:53:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="M3r0aoC8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B7B120759 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6756D6B0005; Wed, 11 Mar 2020 19:53:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 625D36B0006; Wed, 11 Mar 2020 19:53:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 514FF6B0007; Wed, 11 Mar 2020 19:53:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id 359106B0005 for ; Wed, 11 Mar 2020 19:53:30 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E5262482A for ; Wed, 11 Mar 2020 23:53:29 +0000 (UTC) X-FDA: 76584735738.06.hall57_75cfdb2a56545 X-HE-Tag: hall57_75cfdb2a56545 X-Filterd-Recvd-Size: 4052 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Mar 2020 23:53:29 +0000 (UTC) Received: by mail-ot1-f45.google.com with SMTP id j14so4158114otq.3 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=B0ZWISiN4+V2ckJ90sanwGaLCp7AtPM7oPJuzWKW8sIgjOT1dMgnfGpuKhnLTMKxj/ zkJ1es/qxYftXZ4VmHLMWY1vAdTg3ScOIcV1DjwtR+VLlGaU11e+m9i6h/zzz4sRzkL+ IuIvWM2wZBTv9MOHPMLEqRxWxFETFAAtXqVwn4XVgPBfYTyYqOG8OJ3CRFlJ+EgLixLK VeRez9VfNmAffI/sLe+ZgSKTCgcwAtQBfWwYyNz9VXASpTB1fzz6oYfYscgfk7vSWXtQ qxvSyJhw0bywduwnOnViSZ/1CqM5G+dnzPlyX79/eMyQs7Hnvxo9znd4wMAauMkCritA TjPA== X-Gm-Message-State: ANhLgQ1CNiVFo+QOui4VGoazRp22UQu8Pv10t/SsPzS2VVWO2005oYJ8 7M1cNfH/j+k6aloc0aRmYSwzSGbhvKU9mZBlDN5/2g== X-Google-Smtp-Source: ADFU+vulUlsn/pxKKkjb+94QHZE4kxGdiyGXHu3bIAK6/f38uTBukltpBzlSI6r23VtERCbGZIXEBsrQRXA32wJQXJ8= 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" 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, 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?