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.1 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 3A129C388F3 for ; Fri, 27 Sep 2019 12:26:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EE40021850 for ; Fri, 27 Sep 2019 12:26:37 +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="Js5q4lD+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE40021850 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 8B5C58E0008; Fri, 27 Sep 2019 08:26:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 866888E0001; Fri, 27 Sep 2019 08:26:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 756E78E0008; Fri, 27 Sep 2019 08:26:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0061.hostedemail.com [216.40.44.61]) by kanga.kvack.org (Postfix) with ESMTP id 5796A8E0001 for ; Fri, 27 Sep 2019 08:26:37 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id B8B5282437D7 for ; Fri, 27 Sep 2019 12:26:36 +0000 (UTC) X-FDA: 75980623992.08.smash42_1c8c39f403c42 X-HE-Tag: smash42_1c8c39f403c42 X-Filterd-Recvd-Size: 5678 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Sep 2019 12:26:36 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id a15so2160967edt.6 for ; Fri, 27 Sep 2019 05:26:35 -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=MLpaVux2E5Ma8rfAsYk3Q/0a9jF4YNQVNjLuUjERIwU=; b=Js5q4lD+A5EtYma3P8PemetzNBMs7ohd2kxsZRV/XUHWHotVYaRs6vDe1pWcT7zE7J 54Hyer007sKbB3MNGI+y38bGmLRx7Nq7UkQO10kupTbe1Z8xWZAORHKu7jntTtMN4Yv6 IHTBdlDrR1iuNBsPF3XlddLM7fOWrvUnB0PPEvNnBnyPv/UqxhJpyG70UqtCxCoM8Jud BB9LzNMy6kmbYjTU7r2uP4oO8nJw2StVOGWSNb9PvsWzmsuwG+mWIdbQKCnIPqqq1eO3 s6/c+36AJgA9/dM0ncR//xpZ7s1mJgkuVFDb6OJYucA/EOyBE4tGQRsc1ZPP6jjrxvvY 1UHg== 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=MLpaVux2E5Ma8rfAsYk3Q/0a9jF4YNQVNjLuUjERIwU=; b=kgfbg5r4h5MepvmvSA5a3t+oIS7E5QND7gsoJXOt9cQ15hFFtmTFO6eAJmIw53qAKV BZU/Yhdd0TECRDBbDWRrqSKK8VYgBkGUJSgXHhM2PgNkx+kOcC7KUwqJX+yv6MC0vmDc fVrisjSHSXg8yZE4Aqjz6tnWqKRubF3NpeiBuk6kdKiK7rNmhrICirHiKqLdPVedUcmO XUGJ5Ir+JOjGrmyGO39sdqWCVu1zpyNqIJHXFdGujTADqaIZLIjev0HSol2YdYS7ILv/ 6BxfKcAE0Fjp2rA/Ub5iT1F02pvg4gFOes7l80IfB0dB+4RXuoi3iGOGyPY4IiW2rvDK ZP9g== X-Gm-Message-State: APjAAAWq/8wxJWS0bIZ0TaMsInO8MuJa647vQEdRu3r1w0ZsVEisxxGY ZU7da72rH/qyjHavS9n6t8TjxQ== X-Google-Smtp-Source: APXvYqzv9a01DzZigIrxklIuOXJfyd+toe/1RrwfEGr3f1/wzZbbNkfR0iv1STW7wTw/jLxvMFgK8g== X-Received: by 2002:a05:6402:2cb:: with SMTP id b11mr4179069edx.285.1569587194900; Fri, 27 Sep 2019 05:26:34 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id j43sm500196eda.19.2019.09.27.05.26.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Sep 2019 05:26:34 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 147A7101F61; Fri, 27 Sep 2019 15:26:38 +0300 (+03) Date: Fri, 27 Sep 2019 15:26:38 +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: <20190927122638.wtn5idrt4btir6be@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 03:20:42PM -0700, Linus Torvalds wrote: > On Thu, Sep 26, 2019 at 1:55 PM Thomas Hellstr=F6m (VMware) > wrote: > > > > Well, we're working on supporting huge puds and pmds in the graphics > > VMAs, although in the write-notify cases we're looking at here, we wo= uld > > probably want to split them down to PTE level. >=20 > Well, that's what the existing walker code does if you don't have that > "pud_entry()" callback. >=20 > That said, I assume you would *not* want to do that if the huge > pud/pmd is already clean and read-only, but just continue. >=20 > So you may want to have a special pud_entry() that handles that case. > Eventually. Maybe. Although honestly, if you're doing dirty tracking, > I doubt it makes much sense to use largepages. >=20 > > Looking at zap_pud_range() which when called from unmap_mapping_pages= () > > uses identical locking (no mmap_sem), it seems we should be able to g= et > > away with i_mmap_lock(), making sure the whole page table doesn't > > disappear under us. So it's not clear to me why the mmap_sem is stric= tly > > needed here. Better to sort those restrictions out now rather than wh= en > > huge entries start appearing. >=20 > zap_pud_range()actually does have that >=20 > VM_BUG_ON_VMA(!rwsem_is_locked(&tlb->mm->mmap_sem), vma)= ; The VM_BUG is a blind copy from PMD layer and it's bogus. i_mmap_lock() works fine for file mappings. The PMD was intended for THP case at the time when there were only anon-THP. The check was relaxed and later dropped for file-THP on PMD level. It has to be dropped on PUD too. We don't have anon-THP on PUD level at all, only DAX played with them. =20 --=20 Kirill A. Shutemov