Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp694881pxk; Thu, 17 Sep 2020 13:39:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPebgwlWBWEhNi+HW1IT01hJar+tjICwNyXiWq5pk0pkbgaX34VVg2izmKivka3uoG/e/z X-Received: by 2002:a17:906:eced:: with SMTP id qt13mr31990293ejb.357.1600375147697; Thu, 17 Sep 2020 13:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600375147; cv=none; d=google.com; s=arc-20160816; b=l9uHTN4mrVrGY3FMfvkQstvJY8r/mX93qM2re7CokgOHwC4Tfd40uDOQaVUIb556xE EE40ZDde3hPSxr13HrKZvHzp7Vbyi1zwLrw2UPvSRSX9HGbM5NPT3JFBqZycFNDNQFHq +agzc8POAO30ORAnLCSvg06nWHLaUENcU0ZMLegTgtcWjYeoPhslFKble76wUGkt5Mj3 7qs8eL1NOV8nJkhQZtVNIJikdlcH/lxC2CZ9qaX1XF9cCBzVSnNOtpmxTDg7547siGI/ E9InJCiXYkcbzHfBzjT1UHON9Qw3WKilN8ZWmV5htUFzYIOt5X575cmGljEZflMhiQ2P AqZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RwZiLc6S8KRXpHX9Z3VeVt6Qzg9ortSMhRW1DWsmxfU=; b=R11iU9Ns1DpAL7XeTZ1hYx2+FJEWq0KV8XqNHQK7VNcDif7KWovbjaRIcS8lkD1rQ/ HzR4mHRyarFrd6y+FOuWxRRgx7wFhL48aRRz7ldPeeGp0gtfbZy0lG+P2uKbgvnp3Trg 0US7LmEuTV200dBdDiwwijsXDgb8uTxviND9wjqSv88Bk42zpiJPCONqs9Cr/ZcFWviC +W+j0f+xAMak5M/REL96DsC5/xU0ONEEGgo6hdmaghN0TUjiZVqr29RPNxqEYrWvdsYE PUD293Fqinvu2GDFrVmuPjPbpZjCbEvwS1ICEwp7ByxAhJOZ4rMH9ytw1QoTgi0pmoNP u4nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Gw4YF1Eo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d25si542756edy.405.2020.09.17.13.38.42; Thu, 17 Sep 2020 13:39:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Gw4YF1Eo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726420AbgIQUgR (ORCPT + 99 others); Thu, 17 Sep 2020 16:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbgIQUgR (ORCPT ); Thu, 17 Sep 2020 16:36:17 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D493C06174A for ; Thu, 17 Sep 2020 13:36:17 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id y4so3177889ljk.8 for ; Thu, 17 Sep 2020 13:36:16 -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=RwZiLc6S8KRXpHX9Z3VeVt6Qzg9ortSMhRW1DWsmxfU=; b=Gw4YF1Eo+YJ8TgEJHuR+iXYu0AX9ZB/vRTZi5W6owfBh+Fzo/uWlGdJHJMsfQur04/ Z12gGwxut2GKxd4MZW/Z8FgdJkaUGpnh+akWrazKSRsVrmkIChvw5UjjR7WQqUy9/mBm kEVmmYqN1HhbreponBnTKCuEJjAtHoKKQ8kHQ= 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=RwZiLc6S8KRXpHX9Z3VeVt6Qzg9ortSMhRW1DWsmxfU=; b=I0mFwJhNfeNRnYnddWKyt7iBtDRoEK6PwBkpXlJwtwmHAwrimamEs+VBj25oPhnHmn ajDndGFCK1SJCxXd4S0JPyH257HDWOjLDCqxLynfAdshvRGqec81/7hmU6wXdVP3DDZj 6KOx3ngZ4YksK8PRKVEJysekhg1T2CtJvETVCnB9KNIkJYyUvvBVtFfr54eAhCcW2dIt TCFaECcdwIRJ77CiWUXeDzZt9rLfG9EmgVvbqn6AO9ZAH/SPN92O2O9fIPB7D7V639i6 lx0e9Kpx6+d6x9Og2POvaeSmbD/AzB69JxYf4qnBajPvvHlDqGefkLyeNrFSUyG3czDq Z0aw== X-Gm-Message-State: AOAM5304ZLRDr+/cdtmKjp2ULUugwNlnN7MdyiH9cLDX1UyYhFXYecHg LTTatmaD63EnNqusA+4mgMfWUBSlFE4XYw== X-Received: by 2002:a2e:8ed9:: with SMTP id e25mr10328286ljl.404.1600374975119; Thu, 17 Sep 2020 13:36:15 -0700 (PDT) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id h124sm119989lfd.203.2020.09.17.13.36.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Sep 2020 13:36:13 -0700 (PDT) Received: by mail-lf1-f50.google.com with SMTP id z17so3619839lfi.12 for ; Thu, 17 Sep 2020 13:36:12 -0700 (PDT) X-Received: by 2002:ac2:4ec7:: with SMTP id p7mr8748891lfr.352.1600374972561; Thu, 17 Sep 2020 13:36:12 -0700 (PDT) MIME-Version: 1.0 References: <20200915213330.GE2949@xz-x1> <20200915232238.GO1221970@ziepe.ca> <20200916174804.GC8409@ziepe.ca> <20200916184619.GB40154@xz-x1> <20200917112538.GD8409@ziepe.ca> <20200917181411.GA133226@xz-x1> <20200917190332.GB133226@xz-x1> <20200917200638.GM8409@ziepe.ca> In-Reply-To: <20200917200638.GM8409@ziepe.ca> From: Linus Torvalds Date: Thu, 17 Sep 2020 13:35:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification To: Jason Gunthorpe Cc: Peter Xu , John Hubbard , Leon Romanovsky , Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 1:06 PM Jason Gunthorpe wrote: > > Given that this is a user visible regression, it is nearly rc6, what > do you prefer for next steps? Since I had to deal with the page lock performance regression too, and I think we have a fairly simple way forward, I'd rather do an rc8 and get this done with, than revert and know we have to deal with it anyway. Particularly since I think this would _finally_ make page pinning make sense. In it's current state, it's just yet another broken GUP that doesn't actually fix things. But if we have the semantics that page pinning really fixes things in the page tables, I think we now have a proper solution to this and a _much_ cleaner model for it. If it means that page pinning can also stop worrying about MADV_DONTFORK any more, that would be an added API bonus. For that to happen, we'd need to have the vma flag so that we wouldn't have any worry about non-pinners, but as you suggested, I think even just a mm-wide counter - or flag - to deal with the fast-bup case is likely perfectly sufficient. Yes, you'd still take a hit on fork, but only the actual process that did pinning would take that hit. And *if* that ends up being a big deal, the MADV_DONTFORK can be used to avoid it, rather than be a correctness issue. It really feels like this should be just "tens of lines of fairly simple code", and it would clarify our GUP/PIN/COW rules enormously. Linus