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=-7.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 F108BC352AA for ; Wed, 2 Oct 2019 13:18:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B658D21A4A for ; Wed, 2 Oct 2019 13:18:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="gq5itDKj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B658D21A4A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 48E1B6B000D; Wed, 2 Oct 2019 09:18:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 417966B000E; Wed, 2 Oct 2019 09:18:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DF476B0010; Wed, 2 Oct 2019 09:18:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0178.hostedemail.com [216.40.44.178]) by kanga.kvack.org (Postfix) with ESMTP id 03B446B000D for ; Wed, 2 Oct 2019 09:18:23 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 81F51181AC9AE for ; Wed, 2 Oct 2019 13:18:23 +0000 (UTC) X-FDA: 75998898486.03.limit38_2c0bfedf50d59 X-HE-Tag: limit38_2c0bfedf50d59 X-Filterd-Recvd-Size: 6174 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Oct 2019 13:18:22 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id v38so15200350edm.7 for ; Wed, 02 Oct 2019 06:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=E4uXiPQh5CilHJLER4hocaBvsNcCWt7kA1fG1frc5KM=; b=gq5itDKj0IoY9IxPzNtP49jnszJZvvR5zSQzt0qcvhvxVJYqvyjMY6d1LgRComtIEl ci5AdTu+8f7b3d69LbYjcnaw+orJSp9tCPY5UgU48BuoHyV/WnQLniehfDoPZmyTrh61 R0hLu2Zqn94/IW5L3S0BWeF8GErkHbw8pho+sxjuQvaki2o5xzPT4x35UIKOz4ZCuyI6 2QL0u44JtF1ladY9H0VI4Z8nCwv2etE58/Ohp3bfp1AhjIrYRa+Tc8VzomYVaaiNgmrA Pyr32xZwmkbmD3XUhhM9I1ZDs4PXhn59CcRBI1xU0VTclpmI2X7d0e0j0wEpuZiDk8Lr F3PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=E4uXiPQh5CilHJLER4hocaBvsNcCWt7kA1fG1frc5KM=; b=djGLNrTlg0XGK2J5ygS2te2yeSjQTBCxxWMIuQE0h6wKqnAN9mdwqxWaFEGXPP6lsU eaNEXyqG85U8Zg87xg/bO5uhIXCaG+c77KzeC4H0ickW0YUklIG3RAUrABUTliyJyGbG lLPpCzZB2adOxYKecnx5AyRs7KzxjtL1xOUOdrljpqzUyOmiNPJxYk22CqRWsO7zlk4D eHifet4gwH3jD+SM23uYro3HTUJ1RcHRux65OWbcOwCYFCUnWQHAwmLrj/+q82rdrXio oyDuvLy+512YuxdBYu4yvNMhD2ezeS1sNJ8ncFoWMkiBWSdSLCSCQkaF9mPp64OPrplO vcbg== X-Gm-Message-State: APjAAAVMW7f0wuL9LlsHWXQksjS2HyVudasYN1RVAGOIFAgppnzcoA/Y 9frecfuyqOHs+N8KWedSaadb2w== X-Google-Smtp-Source: APXvYqwgwVGc3f1EL8dgSureN2TvxxLp+I/HhbuxR51KekTRd69Ckz2y0aHsSMpQwO9ILaz3/UazVw== X-Received: by 2002:a17:906:e288:: with SMTP id gg8mr2976209ejb.24.1570022301120; Wed, 02 Oct 2019 06:18:21 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id v22sm3895662edm.89.2019.10.02.06.18.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 06:18:20 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id F209310410D; Wed, 2 Oct 2019 16:18:19 +0300 (+03) Date: Wed, 2 Oct 2019 16:18:19 +0300 From: "Kirill A. Shutemov" To: Thomas =?utf-8?Q?Hellstr=C3=B6m_=28VMware=29?= Cc: Linus Torvalds , Linux Kernel Mailing List , dri-devel , Linux-MM , Andrew Morton , Matthew Wilcox Subject: Re: Ack to merge through DRM? WAS Re: [PATCH v2 1/5] mm: Add write-protect and clean utilities for address space ranges Message-ID: <20191002131819.asjr2tsx6lcmmbof@box> References: <20190926115548.44000-1-thomas_os@shipmail.org> <20190926115548.44000-2-thomas_os@shipmail.org> <85e31bcf-d3c8-2fcf-e659-2c9f82ebedc7@shipmail.org> <50e83aeb-e971-f0ad-f034-ed592588eba7@shipmail.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <50e83aeb-e971-f0ad-f034-ed592588eba7@shipmail.org> User-Agent: NeoMutt/20180716 Content-Transfer-Encoding: quoted-printable 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, Oct 02, 2019 at 11:21:01AM +0200, Thomas Hellstr=F6m (VMware) wro= te: > On 9/26/19 10:16 PM, Linus Torvalds wrote: > > On Thu, Sep 26, 2019 at 1:09 PM Thomas Hellstr=F6m (VMware) > > wrote: > > > That said, if people are OK with me modifying the assert in > > > pud_trans_huge_lock() and make __walk_page_range non-static, it sho= uld > > > probably be possible to make it work, yes. > > I don't think you need to modify that assert at all. > >=20 > > That thing only exists when there's a "pud_entry" op in the walker, > > and then you absolutely need to have that mmap_lock. > >=20 > > As far as I can tell, you fundamentally only ever work on a pte level > > in your address space walker already and actually have a WARN_ON() on > > the pud_huge thing, so no pud entry can possibly apply. > >=20 > > So no, the assert in pud_trans_huge_lock() does not seem to be a > > reason not to just use the existing page table walkers. > >=20 > > And once you get rid of the walking, what is left? Just the "iterate > > over the inode mappings" part. Which could just be done in > > mm/pagewalk.c, and then you don't even need to remove the static. > >=20 > > So making it be just another walking in pagewalk.c would seem to be > > the simplest model. > >=20 > > Call it "walk_page_mapping()". And talk extensively about how the > > locking differs a lot from the usual "walk_page_vma()" things. > >=20 > > The then actual "apply" functions (what a horrid name) could be in th= e > > users. They shouldn't be mixed in with the walking functions anyway. > > They are callbacks, not walkers. > >=20 > > Linus >=20 > Linus, Kirill >=20 > I've pushed a reworked version based on the pagewalk code here: >=20 > https://cgit.freedesktop.org/~thomash/linux/log/?h=3Dpagewalk >=20 > (top three patched) >=20 > with users included here: >=20 > https://cgit.freedesktop.org/~thomash/linux/log/?h=3Dcoherent-rebased >=20 > Do you think this could work? The reason that the "mm: Add write-protec= t and > clean.." code is still in mm as a set of helpers, is of course that muc= h of > the needed functionality is not exported, presumably since we want to k= eep > page table manipulation in mm. Could you post it to the mailing list? It's easier to review this way. --=20 Kirill A. Shutemov