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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C6C0C433FE for ; Thu, 23 Dec 2021 17:18:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5ED3D6B0072; Thu, 23 Dec 2021 12:18:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5755F6B0073; Thu, 23 Dec 2021 12:18:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EEDB6B0074; Thu, 23 Dec 2021 12:18:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 2A91A6B0072 for ; Thu, 23 Dec 2021 12:18:57 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DA4C2180868D5 for ; Thu, 23 Dec 2021 17:18:56 +0000 (UTC) X-FDA: 78949719072.24.DA120BE Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by imf28.hostedemail.com (Postfix) with ESMTP id 6E242C0042 for ; Thu, 23 Dec 2021 17:18:56 +0000 (UTC) Received: by mail-ed1-f47.google.com with SMTP id m21so25246646edc.0 for ; Thu, 23 Dec 2021 09:18:56 -0800 (PST) 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=ebjUMYzb2XXAsYOtaVdHIf1waqFUxp5nurVKmzFPze0=; b=D0oqXy2kl+rC2TLn8MKJW942+MXJlhDcqQRLu5xkE2CWygIZz0D4Zmm57+murcYldK 4UEQf7kPQlmt/Zu9Vj8PzCJx+hTrF4iTZEz/Zlq2tQY1GdPH6ixD2hrlPiPyOOyxDpjC UUPQ6ggzhSxleoC62OuTXUWCgqwRkw7Rjw6Ng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ebjUMYzb2XXAsYOtaVdHIf1waqFUxp5nurVKmzFPze0=; b=q4seNRRqCxW/yDY2SZxv62tOpTiNZs2WUMWjEYJW2WrsgIWQOBghpBMOn9uJm/Amgv 3qMzC2G4UN5gz1O6SgKSVCfzbZLl107blKkqblC7n8k/RICoJmlwri0gaA7Vt5g1C7TR KeAVJ3ff/2ySXGxl/ccoaGKyPSB2qeKxfYRMMWmaw9LIR/kYGlG2qNmyoieEtoico/rg e/2A1Ouu0F5XgrgKjchcAQKnnSEtDX6ucPCn7Cr5UIRjYHUkkW+ay2IFe+q5wL5yJadC r48UHcCggehbBnMmDgbqQfFNeWLW1rcqVpUtKW3zeh8+Nvp0AiEedm5DKbzRIE2H8U3A Hi+A== X-Gm-Message-State: AOAM533SvhygDKhZpW1AzZIpf1eoE/Cw5ox0Y0YMt3U1kBAvstGoiEZz VctOU6/kLGxOu/nGdT3e0BGfKPWu71Gp7uuo+vU= X-Google-Smtp-Source: ABdhPJw22n7m7qN7fz0UuqIcV7mGw3DhayaMIvNnHp3JasG/dLPQsx+/vRsjuYxSmgUNhXicDmEcOQ== X-Received: by 2002:a05:6402:354b:: with SMTP id f11mr2779889edd.342.1640279934789; Thu, 23 Dec 2021 09:18:54 -0800 (PST) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com. [209.85.208.42]) by smtp.gmail.com with ESMTPSA id 1sm1940071ejg.163.2021.12.23.09.18.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Dec 2021 09:18:54 -0800 (PST) Received: by mail-ed1-f42.google.com with SMTP id b13so23932396edd.8 for ; Thu, 23 Dec 2021 09:18:54 -0800 (PST) X-Received: by 2002:a5d:6c68:: with SMTP id r8mr1878218wrz.281.1640279923027; Thu, 23 Dec 2021 09:18:43 -0800 (PST) MIME-Version: 1.0 References: <900b7d4a-a5dc-5c7b-a374-c4a8cc149232@redhat.com> <20211221190706.GG1432915@nvidia.com> <3e0868e6-c714-1bf8-163f-389989bf5189@redhat.com> <20211222124141.GA685@quack2.suse.cz> <4a28e8a0-2efa-8b5e-10b5-38f1fc143a98@redhat.com> <20211222144255.GE685@quack2.suse.cz> <505d3d0f-23ee-0eec-0571-8058b8eedb97@redhat.com> <20211222160846.GH685@quack2.suse.cz> <20211223125438.GA19129@quack2.suse.cz> In-Reply-To: <20211223125438.GA19129@quack2.suse.cz> From: Linus Torvalds Date: Thu, 23 Dec 2021 09:18:27 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 06/11] mm: support GUP-triggered unsharing via FAULT_FLAG_UNSHARE (!hugetlb) To: Jan Kara Cc: David Hildenbrand , Jason Gunthorpe , Nadav Amit , Linux Kernel Mailing List , Andrew Morton , Hugh Dickins , David Rientjes , Shakeel Butt , John Hubbard , Mike Kravetz , Mike Rapoport , Yang Shi , "Kirill A . Shutemov" , Matthew Wilcox , Vlastimil Babka , Jann Horn , Michal Hocko , Rik van Riel , Roman Gushchin , Andrea Arcangeli , Peter Xu , Donald Dutile , Christoph Hellwig , Oleg Nesterov , Linux-MM , "open list:KERNEL SELFTEST FRAMEWORK" , "open list:DOCUMENTATION" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6E242C0042 X-Stat-Signature: 7tenb6sy8gcp8hoopawiyjroj5bifqir Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=D0oqXy2k; dmarc=none; spf=pass (imf28.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.47 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org X-HE-Tag: 1640279936-271054 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 Thu, Dec 23, 2021 at 4:54 AM Jan Kara wrote: > > So forcing pinning for O_DIRECT reads is IMO mandatory. I don't disagree. And I do think the eventual aim should be to do it for writes too even if they don't necessarily require it (since they write _from_ the VM data, not _to_ the VM data - the "read-vs-write direction has always been confusing when it comes to GUP"). Partly just for consistency in the IO paths - I think people want to share as much as possible in there - but also just to make sure that we're all done with the "wrong-way-cow" kind of issues for good. If we get to the point where the legacy GUP is used only for very special things (looking up physical pages for debug and trace purposes etc), I think that would be lovely. That may be a pretty long-range goal, though. Linus