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 BD585C4360C for ; Thu, 26 Sep 2019 20:09:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B7B621A4A for ; Thu, 26 Sep 2019 20:09:26 +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="gcmPxCth" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B7B621A4A 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 921038E0022; Thu, 26 Sep 2019 16:09:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AA158E0021; Thu, 26 Sep 2019 16:09:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7240A8E0022; Thu, 26 Sep 2019 16:09:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0241.hostedemail.com [216.40.44.241]) by kanga.kvack.org (Postfix) with ESMTP id 4934C8E0021 for ; Thu, 26 Sep 2019 16:09:25 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id D70C78150 for ; Thu, 26 Sep 2019 20:09:24 +0000 (UTC) X-FDA: 75978161448.28.dime13_51f0b418c7648 X-HE-Tag: dime13_51f0b418c7648 X-Filterd-Recvd-Size: 4695 Received: from pio-pvt-msa1.bahnhof.se (pio-pvt-msa1.bahnhof.se [79.136.2.40]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Sep 2019 20:09:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa1.bahnhof.se (Postfix) with ESMTP id 5175C3F486; Thu, 26 Sep 2019 22:09:21 +0200 (CEST) Authentication-Results: pio-pvt-msa1.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b="gcmPxCth"; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Received: from pio-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qHKroFvcWLXm; Thu, 26 Sep 2019 22:09:20 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by pio-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 460793F31C; Thu, 26 Sep 2019 22:09:14 +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 7413A3601AA; Thu, 26 Sep 2019 22:09:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1569528554; bh=3l8scdJAPzeKA98DGCU5rWJe1BLj1pdf1s3/XvaFYIM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=gcmPxCth95u3iGJfWJgByzgw5oVdwb+RepRSGLIODhe5//VGMSDj32YlGikCTRRhj lVpHXYknWBI43AymxkHDLUi1mox2Nt6EnuRk9fUVfg55a8znxCBTiiMHdAkL9XbI6z ftWhUKod23N7nvDRnZ/2dpoh8BqzWhIE2uw3siGA= 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:09:13 +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: Hi, On 9/26/19 9:19 PM, Linus Torvalds wrote: > On Thu, Sep 26, 2019 at 5:03 AM Thomas Hellstr=C3=B6m (VMware) > wrote: >> I wonder if I can get an ack from an mm maintainer to merge this throu= gh >> DRM along with the vmwgfx patches? Andrew? Matthew? > It would have helped to actually point to the patch itself, instead of > just quoting the commit message. > > Looks like this: > > https://lore.kernel.org/lkml/20190926115548.44000-2-thomas_os@shi= pmail.org/ > > but why is the code in question not just using the regular page > walkers. The commit log shows no explanation of what's so special > about this? > > Is the only reason the locking magic? Because if that's the reason, > then afaik we already have a function for that: it's > __walk_page_range(). > > Yes, it's static right now, but that's imho not a reason to duplicate > all the walking (badly). > > Is there some other magic reason that isn't documented? > > Linus There is a discussion around this subject in https://lore.kernel.org/lkml/20190926115548.44000-1-thomas_os@shipmail.or= g/ The main point is that there is an assert in pud_trans_huge_lock() that=20 the mmap_sem is held, and we don't have it. Presumably we should be able=20 to get away with the i_mmap_lock, but in addition I would have had to=20 include the walk_as_pte_range() as the walk::pmd_entry anyway, so the=20 amount of duplicated page walk code isn't that big. That said, if people are OK with me modifying the assert in=20 pud_trans_huge_lock() and make __walk_page_range non-static, it should=20 probably be possible to make it work, yes. Thanks, Thomas