get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 694,
    "url": "http://patchwork.ozlabs.org/api/patches/694/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20080919.234832.127229997.davem@davemloft.net/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20080919.234832.127229997.davem@davemloft.net>",
    "list_archive_url": null,
    "date": "2008-09-20T06:48:32",
    "name": "[2/2] : softirq: Add support for triggering softirq work on softirqs.",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "c7c4e5eab4bdd6e2d95dc10063824c749008fba7",
    "submitter": {
        "id": 15,
        "url": "http://patchwork.ozlabs.org/api/people/15/?format=api",
        "name": "David Miller",
        "email": "davem@davemloft.net"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20080919.234832.127229997.davem@davemloft.net/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/694/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/694/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id 3D3C6DDEDA\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 20 Sep 2008 16:48:59 +1000 (EST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751459AbYITGsr (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 20 Sep 2008 02:48:47 -0400",
            "(majordomo@vger.kernel.org) by vger.kernel.org id S1751415AbYITGsq\n\t(ORCPT <rfc822; netdev-outgoing>); Sat, 20 Sep 2008 02:48:46 -0400",
            "from 74-93-104-97-Washington.hfc.comcastbusiness.net\n\t([74.93.104.97]:35484\n\t\"EHLO sunset.davemloft.net\" rhost-flags-OK-FAIL-OK-OK)\n\tby vger.kernel.org with ESMTP id S1751382AbYITGso (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 20 Sep 2008 02:48:44 -0400",
            "from localhost (localhost [127.0.0.1])\n\tby sunset.davemloft.net (Postfix) with ESMTP id 61485C8C185;\n\tFri, 19 Sep 2008 23:48:32 -0700 (PDT)"
        ],
        "Date": "Fri, 19 Sep 2008 23:48:32 -0700 (PDT)",
        "Message-Id": "<20080919.234832.127229997.davem@davemloft.net>",
        "To": "linux-kernel@vger.kernel.org",
        "CC": "netdev@vger.kernel.org, jens.axboe@oracle.com,\n\tsteffen.klassert@secunet.com",
        "Subject": "[PATCH 2/2]: softirq: Add support for triggering softirq work on\n\tsoftirqs.",
        "From": "David Miller <davem@davemloft.net>",
        "X-Mailer": "Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI)",
        "Mime-Version": "1.0",
        "Content-Type": "Text/Plain; charset=us-ascii",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "softirq: Add support for triggering softirq work on softirqs.\n\nThis is basically a genericization of Jens Axboe's block layer\nremote softirq changes.\n\nSigned-off-by: David S. Miller <davem@davemloft.net>\nSigned-off-by: Jens Axboe <jens.axboe@oracle.com>\n---\n include/linux/interrupt.h |    6 ++-\n kernel/softirq.c          |  103 +++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 108 insertions(+), 1 deletions(-)",
    "diff": "diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h\nindex fdd7b90..91ca3ac 100644\n--- a/include/linux/interrupt.h\n+++ b/include/linux/interrupt.h\n@@ -11,6 +11,8 @@\n #include <linux/hardirq.h>\n #include <linux/sched.h>\n #include <linux/irqflags.h>\n+#include <linux/smp.h>\n+#include <linux/percpu.h>\n #include <asm/atomic.h>\n #include <asm/ptrace.h>\n #include <asm/system.h>\n@@ -271,7 +273,9 @@ extern void softirq_init(void);\n #define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)\n extern void raise_softirq_irqoff(unsigned int nr);\n extern void raise_softirq(unsigned int nr);\n-\n+DECLARE_PER_CPU(struct list_head, softirq_work_list[NR_SOFTIRQ]);\n+extern void __send_remote_softirq(struct call_single_data *cp, int cpu, int this_cpu, int softirq);\n+extern void send_remote_softirq(struct call_single_data *cp, int cpu, int softirq);\n \n /* Tasklets --- multithreaded analogue of BHs.\n \ndiff --git a/kernel/softirq.c b/kernel/softirq.c\nindex 27642a2..9c0723d 100644\n--- a/kernel/softirq.c\n+++ b/kernel/softirq.c\n@@ -6,6 +6,8 @@\n  *\tDistribute under GPLv2.\n  *\n  *\tRewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903)\n+ *\n+ *\tRemote softirq infrastructure is by Jens Axboe.\n  */\n \n #include <linux/module.h>\n@@ -463,17 +465,118 @@ void tasklet_kill(struct tasklet_struct *t)\n \n EXPORT_SYMBOL(tasklet_kill);\n \n+DEFINE_PER_CPU(struct list_head, softirq_work_list[NR_SOFTIRQ]);\n+\n+static void __local_trigger(struct call_single_data *cp, int softirq)\n+{\n+\tstruct list_head *head = &__get_cpu_var(softirq_work_list[softirq]);\n+\n+\tlist_add_tail(&cp->list, head);\n+\tif (head->next == &cp->list)\n+\t\traise_softirq_irqoff(softirq);\n+}\n+\n+#if defined(CONFIG_SMP) && defined(CONFIG_USE_GENERIC_SMP_HELPERS)\n+static void remote_softirq_receive(void *data)\n+{\n+\tstruct call_single_data *cp = data;\n+\tunsigned long flags;\n+\tint softirq;\n+\n+\tsoftirq = cp->flags >> 16;\n+\n+\tlocal_irq_save(flags);\n+\t__local_trigger(cp, softirq);\n+\tlocal_irq_restore(flags);\n+}\n+\n+static int __try_remote_softirq(struct call_single_data *cp, int cpu, int softirq)\n+{\n+\tif (cpu_online(cpu)) {\n+\t\tcp->func = remote_softirq_receive;\n+\t\tcp->info = cp;\n+\t\tcp->flags = softirq << 16;\n+\t\t__smp_call_function_single(cpu, cp);\n+\t\treturn 0;\n+\t}\n+\treturn 1;\n+}\n+#else /* CONFIG_SMP && CONFIG_USE_GENERIC_SMP_HELPERS */\n+static int __try_remote_softirq(struct call_single_data *cp, int cpu, int softirq)\n+{\n+\treturn 1;\n+}\n+#endif\n+\n+void __send_remote_softirq(struct call_single_data *cp, int cpu, int this_cpu, int softirq)\n+{\n+\tif (cpu == this_cpu || __try_remote_softirq(cp, cpu, softirq))\n+\t\t__local_trigger(cp, softirq);\n+}\n+EXPORT_SYMBOL(__send_remote_softirq);\n+\n+void send_remote_softirq(struct call_single_data *cp, int cpu, int softirq)\n+{\n+\tunsigned long flags;\n+\tint this_cpu;\n+\n+\tlocal_irq_save(flags);\n+\tthis_cpu = smp_processor_id();\n+\t__send_remote_softirq(cp, cpu, this_cpu, softirq);\n+\tlocal_irq_restore(flags);\n+}\n+EXPORT_SYMBOL(send_remote_softirq);\n+\n+static int __cpuinit remote_softirq_cpu_notify(struct notifier_block *self,\n+\t\t\t\t\t       unsigned long action, void *hcpu)\n+{\n+\t/*\n+\t * If a CPU goes away, splice its entries to the current CPU\n+\t * and trigger a run of the softirq\n+\t */\n+\tif (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {\n+\t\tint cpu = (unsigned long) hcpu;\n+\t\tint i;\n+\n+\t\tlocal_irq_disable();\n+\t\tfor (i = 0; i < NR_SOFTIRQ; i++) {\n+\t\t\tstruct list_head *head = &per_cpu(softirq_work_list[i], cpu);\n+\t\t\tstruct list_head *local_head;\n+\n+\t\t\tif (list_empty(head))\n+\t\t\t\tcontinue;\n+\n+\t\t\tlocal_head = &__get_cpu_var(softirq_work_list[i]);\n+\t\t\tlist_splice_init(head, local_head);\n+\t\t\traise_softirq_irqoff(i);\n+\t\t}\n+\t\tlocal_irq_enable();\n+\t}\n+\n+\treturn NOTIFY_OK;\n+}\n+\n+static struct notifier_block __cpuinitdata remote_softirq_cpu_notifier = {\n+\t.notifier_call\t= remote_softirq_cpu_notify,\n+};\n+\n void __init softirq_init(void)\n {\n \tint cpu;\n \n \tfor_each_possible_cpu(cpu) {\n+\t\tint i;\n+\n \t\tper_cpu(tasklet_vec, cpu).tail =\n \t\t\t&per_cpu(tasklet_vec, cpu).head;\n \t\tper_cpu(tasklet_hi_vec, cpu).tail =\n \t\t\t&per_cpu(tasklet_hi_vec, cpu).head;\n+\t\tfor (i = 0; i < NR_SOFTIRQ; i++)\n+\t\t\tINIT_LIST_HEAD(&per_cpu(softirq_work_list[i], cpu));\n \t}\n \n+\tregister_hotcpu_notifier(&remote_softirq_cpu_notifier);\n+\n \topen_softirq(TASKLET_SOFTIRQ, tasklet_action);\n \topen_softirq(HI_SOFTIRQ, tasklet_hi_action);\n }\n",
    "prefixes": [
        "2/2"
    ]
}