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=-5.8 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,URIBL_BLOCKED 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 9B000C433E0 for ; Mon, 11 Jan 2021 19:25:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 090D922CA1 for ; Mon, 11 Jan 2021 19:25:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 090D922CA1 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 5303B6B01F5; Mon, 11 Jan 2021 14:25:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E0186B01F7; Mon, 11 Jan 2021 14:25:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F6626B01F8; Mon, 11 Jan 2021 14:25:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0161.hostedemail.com [216.40.44.161]) by kanga.kvack.org (Postfix) with ESMTP id 293426B01F5 for ; Mon, 11 Jan 2021 14:25:58 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E895E181AEF00 for ; Mon, 11 Jan 2021 19:25:57 +0000 (UTC) X-FDA: 77694474354.08.bead70_070dc882750f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id C15301819E766 for ; Mon, 11 Jan 2021 19:25:57 +0000 (UTC) X-HE-Tag: bead70_070dc882750f X-Filterd-Recvd-Size: 4712 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 Jan 2021 19:25:57 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id v67so1259761lfa.0 for ; Mon, 11 Jan 2021 11:25: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=oKNFHHPFfD7wrwfuT7r81/lh6WrZWqpMnLmKMYRybYs=; b=T4dW7LSW7T2wg9bacwMkeXXtLd4Ok0sO57tNlnjcAH8Ux7LmYSjZ0lozL/qlAFcVMW /X7YR78gi7Ax/0lk70yZx3V9MQaMI7jS/gAfWwdp4tXVRSg+DjhZ8vv5aWsRaxJuwJRC ABafPi7lpmnzPtXbWxsMbYU5IEhVTnlyC3SEM= 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=oKNFHHPFfD7wrwfuT7r81/lh6WrZWqpMnLmKMYRybYs=; b=Q2Oc13u8KY5GU/tzSkbwc5PiAtDTuIB9bdx38iPpPPeUQVm6JixRUh7jJS5f4vJZtA hBIkkfztxOo65pleHwgajoBzeZ7J0KmPF53dQ1z07gMbbZa8wyl1KGWrtNuFO9a1zB69 ys8pHjjyheJy3HjaVqSw1To9d1AyiUrQRwXh8sutl+8tc0XedhK8xRLqOppnw5TPquab 4PCeodLoCus61vBmmgsLwBw2G2TObiLsj4xGF6b30cB4pe0cGn3MDIIYWIxcFNPeeyvh JdzzPcC2SnqRjPb5aFIYO0HRe619DdlQC9NkpP5C7RKxYRb6bRXK0LzbxFhcOLBJ45Zp uYjw== X-Gm-Message-State: AOAM530UkA9XwdnAByvcnDkjYItSS9yhw06xh+KGGl82e5IyaV9X6WvU SX9VrexJd2aox9XBVkIBMEgQbe6wos1hOg== X-Google-Smtp-Source: ABdhPJz8dlKFhmMDd/6DrfqvSl2AfZ0lDBZfLcVHb+0qYrc7VgrDt1Tz/LsoNWKJmASHYXrnKj3mWQ== X-Received: by 2002:a19:8213:: with SMTP id e19mr462029lfd.600.1610393155545; Mon, 11 Jan 2021 11:25:55 -0800 (PST) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id o19sm84850lfd.250.2021.01.11.11.25.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Jan 2021 11:25:54 -0800 (PST) Received: by mail-lj1-f177.google.com with SMTP id m10so182978lji.1 for ; Mon, 11 Jan 2021 11:25:54 -0800 (PST) X-Received: by 2002:a2e:9b13:: with SMTP id u19mr420017lji.48.1610393153712; Mon, 11 Jan 2021 11:25:53 -0800 (PST) MIME-Version: 1.0 References: <20210108171517.5290-1-will@kernel.org> <20210111142402.6euyktmcnpemanf7@box> In-Reply-To: <20210111142402.6euyktmcnpemanf7@box> From: Linus Torvalds Date: Mon, 11 Jan 2021 11:25:37 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/3] Create 'old' ptes for faultaround mappings on arm64 with hardware access flag To: "Kirill A. Shutemov" Cc: Will Deacon , Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Vinayak Menon , Hugh Dickins , Android Kernel Team 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 Mon, Jan 11, 2021 at 6:24 AM Kirill A. Shutemov wrote: > > I wonder if it would be acceptable to pass down to faultaround a copy > of vmf, so it mess with it without risking to corrupt the original one? I'd almost prefer to split vmf into two parts: the 'this is the fault info' part and the 'this is the fault handling state' part. So the first one would be filled in by the actual page faulter (or GUP) - and then be 'const' during the lookup, while the second one would be set up by handle_mm_fault() and would contain that "this is the current state of my fault state machine" and contain things like that ->pte thing. And then if somebody actually needs to pass in "modified fault state" (ie that whole "I'm doing fault-around, so I'll use multiple addresses") they'd never modify the address in the fault info, they'd just pass the address as an explicit argument (like most cases already do - the "change addr or flags in vmf" is actually already _fairly_ rare). Linus