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.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 DE794C32792 for ; Mon, 30 Sep 2019 17:38:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 74A4D224D3 for ; Mon, 30 Sep 2019 17:38:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=shipmail.org header.i=@shipmail.org header.b="GpvpfTgb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74A4D224D3 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 D4BA76B0007; Mon, 30 Sep 2019 13:38:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CFD9A6B0008; Mon, 30 Sep 2019 13:38:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BEC4D6B000A; Mon, 30 Sep 2019 13:38:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 9E7CB6B0007 for ; Mon, 30 Sep 2019 13:38:43 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 3DB89181AC9AE for ; Mon, 30 Sep 2019 17:38:43 +0000 (UTC) X-FDA: 75992296926.27.dad74_11ad162584050 X-HE-Tag: dad74_11ad162584050 X-Filterd-Recvd-Size: 4565 Received: from pio-pvt-msa3.bahnhof.se (pio-pvt-msa3.bahnhof.se [79.136.2.42]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Sep 2019 17:38:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTP id E7E6E3F549; Mon, 30 Sep 2019 19:38:39 +0200 (CEST) Authentication-Results: pio-pvt-msa3.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=GpvpfTgb; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Received: from pio-pvt-msa3.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa3.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hnuYuafil-f7; Mon, 30 Sep 2019 19:38:34 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTPA id B96B63F4B6; Mon, 30 Sep 2019 19:38:31 +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 789ED36016A; Mon, 30 Sep 2019 19:38:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1569865111; bh=Mbv8I+Cf9qo+4r4AR1GScXQE/ojfy18469i5KoNwfsg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=GpvpfTgbFXewp0ygt6YF4cirkWGlnK74clrVKSVTm7q9qX01w4J2Ic0CkUN2QlXEh +TpoCVtuKvm2+5ivSMPVfSI3bB7XtpBXGdQ3y5+le76vg9tOoWSTvPeiNJaMXZZUcT GQoa1J9ueiuw5NeMW0Doyyjpevc85q+KbNJq298s= 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 , "Kirill A. Shutemov" 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> <20190927121754.kn46qh2crvsnw5z2@box> <20190930130357.ye3zlkbka2jtd56a@box> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: <2788e6e6-6916-5f95-51f5-336b8edaee2f@shipmail.org> Date: Mon, 30 Sep 2019 19:38:31 +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-Transfer-Encoding: 7bit Content-Language: en-US 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/30/19 7:12 PM, Linus Torvalds wrote: > On Mon, Sep 30, 2019 at 6:04 AM Kirill A. Shutemov wrote: >> Have you seen page_vma_mapped_walk()? I made it specifically for rmap code >> to cover cases when a THP is mapped with PTEs. To me it's not a big >> stretch to make it cover multiple pages too. > I agree that is closer, but it does make for calling that big complex > function for every iteration step. > > Of course, you are right that the callback approach is problematic > too, now that we have retpoline issues, making those very expensive. > But at least that hopefully gets fixed some day and gets to be a rare > problem. > > Matter ot taste, I guess. > > Linus Matthew Wilcox suggested something similar before the pagewalk.c rewrite: https://lore.kernel.org/lkml/20190806190937.GD30179@bombadil.infradead.org/ Still, In this case I'd opt for using the pagewalk code: In the dirty helpers we don't ever use a struct page, but only deal with PTE entries, same as the pagewalk code does, but not page_vma_mapped_walk(). The underlying memory may well be IO memory. /Thomas