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=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 D9194C433E1 for ; Fri, 21 Aug 2020 19:43:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8363E2072D for ; Fri, 21 Aug 2020 19:43:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="C6jruGU7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8363E2072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 23A328D0079; Fri, 21 Aug 2020 15:43:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EAE78D0002; Fri, 21 Aug 2020 15:43:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D9E88D0079; Fri, 21 Aug 2020 15:43:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id E85228D0002 for ; Fri, 21 Aug 2020 15:43:16 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A4C858248047 for ; Fri, 21 Aug 2020 19:43:16 +0000 (UTC) X-FDA: 77175599592.10.net59_1708f6d2703b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 785C11730874 for ; Fri, 21 Aug 2020 19:43:16 +0000 (UTC) X-HE-Tag: net59_1708f6d2703b X-Filterd-Recvd-Size: 4921 Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Aug 2020 19:43:16 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id b30so1462600lfj.12 for ; Fri, 21 Aug 2020 12:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZqmMf8s/qw8dVmkIjWEKz4hGdQy13QWnrbeE3wlgAlU=; b=C6jruGU7XbdTD/cONqgTWdl5nfkxg4Siv9fW8Uhgr4NO+SmRJdhu7HWZRPm54zt2o+ 20HDheaQPalvgiMB4KRYdPqOBxh9avoWJdfixq4xwgGGimMuq/eA02dHooa9DKd3Ych8 0M8zvhKhXJ6rBuzgU0YlRzYErgGqfBWqu+dEI= 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=ZqmMf8s/qw8dVmkIjWEKz4hGdQy13QWnrbeE3wlgAlU=; b=cRXW0ylR/TyU3sGNw5c1+5rBzaRmetd3aR/6diyPkKPf3moS1vLFgUb45fQgvTLO1u S55DdoloSc7+z+46fG5QFrOklSQCFmUdox3a5B8SqcBhVD5pFXAvFdyDMYyJZM+3e5jb GAck54u/23wQXxTf3fvGWiPRX162w1I/i2DGFt1F/Yzo3/7pnWh46TW6rkeM0rC2S/4c zcsRzreR3jIBSojRTF4I/ffwPWcar+SFX2clMvOFj+/tBYkQLaceVL2o5nVMMXa1jJi4 /sQcns8/gF6FcIzw/gsAgEdXNEK2+JxHzsV82MI0oeU3t4Oo1QPzuX5lb6WVYGsZ2Gvh hXYw== X-Gm-Message-State: AOAM530cpHnuY8cW118TlAiziAs84yKAmDfdeCuqsk77T3ERY8Yr6eka ldGdZxd3zxbXMOhLBVejtbBCF6KgHWOxLA== X-Google-Smtp-Source: ABdhPJznDTRjq+X6yO0SNJ6gDt0Ra4mI5hQd8NFMRNTogaykQGyXAMxxy7xvU25W+xoictuIIu9Tlg== X-Received: by 2002:a05:6512:70e:: with SMTP id b14mr2118263lfs.64.1598038994010; Fri, 21 Aug 2020 12:43:14 -0700 (PDT) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id k12sm567061lfe.68.2020.08.21.12.43.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Aug 2020 12:43:13 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id b30so1462556lfj.12 for ; Fri, 21 Aug 2020 12:43:12 -0700 (PDT) X-Received: by 2002:ac2:58d5:: with SMTP id u21mr2080928lfo.31.1598038992293; Fri, 21 Aug 2020 12:43:12 -0700 (PDT) MIME-Version: 1.0 References: <20200811214255.GE6353@xz-x1> <20200820215449.GB358043@xz-x1> <20200821101333.GA3432@quack2.suse.cz> <20200821154756.GC3432@quack2.suse.cz> <20200821180848.GA11376@xz-x1> <20200821193100.GA38249@xz-x1> In-Reply-To: <20200821193100.GA38249@xz-x1> From: Linus Torvalds Date: Fri, 21 Aug 2020 12:42:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] mm/gup: Allow real explicit breaking of COW To: Peter Xu Cc: Jan Kara , Andrea Arcangeli , Linux-MM , Linux Kernel Mailing List , Andrew Morton , Marty Mcfadden , "Maya B . Gokhale" , Jann Horn , Christoph Hellwig , Oleg Nesterov , Kirill Shutemov Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 785C11730874 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Fri, Aug 21, 2020 at 12:31 PM Peter Xu wrote: > > However, do we really want to revert the whole logic of > 52d1e606ee73? Asking because it still seems to be an improvement to me (after > all we'll need to look after KSM pages here). So it seems still good to keep. Does anybody have numbers for it? I'd rather simplify and get rid of the locking that has been problematic, and then re-introduce limited cases with actual numbers. Right now that commit has no real argument for it except for "do what we do for swap cache". And since we're getting rid of the swap cache special case, I'd say that commit 52d1e606ee73 argues for getting rid of the KSM special case too. Honestly, I'd expect that if KSM is effective, it's for pages that really *are* shared. If you get a lot of "write fault on the last copy" and that ends up being a problem, I think that says more about the KSM issue than it says about the write fault.. Linus