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, 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 58B10C352A9 for ; Thu, 26 Sep 2019 20:55:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1CD9321D7C for ; Thu, 26 Sep 2019 20:55:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=shipmail.org header.i=@shipmail.org header.b="iT1TWL+4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CD9321D7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shipmail.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9E4C88E0024; Thu, 26 Sep 2019 16:55:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 994F48E0021; Thu, 26 Sep 2019 16:55:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8842A8E0024; Thu, 26 Sep 2019 16:55:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 66E698E0021 for ; Thu, 26 Sep 2019 16:55:52 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 10CB6908B for ; Thu, 26 Sep 2019 20:55:52 +0000 (UTC) X-FDA: 75978278544.30.fold88_32fba875cfb1d X-HE-Tag: fold88_32fba875cfb1d X-Filterd-Recvd-Size: 5336 Received: from ste-pvt-msa2.bahnhof.se (ste-pvt-msa2.bahnhof.se [213.80.101.71]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Sep 2019 20:55:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id C92533FBDF; Thu, 26 Sep 2019 22:55:48 +0200 (CEST) Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=iT1TWL+4; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=shipmail.org Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mCc1skLxnFSs; Thu, 26 Sep 2019 22:55:47 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 15C263FA6C; Thu, 26 Sep 2019 22:55:46 +0200 (CEST) Received: from localhost.localdomain (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id 787EE3601AA; Thu, 26 Sep 2019 22:55:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1569531346; bh=QDCzJnIw2NcRoyWGnCmx01s2V3PezimSel1iXciq1+Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=iT1TWL+4cqBnl+TNn7Xu1wTe3naZCoTfhaRKoWLUMNnSy2L+J9vU1YCwN0qUQPOuP r+dn5uLvaChhSo65zGrWGCe6lzIgxh61AHJB3PMZIEFdAnGaU4iOhdTHNI0IH6cmKW PFKNh8UtHSPx96Nd6WgYKQT/5JT0kFZfuLoaAK50= Subject: Re: Ack to merge through DRM? WAS Re: [PATCH v2 1/5] mm: Add write-protect and clean utilities for address space ranges To: Linus Torvalds Cc: Linux Kernel Mailing List , dri-devel , Linux-MM , Andrew Morton , Matthew Wilcox References: <20190926115548.44000-1-thomas_os@shipmail.org> <20190926115548.44000-2-thomas_os@shipmail.org> <85e31bcf-d3c8-2fcf-e659-2c9f82ebedc7@shipmail.org> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: Date: Thu, 26 Sep 2019 22:55:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US 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 9/26/19 10:16 PM, Linus Torvalds wrote: > On Thu, Sep 26, 2019 at 1:09 PM Thomas Hellstr=C3=B6m (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 should >> probably be possible to make it work, yes. > I don't think you need to modify that assert at all. > > That thing only exists when there's a "pud_entry" op in the walker, > and then you absolutely need to have that mmap_lock. > > 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. Well, we're working on supporting huge puds and pmds in the graphics=20 VMAs, although in the write-notify cases we're looking at here, we would=20 probably want to split them down to PTE level. But if we would want to=20 extend that or if we would want to make this interface general, we'd=20 probably want to support also a pud_entry callback. Looking at zap_pud_range() which when called from unmap_mapping_pages()=20 uses identical locking (no mmap_sem), it seems we should be able to get=20 away with i_mmap_lock(), making sure the whole page table doesn't=20 disappear under us. So it's not clear to me why the mmap_sem is strictly=20 needed here. Better to sort those restrictions out now rather than when=20 huge entries start appearing. > > 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. > > 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. > > So making it be just another walking in pagewalk.c would seem to be > the simplest model. > > Call it "walk_page_mapping()". And talk extensively about how the > locking differs a lot from the usual "walk_page_vma()" things. Sure. Can do that. Thanks, Thomas