Cover Letter Detail
Show a cover letter.
GET /api/covers/807358/?format=api
{ "id": 807358, "url": "http://patchwork.ozlabs.org/api/covers/807358/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/cover/20170829235447.10050-1-jglisse@redhat.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20170829235447.10050-1-jglisse@redhat.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170829235447.10050-1-jglisse@redhat.com/", "date": "2017-08-29T23:54:34", "name": "[00/13] mmu_notifier kill invalidate_page callback", "submitter": { "id": 71451, "url": "http://patchwork.ozlabs.org/api/people/71451/?format=api", "name": "Jerome Glisse", "email": "jglisse@redhat.com" }, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/cover/20170829235447.10050-1-jglisse@redhat.com/mbox/", "series": [ { "id": 506, "url": "http://patchwork.ozlabs.org/api/series/506/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=506", "date": "2017-08-29T23:54:34", "name": "mmu_notifier kill invalidate_page callback", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/506/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/807358/comments/", "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhmHX59T4z9sMN\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Aug 2017 10:15:36 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhmHX3NlNzDqGV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Aug 2017 10:15:36 +1000 (AEST)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xhlql3mBhzDqMY\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed, 30 Aug 2017 09:54:59 +1000 (AEST)", "from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 73C187E424;\n\tTue, 29 Aug 2017 23:54:57 +0000 (UTC)", "from localhost.localdomain.com (unknown [10.20.6.234])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 21B225D9C0;\n\tTue, 29 Aug 2017 23:54:55 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 73C187E424", "Authentication-Results": [ "ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jglisse@redhat.com" ], "From": "=?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= <jglisse@redhat.com>", "To": "linux-kernel@vger.kernel.org,\n\tlinux-mm@kvack.org", "Subject": "[PATCH 00/13] mmu_notifier kill invalidate_page callback", "Date": "Tue, 29 Aug 2017 19:54:34 -0400", "Message-Id": "<20170829235447.10050-1-jglisse@redhat.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]); Tue, 29 Aug 2017 23:54:57 +0000 (UTC)", "X-Mailman-Approved-At": "Wed, 30 Aug 2017 10:14:06 +1000", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "Andrea Arcangeli <aarcange@redhat.com>, Joerg Roedel <jroedel@suse.de>,\n\tkvm@vger.kernel.org, =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?=\n\t<rkrcmar@redhat.com>, linux-rdma@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org, Jack Steiner <steiner@sgi.com>,\n\tSudeep Dutt <sudeep.dutt@intel.com>, dri-devel@lists.freedesktop.org,\n\tAshutosh Dixit <ashutosh.dixit@intel.com>, \n\tiommu@lists.linux-foundation.org, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?=\n\t<jglisse@redhat.com>, Dimitri Sivanich <sivanich@sgi.com>,\n\tamd-gfx@lists.freedesktop.org, xen-devel@lists.xenproject.org,\n\tPaolo Bonzini <pbonzini@redhat.com>, Andrew Morton\n\t<akpm@linux-foundation.org>, Linus Torvalds\n\t<torvalds@linux-foundation.org>, \n\tDan Williams <dan.j.williams@intel.com>, \"Kirill A . Shutemov\"\n\t<kirill.shutemov@linux.intel.com>", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "(Sorry for so many list cross-posting and big cc)\n\nPlease help testing !\n\nThe invalidate_page callback suffered from 2 pitfalls. First it used to\nhappen after page table lock was release and thus a new page might have\nbeen setup for the virtual address before the call to invalidate_page().\n\nThis is in a weird way fixed by c7ab0d2fdc840266b39db94538f74207ec2afbf6\nwhich moved the callback under the page table lock. Which also broke\nseveral existing user of the mmu_notifier API that assumed they could\nsleep inside this callback.\n\nThe second pitfall was invalidate_page being the only callback not taking\na range of address in respect to invalidation but was giving an address\nand a page. Lot of the callback implementer assumed this could never be\nTHP and thus failed to invalidate the appropriate range for THP pages.\n\nBy killing this callback we unify the mmu_notifier callback API to always\ntake a virtual address range as input.\n\nThere is now 2 clear API (I am not mentioning the youngess API which is\nseldomly used):\n - invalidate_range_start()/end() callback (which allow you to sleep)\n - invalidate_range() where you can not sleep but happen right after\n page table update under page table lock\n\n\nNote that a lot of existing user feels broken in respect to range_start/\nrange_end. Many user only have range_start() callback but there is nothing\npreventing them to undo what was invalidated in their range_start() callback\nafter it returns but before any CPU page table update take place.\n\nThe code pattern use in kvm or umem odp is an example on how to properly\navoid such race. In a nutshell use some kind of sequence number and active\nrange invalidation counter to block anything that might undo what the\nrange_start() callback did.\n\nIf you do not care about keeping fully in sync with CPU page table (ie\nyou can live with CPU page table pointing to new different page for a\ngiven virtual address) then you can take a reference on the pages inside\nthe range_start callback and drop it in range_end or when your driver\nis done with those pages.\n\nLast alternative is to use invalidate_range() if you can do invalidation\nwithout sleeping as invalidate_range() callback happens under the CPU\npage table spinlock right after the page table is updated.\n\n\nNote this is barely tested. I intend to do more testing of next few days\nbut i do not have access to all hardware that make use of the mmu_notifier\nAPI.\n\n\nFirst 2 patches convert existing call of mmu_notifier_invalidate_page()\nto mmu_notifier_invalidate_range() and bracket those call with call to\nmmu_notifier_invalidate_range_start()/end().\n\nThe next 10 patches remove existing invalidate_page() callback as it can\nno longer happen.\n\nFinaly the last page remove it completely so it can RIP.\n\nJérôme Glisse (13):\n dax: update to new mmu_notifier semantic\n mm/rmap: update to new mmu_notifier semantic\n powerpc/powernv: update to new mmu_notifier semantic\n drm/amdgpu: update to new mmu_notifier semantic\n IB/umem: update to new mmu_notifier semantic\n IB/hfi1: update to new mmu_notifier semantic\n iommu/amd: update to new mmu_notifier semantic\n iommu/intel: update to new mmu_notifier semantic\n misc/mic/scif: update to new mmu_notifier semantic\n sgi-gru: update to new mmu_notifier semantic\n xen/gntdev: update to new mmu_notifier semantic\n KVM: update to new mmu_notifier semantic\n mm/mmu_notifier: kill invalidate_page\n\nCc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\nCc: Linus Torvalds <torvalds@linux-foundation.org>\nCc: Andrew Morton <akpm@linux-foundation.org>\nCc: Andrea Arcangeli <aarcange@redhat.com>\nCc: Joerg Roedel <jroedel@suse.de>\nCc: Dan Williams <dan.j.williams@intel.com>\nCc: Sudeep Dutt <sudeep.dutt@intel.com>\nCc: Ashutosh Dixit <ashutosh.dixit@intel.com>\nCc: Dimitri Sivanich <sivanich@sgi.com>\nCc: Jack Steiner <steiner@sgi.com>\nCc: Paolo Bonzini <pbonzini@redhat.com>\nCc: Radim Krčmář <rkrcmar@redhat.com>\n\nCc: linuxppc-dev@lists.ozlabs.org\nCc: dri-devel@lists.freedesktop.org\nCc: amd-gfx@lists.freedesktop.org\nCc: linux-rdma@vger.kernel.org\nCc: iommu@lists.linux-foundation.org\nCc: xen-devel@lists.xenproject.org\nCc: kvm@vger.kernel.org\n\n\n arch/powerpc/platforms/powernv/npu-dma.c | 10 --------\n drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 31 ----------------------\n drivers/infiniband/core/umem_odp.c | 19 --------------\n drivers/infiniband/hw/hfi1/mmu_rb.c | 9 -------\n drivers/iommu/amd_iommu_v2.c | 8 ------\n drivers/iommu/intel-svm.c | 9 -------\n drivers/misc/mic/scif/scif_dma.c | 11 --------\n drivers/misc/sgi-gru/grutlbpurge.c | 12 ---------\n drivers/xen/gntdev.c | 8 ------\n fs/dax.c | 19 ++++++++------\n include/linux/mm.h | 1 +\n include/linux/mmu_notifier.h | 25 ------------------\n mm/memory.c | 26 +++++++++++++++----\n mm/mmu_notifier.c | 14 ----------\n mm/rmap.c | 44 +++++++++++++++++++++++++++++---\n virt/kvm/kvm_main.c | 42 ------------------------------\n 16 files changed, 74 insertions(+), 214 deletions(-)" }