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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 E7CBDC388F4 for ; Fri, 27 Sep 2019 12:17:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD49321850 for ; Fri, 27 Sep 2019 12:17:54 +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="yDe5MTtY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD49321850 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 3DB7D8E0007; Fri, 27 Sep 2019 08:17:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 38ADC8E0001; Fri, 27 Sep 2019 08:17:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A2328E0007; Fri, 27 Sep 2019 08:17:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0201.hostedemail.com [216.40.44.201]) by kanga.kvack.org (Postfix) with ESMTP id 0C0DA8E0001 for ; Fri, 27 Sep 2019 08:17:54 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 9A870824CA26 for ; Fri, 27 Sep 2019 12:17:53 +0000 (UTC) X-FDA: 75980602026.06.trail47_61f1ca0259129 X-HE-Tag: trail47_61f1ca0259129 X-Filterd-Recvd-Size: 5257 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Sep 2019 12:17:52 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id v38so2125630edm.7 for ; Fri, 27 Sep 2019 05:17:52 -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=zCiD3TkmkX3XcFX04Lf0rUa1Py59Hl7dbwV8vnS+nx4=; b=yDe5MTtY8Qrujp2zCelibfB/Ag25mYxKxY2uPMP1hitaI7IgiQ9rREkUyCW4wjVBwi 99q/NqenKNcoyT6mSmQzKGfzUogxfbJ1FTM41FiO3wJKi/PHmD5EODBVanDBPfYoDekO Ss5Q37xyH4SmU/9+z4EkXuqhFO2yc0I8YvUGpaFGjt72YjJz8b//uyaW9bwMtiit4E5L 2cZYQset3YJ8ja5+8hKqjI4c4hyqbWLQBcw108T1HOBpGkOfHlDGih7OHJObjRki284N ThKmD2Vmtfo3li+XFIlDBghUyC+Y8E2KQHpQAM7icIJ118ql+QWzvYugd7LeZt5SRcYT QLnA== 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=zCiD3TkmkX3XcFX04Lf0rUa1Py59Hl7dbwV8vnS+nx4=; b=le4D2PlARNrtRJ/KYohm7ygdcMW3LbC6/OKD+hhvmBHalhp1Nty6edNOwbCtOhaT6X RUsRd4gItBZzcOQmFrDuvjYdAKRVkXOcXfgZtYmWfKtrS4BaZo0Pci9Z0MabfmHfB5+U Bl+/4xXuU/uVaSSzlMDsb7bT1J+e9lkp7TAUBdO0pcclg4/u0ono242PnHsnqCO8+0Hz 7JX6ncil5L0Chvm+oNF0S1EtIGAXbItobZOinh9QcKwTJ5rTftXKWsj583yBrRmYN2Ry 4zYEQV/b7KTnQgGRoBlcEshPoJuZqrl8yQOqx7KkpK4ihs2bnbmtvLPB4Fb+PsMh9yvL +6sw== X-Gm-Message-State: APjAAAXgeO1erLZhOcd3Qj+xu0sUOXRAkWeOEeXigPJ6dCijCS8mCoKn 4N/cbxhPUuLo6r3YqIHNRgOyIA== X-Google-Smtp-Source: APXvYqzDqxxVYTiADi5x5I86mOGr2mlaIGwZzHeIBO80YOSWqGJpba79qB+UWXl+lD8oNUZcMGCMZA== X-Received: by 2002:a17:906:699:: with SMTP id u25mr7229807ejb.250.1569586671584; Fri, 27 Sep 2019 05:17:51 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id u27sm497064edb.48.2019.09.27.05.17.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Sep 2019 05:17:50 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 9F6F8101F61; Fri, 27 Sep 2019 15:17:54 +0300 (+03) Date: Fri, 27 Sep 2019 15:17:54 +0300 From: "Kirill A. Shutemov" To: Linus Torvalds Cc: Thomas =?utf-8?Q?Hellstr=C3=B6m_=28VMware=29?= , 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: <20190927121754.kn46qh2crvsnw5z2@box> References: <20190926115548.44000-1-thomas_os@shipmail.org> <20190926115548.44000-2-thomas_os@shipmail.org> <85e31bcf-d3c8-2fcf-e659-2c9f82ebedc7@shipmail.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: 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 Thu, Sep 26, 2019 at 01:16:55PM -0700, 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 shoul= d > > probably be possible to make it work, yes. >=20 > 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. Walking mappings of a page is what rmap does. This code thas to be integrated there. --=20 Kirill A. Shutemov