Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/396990/?format=api
{ "id": 396990, "url": "http://patchwork.ozlabs.org/api/patches/396990/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/alpine.DEB.2.00.1410061850120.5129@ware.dreamhost.com/", "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": "<alpine.DEB.2.00.1410061850120.5129@ware.dreamhost.com>", "list_archive_url": null, "date": "2014-10-07T01:57:24", "name": "[net] bna: page allocation during interrupts to use a mempool.", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "534741b89c71e399beaa8f9759b5ef490720becb", "submitter": { "id": 64918, "url": "http://patchwork.ozlabs.org/api/people/64918/?format=api", "name": "Eric Wheeler", "email": "netdev@lists.ewheeler.net" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/alpine.DEB.2.00.1410061850120.5129@ware.dreamhost.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/396990/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/396990/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.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id EE3201400B2\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 7 Oct 2014 12:42:09 +1100 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752731AbaJGBmE (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 6 Oct 2014 21:42:04 -0400", "from homie.mail.dreamhost.com ([208.97.132.208]:40241 \"EHLO\n\thomiemail-a60.g.dreamhost.com\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1751213AbaJGBmC (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 6 Oct 2014 21:42:02 -0400", "from homiemail-a60.g.dreamhost.com (localhost [127.0.0.1])\n\tby homiemail-a60.g.dreamhost.com (Postfix) with ESMTP id DEC2B3BC06E; \n\tMon, 6 Oct 2014 18:42:01 -0700 (PDT)", "from ware.dreamhost.com (ware.dreamhost.com [64.111.127.160])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\t(Authenticated sender: ewheeler@ewheeler.net)\n\tby homiemail-a60.g.dreamhost.com (Postfix) with ESMTPSA id\n\t3473D3BC06B; Mon, 6 Oct 2014 18:42:01 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=lists.ewheeler.net; h=date\n\t:from:to:cc:subject:in-reply-to:message-id:references\n\t:mime-version:content-type; s=lists.ewheeler.net; bh=bx0ESXhT6IG\n\t0ASokhR8Wzf52GTM=; b=MCSq0whie2lwKbu0rQSdfj/QyNseK9KHLkJfOyHDAQR\n\tlRo+hBX1fVEMADgLMcCceuymaB1R6ZoLt8eulyhi6HzFKRwPGmb/OL6IDN/QKeTP\n\tLAG71ElN+OfycYnMOmwFXSQCZuhZoX4BO1edDJ6262Qi8zHNFWPijqFH3dTayBCc\n\t=", "Date": "Mon, 6 Oct 2014 18:57:24 -0700 (PDT)", "From": "Eric Wheeler <netdev@lists.ewheeler.net>", "X-X-Sender": "ewheeler@ware.dreamhost.com", "To": "Shahed Shaikh <shahed.shaikh@qlogic.com>", "cc": "Stephen Hemminger <stephen@networkplumber.org>,\n\tnetdev <netdev@vger.kernel.org>, \"rmody@brocade.com\" <rmody@brocade.com>,\n\tRasesh Mody <rasesh.mody@qlogic.com>", "Subject": "[PATCH net] bna: page allocation during interrupts to use a mempool.", "In-Reply-To": "<262CB373A6D1F14F9B81E82F74F77D5A4704FAE7@avmb2.qlogic.org>", "Message-ID": "<alpine.DEB.2.00.1410061850120.5129@ware.dreamhost.com>", "References": "<alpine.DEB.2.00.1409271631530.26069@ware.dreamhost.com>\n\t<20140929092833.6c2cb7e9@urahara>\n\t<262CB373A6D1F14F9B81E82F74F77D5A4704FAE7@avmb2.qlogic.org>", "User-Agent": "Alpine 2.00 (DEB 1167 2008-08-23)", "MIME-Version": "1.0", "Content-Type": "TEXT/PLAIN; format=flowed; charset=US-ASCII", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "This patch fixes an order:2 memory allocation error backtrace by \nguaranteeing that memory is available during simultaneous high memory \npressure and packet rates when using 9k jumbo frames.\n\nTests between two systems (one patched, one not) succeeded with ~1TB of \ndata transferred over DRBD. As expected, the unpatched host gave \nwarn_alloc_failed's, and the patched host worked correctly. This patch \nincreases kernel memory usage by 32 order-2 allocation when this module is \nloaded (512k on x86) which should be negligible on hosts that use 10GbE \ncards.\n\nFixes:\n[<ffffffff8113b17b>] warn_alloc_failed+0xeb/0x150\n[<ffffffff8113e2f0>] __alloc_pages_slowpath+0x4a0/0x7e0\n[<ffffffff8113e8e2>] __alloc_pages_nodemask+0x2b2/0x2c0\n[<ffffffff81181232>] alloc_pages_current+0xb2/0x170\n[<ffffffffa0239cb4>] bnad_rxq_refill_page+0x154/0x1e0 [bna]\n[<ffffffffa023c282>] bnad_cq_process+0x462/0x840 [bna]\n[<ffffffffa023c6af>] bnad_napi_poll_rx+0x4f/0xc0 [bna]\n[<ffffffff814dcf4c>] net_rx_action+0xfc/0x280\n[<ffffffff8105ba83>] __do_softirq+0xf3/0x2c0\n[<ffffffff8105bd5d>] irq_exit+0xbd/0xd0\n[<ffffffff815ae697>] do_IRQ+0x67/0x110\n[<ffffffff815a39ad>] common_interrupt+0x6d/0x6d\n<EOI>\n[<ffffffff81486275>] ? cpuidle_enter_state+0x55/0xd0\n[<ffffffff8148626b>] ? cpuidle_enter_state+0x4b/0xd0\n[<ffffffff814863b7>] cpuidle_idle_call+0xc7/0x160\n[<ffffffff8100d73e>] arch_cpu_idle+0xe/0x30\n[<ffffffff810b187e>] cpu_idle_loop+0x9e/0x250\n[<ffffffff810b1aa0>] cpu_startup_entry+0x70/0x80\n[<ffffffff810350d2>] start_secondary+0xd2/0xe0\n\nSigned-off-by: Eric Wheeler <netdev@lists.ewheeler.net>\n---\n drivers/net/ethernet/brocade/bna/bnad.c | 27 ++++++++++++++++++++++++---\n 1 files changed, 24 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c\nindex 3a77f9e..8906ad1 100644\n--- a/drivers/net/ethernet/brocade/bna/bnad.c\n+++ b/drivers/net/ethernet/brocade/bna/bnad.c\n@@ -26,6 +26,7 @@\n #include <linux/ip.h>\n #include <linux/prefetch.h>\n #include <linux/module.h>\n+#include <linux/mempool.h>\n\n #include \"bnad.h\"\n #include \"bna.h\"\n@@ -58,6 +59,8 @@ static struct mutex bnad_list_mutex;\n static LIST_HEAD(bnad_list);\n static const u8 bnad_bcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};\n\n+static mempool_t *rxq_mempool_o2 = NULL;\n+\n /*\n * Local MACROS\n */\n@@ -321,7 +324,7 @@ bnad_rxq_cleanup_page(struct bnad *bnad, struct bnad_rx_unmap *unmap)\n \tdma_unmap_page(&bnad->pcidev->dev,\n \t\t\tdma_unmap_addr(&unmap->vector, dma_addr),\n \t\t\tunmap->vector.len, DMA_FROM_DEVICE);\n-\tput_page(unmap->page);\n+\tmempool_free(unmap->page, rxq_mempool_o2);\n \tunmap->page = NULL;\n \tdma_unmap_addr_set(&unmap->vector, dma_addr, 0);\n \tunmap->vector.len = 0;\n@@ -380,8 +383,11 @@ bnad_rxq_refill_page(struct bnad *bnad, struct bna_rcb *rcb, u32 nalloc)\n \t\tunmap = &unmap_q->unmap[prod];\n\n \t\tif (unmap_q->reuse_pi < 0) {\n-\t\t\tpage = alloc_pages(GFP_ATOMIC | __GFP_COMP,\n-\t\t\t\t\tunmap_q->alloc_order);\n+\t\t\tif (unmap_q->alloc_order == 2)\n+\t\t\t\tpage = mempool_alloc(rxq_mempool_o2, GFP_ATOMIC | __GFP_COMP);\n+\t\t\telse\n+\t\t\t\tpage = alloc_pages(GFP_ATOMIC | __GFP_COMP,\n+\t\t\t\t\t\tunmap_q->alloc_order);\n \t\t\tpage_offset = 0;\n \t\t} else {\n \t\t\tprev = &unmap_q->unmap[unmap_q->reuse_pi];\n@@ -3861,6 +3867,16 @@ static struct pci_driver bnad_pci_driver = {\n \t.remove = bnad_pci_remove,\n };\n\n+void *bnad_rxq_mempool_alloc_o2(gfp_t gfp_mask, void *pool_data)\n+{\n+\treturn (void*) alloc_pages(gfp_mask, 2);\n+}\n+\n+void bnad_rxq_mempool_free_o2(void *page, void *pool_data)\n+{\n+\tput_page((struct page*)page);\n+}\n+\n static int __init\n bnad_module_init(void)\n {\n@@ -3878,6 +3894,10 @@ bnad_module_init(void)\n \t\treturn err;\n \t}\n\n+\trxq_mempool_o2 = mempool_create(32, /* how many do we really need? */\n+\t\tbnad_rxq_mempool_alloc_o2,\n+\t\tbnad_rxq_mempool_free_o2, NULL);\n+\n \treturn 0;\n }\n\n@@ -3886,6 +3906,7 @@ bnad_module_exit(void)\n {\n \tpci_unregister_driver(&bnad_pci_driver);\n \trelease_firmware(bfi_fw);\n+\tmempool_destroy(rxq_mempool_o2);\n }\n\n module_init(bnad_module_init);\n", "prefixes": [ "net" ] }