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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 6B09CC352AB for ; Thu, 26 Sep 2019 20:17:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2FC7B222C2 for ; Thu, 26 Sep 2019 20:17:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="aB5pA3Sy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FC7B222C2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AEEDC8E0023; Thu, 26 Sep 2019 16:17:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9F9D8E0021; Thu, 26 Sep 2019 16:17:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98EF28E0023; Thu, 26 Sep 2019 16:17:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 77AC48E0021 for ; Thu, 26 Sep 2019 16:17:16 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id ECC6C181AC9B4 for ; Thu, 26 Sep 2019 20:17:15 +0000 (UTC) X-FDA: 75978181230.04.coil38_5285506ed701 X-HE-Tag: coil38_5285506ed701 X-Filterd-Recvd-Size: 5075 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Sep 2019 20:17:15 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id v24so238121ljj.3 for ; Thu, 26 Sep 2019 13:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7RbCDRjRAvWcIi7QkdCjwk6XzzWsIsN9TecD9WwksU0=; b=aB5pA3SyZ5HaFLWIhKIPBd/X2uy1rvQJqJjWNTqTRvRCwfYAHVwoGVtpWvbJi2/gvM 4lACq7gPi2ifoD1gBfDLo2nCP7EvRcJXd25QAJYSNV2Hv0abkMJ3RTdFJkKbYrWUIHZ0 HfDtd6wvPm9AKCezZy9cGdX9Q1c6mc+eBmIyA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7RbCDRjRAvWcIi7QkdCjwk6XzzWsIsN9TecD9WwksU0=; b=C2iBnF/vniQy8Wm7tbqdW+K2lQab2bVidiI0Tg157SY/eUrtP3sJcga244bQFpb1P6 +0xWyfAuMz7klCNyPy99Vl8i5XkpYDHWAh1d3ymcD0EoLfpc5KTgIOOKz/F0gnwAyhjd WnTL9qEqOBOS7Xy36KjkMB20M4XSrD3QXLusiVw9jEdV1KaYM8KJW3QHW5oQdvFP8gNG R2PKpII7IIE0qjkdSDtlYOUy6gQMvjoSyowas9LCM9guQ4zwsMODyi9DQyP2jueMQFw9 u0RU2kJZ2AFf2K3xEJpYji+LZlkBDOlXHExLBXZhMFrKlpOAiikMNeJlu4ZZ4kF8ZOPB ZFzg== X-Gm-Message-State: APjAAAUOfbLyCjlLya385qyfdNxR1/vNIxRgZfg8qHO5DIKp4MuE9Vq6 W5z67hyi4L2+AU9+sGNKk78bgE84LZ8= X-Google-Smtp-Source: APXvYqw5T57L5bV41viYhbIaJF7W9/5nllmVXkDVGM/KR7bHb5lvBOvypT1zAuu1btxtwzRwZcLc8w== X-Received: by 2002:a2e:9118:: with SMTP id m24mr315718ljg.95.1569529033259; Thu, 26 Sep 2019 13:17:13 -0700 (PDT) Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com. [209.85.208.181]) by smtp.gmail.com with ESMTPSA id d26sm37587ljc.64.2019.09.26.13.17.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Sep 2019 13:17:12 -0700 (PDT) Received: by mail-lj1-f181.google.com with SMTP id l21so231921lje.4 for ; Thu, 26 Sep 2019 13:17:12 -0700 (PDT) X-Received: by 2002:a2e:8789:: with SMTP id n9mr344627lji.52.1569529031736; Thu, 26 Sep 2019 13:17:11 -0700 (PDT) MIME-Version: 1.0 References: <20190926115548.44000-1-thomas_os@shipmail.org> <20190926115548.44000-2-thomas_os@shipmail.org> <85e31bcf-d3c8-2fcf-e659-2c9f82ebedc7@shipmail.org> In-Reply-To: From: Linus Torvalds Date: Thu, 26 Sep 2019 13:16:55 -0700 X-Gmail-Original-Message-ID: Message-ID: 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: =?UTF-8?Q?Thomas_Hellstr=C3=B6m_=28VMware=29?= Cc: Linux Kernel Mailing List , dri-devel , Linux-MM , Andrew Morton , Matthew Wilcox Content-Type: text/plain; charset="UTF-8" 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 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. 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. The then actual "apply" functions (what a horrid name) could be in the users. They shouldn't be mixed in with the walking functions anyway. They are callbacks, not walkers. Linus