get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/811068/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 811068,
    "url": "http://patchwork.ozlabs.org/api/patches/811068/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170907145148.24398-9-npiggin@gmail.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": "<20170907145148.24398-9-npiggin@gmail.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170907145148.24398-9-npiggin@gmail.com/",
    "date": "2017-09-07T14:51:48",
    "name": "[RFC,8/8] powerpc/64s/radix: Only flush local TLB for spurious fault flushes",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "83444a0ad840876a0d7010c4845b5862aa3e8317",
    "submitter": {
        "id": 69518,
        "url": "http://patchwork.ozlabs.org/api/people/69518/?format=api",
        "name": "Nicholas Piggin",
        "email": "npiggin@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170907145148.24398-9-npiggin@gmail.com/mbox/",
    "series": [
        {
            "id": 2010,
            "url": "http://patchwork.ozlabs.org/api/series/2010/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=2010",
            "date": "2017-09-07T14:51:40",
            "name": "Further radix TLB flush optimisations",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2010/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/811068/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811068/checks/",
    "tags": {},
    "related": [],
    "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 3xp3kg6rf3z9t2v\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 01:08:59 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xp3kg5CF8zDrSL\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  8 Sep 2017 01:08:59 +1000 (AEST)",
            "from mail-pf0-x243.google.com (mail-pf0-x243.google.com\n\t[IPv6:2607:f8b0:400e:c00::243])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xp3Mv6wFDzDrXG\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  8 Sep 2017 00:52:43 +1000 (AEST)",
            "by mail-pf0-x243.google.com with SMTP id q76so4607007pfq.5\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 07 Sep 2017 07:52:43 -0700 (PDT)",
            "from roar.au.ibm.com (203-219-56-202.tpgi.com.au. [203.219.56.202])\n\tby smtp.gmail.com with ESMTPSA id\n\ta6sm4642791pfa.76.2017.09.07.07.52.38\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 07 Sep 2017 07:52:40 -0700 (PDT)"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"PYmamQlV\"; dkim-atps=neutral",
            "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"PYmamQlV\"; dkim-atps=neutral",
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c00::243; helo=mail-pf0-x243.google.com;\n\tenvelope-from=npiggin@gmail.com; receiver=<UNKNOWN>)",
            "lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"PYmamQlV\"; dkim-atps=neutral"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=Z0H1SH2RamIuKZq2U/Q2NxEWB2Eqo3rTC3mDm145w1g=;\n\tb=PYmamQlVk2t9azWD+b/7XTI7CwPban1bT2lx6vXP0OA6QtpM8PpbF590V+2ci2fH+Q\n\tS3pMdfulp5Y3Rp/l3NkScmTilwjAZbDJ0EAMOINbli0XaV5EkGMNkYkPKQ1/MIyASR/k\n\t/wYBD8gk8E+wNZ+EFrLOpKM2V0ri6MSvvlSxWPSZNYuW9GjRr9ubGxzt6LtEm1FKmSK0\n\tlp5xwWvqcS4bmC2QYR+sZM4Hd2LeBBTClJl3VYT0IHaa0fmmQ3TwX0I32P7ldPgxGlF/\n\tpssCt+LzaIQwoKzAnkqdnyO5P1Y8ctJgxMX8sB8pYvxwWNhdzPo2WOSMCAWXsD1XgsJX\n\tW8cQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Z0H1SH2RamIuKZq2U/Q2NxEWB2Eqo3rTC3mDm145w1g=;\n\tb=RyjW/NDeS+xZJqMFCFe7oUBU6Pv2eDCf9EHpBFQ8BOY4KnQbzSVEgGgUGEAL7YJMwS\n\tBvFqdi8aozxxt0xWwkWtrLPfG866eyEWh5VdOmW65A5J/vVtusDH2Z6RhM6AYIbICEcc\n\tkiTRF3L98blbFKkD+JQ1O38+rbVIHjD5X5deEwBtfWiCZofjffq1blafgWCE/5K+MuQa\n\tAc4qCq0S4gvk5/eWQ7zVJr+mNO+9FuTh2yVTRB4jfgcY8m4eZMk5oOp1B9UfOwvN/tkq\n\txiKTwM3+qLxXsxXBXdmT01KBMUO87/eX+MztXOQXxA6q8dQUo2qXbcJeyEJkPPBe2kwR\n\tCNow==",
        "X-Gm-Message-State": "AHPjjUhFau/+8H5ca7mOtZpZ49XEa5hnVmLiM1cakdo6rH4ugaNgCVSF\n\tj9mqv2pz7y8x0mDq",
        "X-Google-Smtp-Source": "ADKCNb70/ElXq4JdaOvflOP88bBJZqFckwlD6g8mE1Vuk7Jrq4p/0H27j/MM1YOEs/uRq76zbci5Yg==",
        "X-Received": "by 10.99.38.4 with SMTP id m4mr2942539pgm.53.1504795961849;\n\tThu, 07 Sep 2017 07:52:41 -0700 (PDT)",
        "From": "Nicholas Piggin <npiggin@gmail.com>",
        "To": "linuxppc-dev@lists.ozlabs.org",
        "Subject": "[RFC PATCH 8/8] powerpc/64s/radix: Only flush local TLB for spurious\n\tfault flushes",
        "Date": "Fri,  8 Sep 2017 00:51:48 +1000",
        "Message-Id": "<20170907145148.24398-9-npiggin@gmail.com>",
        "X-Mailer": "git-send-email 2.13.3",
        "In-Reply-To": "<20170907145148.24398-1-npiggin@gmail.com>",
        "References": "<20170907145148.24398-1-npiggin@gmail.com>",
        "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": "\"Aneesh Kumar K . V\" <aneesh.kumar@linux.vnet.ibm.com>,\n\tNicholas Piggin <npiggin@gmail.com>, Anton Blanchard <anton@samba.org>",
        "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": "When permissiveness is relaxed, or found to have been relaxed by\nanother thread, we flush that address out of the TLB to avoid a\nfuture fault or micro-fault due to a stale TLB entry.\n\nCurrently for processes with TLBs on other CPUs, this flush is always\ndone with a global tlbie. Although that could reduce faults on remote\nCPUs, a broadcast operation seems to be wasteful for something that\ncan be handled in-core by the remote CPU if it comes to it.\n\nThis is not benchmarked yet. It does seem cut some tlbie operations\nfrom the bus.\n\nSigned-off-by: Nicholas Piggin <npiggin@gmail.com>\n---\n .../powerpc/include/asm/book3s/64/tlbflush-radix.h |  5 ++++\n arch/powerpc/include/asm/book3s/64/tlbflush.h      | 11 +++++++++\n arch/powerpc/mm/pgtable-book3s64.c                 |  5 +++-\n arch/powerpc/mm/pgtable.c                          |  2 +-\n arch/powerpc/mm/tlb-radix.c                        | 27 ++++++++++++++++++++++\n 5 files changed, 48 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h b/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h\nindex b12460b306a7..34cd864b8fc1 100644\n--- a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h\n+++ b/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h\n@@ -16,6 +16,8 @@ extern bool radix__flush_tlb_range_psize(struct mm_struct *mm, unsigned long sta\n \t\t\t\t\t unsigned long end, int psize);\n extern void radix__flush_pmd_tlb_range(struct vm_area_struct *vma,\n \t\t\t\t       unsigned long start, unsigned long end);\n+extern void radix__local_flush_pmd_tlb_range(struct vm_area_struct *vma,\n+\t\t\t\tunsigned long start, unsigned long end);\n extern void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start,\n \t\t\t    unsigned long end);\n extern void radix__flush_tlb_kernel_range(unsigned long start, unsigned long end);\n@@ -24,6 +26,9 @@ extern void radix__local_flush_tlb_mm(struct mm_struct *mm);\n extern void radix__local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);\n extern void radix__local_flush_tlb_page_psize(struct mm_struct *mm, unsigned long vmaddr,\n \t\t\t\t\t      int psize);\n+extern void radix__local_flush_tlb_range_psize(struct mm_struct *mm,\n+\t\t\t\tunsigned long start, unsigned long end,\n+\t\t\t\tint psize);\n extern void radix__tlb_flush(struct mmu_gather *tlb);\n #ifdef CONFIG_SMP\n extern void radix__flush_tlb_mm(struct mm_struct *mm);\ndiff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/powerpc/include/asm/book3s/64/tlbflush.h\nindex 72b925f97bab..8a8b3e11a28e 100644\n--- a/arch/powerpc/include/asm/book3s/64/tlbflush.h\n+++ b/arch/powerpc/include/asm/book3s/64/tlbflush.h\n@@ -83,6 +83,17 @@ static inline void flush_tlb_page(struct vm_area_struct *vma,\n #define flush_tlb_mm(mm)\t\tlocal_flush_tlb_mm(mm)\n #define flush_tlb_page(vma, addr)\tlocal_flush_tlb_page(vma, addr)\n #endif /* CONFIG_SMP */\n+\n+#define flush_tlb_fix_spurious_fault flush_tlb_fix_spurious_fault\n+static inline void flush_tlb_fix_spurious_fault(struct vm_area_struct *vma,\n+\t\t\t\t\t\tunsigned long address)\n+{\n+\tif (radix_enabled())\n+\t\tradix__local_flush_tlb_page(vma, address);\n+\telse\n+\t\tflush_tlb_page(vma, address);\n+}\n+\n /*\n  * flush the page walk cache for the address\n  */\ndiff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c\nindex 3b65917785a5..e46f346388d6 100644\n--- a/arch/powerpc/mm/pgtable-book3s64.c\n+++ b/arch/powerpc/mm/pgtable-book3s64.c\n@@ -40,7 +40,10 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address,\n \tif (changed) {\n \t\t__ptep_set_access_flags(vma->vm_mm, pmdp_ptep(pmdp),\n \t\t\t\t\tpmd_pte(entry), address);\n-\t\tflush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);\n+\t\tif (radix_enabled())\n+\t\t\tradix__local_flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);\n+\t\telse\n+\t\t\tflush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);\n \t}\n \treturn changed;\n }\ndiff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c\nindex a03ff3d99e0c..acd6ae8062ce 100644\n--- a/arch/powerpc/mm/pgtable.c\n+++ b/arch/powerpc/mm/pgtable.c\n@@ -223,7 +223,7 @@ int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,\n \t\tif (!is_vm_hugetlb_page(vma))\n \t\t\tassert_pte_locked(vma->vm_mm, address);\n \t\t__ptep_set_access_flags(vma->vm_mm, ptep, entry, address);\n-\t\tflush_tlb_page(vma, address);\n+\t\tflush_tlb_fix_spurious_fault(vma, address);\n \t}\n \treturn changed;\n }\ndiff --git a/arch/powerpc/mm/tlb-radix.c b/arch/powerpc/mm/tlb-radix.c\nindex 7452e1f4aa3c..bcb41d037593 100644\n--- a/arch/powerpc/mm/tlb-radix.c\n+++ b/arch/powerpc/mm/tlb-radix.c\n@@ -396,6 +396,27 @@ void radix__tlb_flush(struct mmu_gather *tlb)\n static unsigned long tlb_single_page_flush_ceiling __read_mostly = 33;\n static unsigned long tlb_local_single_page_flush_ceiling __read_mostly = POWER9_TLB_SETS_RADIX * 2;\n \n+void radix__local_flush_tlb_range_psize(struct mm_struct *mm,\n+\t\t\t\tunsigned long start, unsigned long end,\n+\t\t\t\tint psize)\n+{\n+\tunsigned long pid;\n+\tunsigned int page_shift = mmu_psize_defs[psize].shift;\n+\tunsigned long page_size = 1UL << page_shift;\n+\n+\tpid = mm ? mm->context.id : 0;\n+\tif (unlikely(pid == MMU_NO_CONTEXT))\n+\t\treturn;\n+\n+\tpreempt_disable();\n+\tif (end == TLB_FLUSH_ALL || ((end - start) >> page_shift) >\n+\t\t\t\ttlb_local_single_page_flush_ceiling)\n+\t\t_tlbiel_pid(pid, RIC_FLUSH_TLB);\n+\telse\n+\t\t_tlbiel_va_range(start, end, pid, page_size, psize);\n+\tpreempt_enable();\n+}\n+\n static bool __radix__flush_tlb_range_psize(struct mm_struct *mm,\n \t\t\t\tunsigned long start, unsigned long end,\n \t\t\t\tint psize, bool also_pwc)\n@@ -518,6 +539,12 @@ void radix__flush_tlb_lpid(unsigned long lpid)\n }\n EXPORT_SYMBOL(radix__flush_tlb_lpid);\n \n+void radix__local_flush_pmd_tlb_range(struct vm_area_struct *vma,\n+\t\t\t\tunsigned long start, unsigned long end)\n+{\n+\tradix__local_flush_tlb_range_psize(vma->vm_mm, start, end, MMU_PAGE_2M);\n+}\n+\n void radix__flush_pmd_tlb_range(struct vm_area_struct *vma,\n \t\t\t\tunsigned long start, unsigned long end)\n {\n",
    "prefixes": [
        "RFC",
        "8/8"
    ]
}