get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 711972,
    "url": "http://patchwork.ozlabs.org/api/patches/711972/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170106160654.1501.10742.stgit@localhost.localdomain/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170106160654.1501.10742.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2017-01-06T16:06:56",
    "name": "[next,04/11] ixgbe: Update code to better handle incrementing page count",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c92fa050486474399759cbb3320291f4ffc3fe45",
    "submitter": {
        "id": 252,
        "url": "http://patchwork.ozlabs.org/api/people/252/?format=api",
        "name": "Alexander Duyck",
        "email": "alexander.duyck@gmail.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170106160654.1501.10742.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/711972/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/711972/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3tw8ZG5thdz9sfH\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  7 Jan 2017 03:07:02 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 572D585982;\n\tFri,  6 Jan 2017 16:07:01 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id US+906kgUh2w; Fri,  6 Jan 2017 16:07:00 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 0C51485A4E;\n\tFri,  6 Jan 2017 16:07:00 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id BA97C1BFA57\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:06:58 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id B3B8889423\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:06:58 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id zRhhPmOx5jAL for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:06:58 +0000 (UTC)",
            "from mail-pf0-f195.google.com (mail-pf0-f195.google.com\n\t[209.85.192.195])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 25F8F87F55\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  6 Jan 2017 16:06:58 +0000 (UTC)",
            "by mail-pf0-f195.google.com with SMTP id f144so1225442pfa.2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 06 Jan 2017 08:06:58 -0800 (PST)",
            "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\tw25sm108075000pge.26.2017.01.06.08.06.57\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 06 Jan 2017 08:06:57 -0800 (PST)"
        ],
        "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=\"nVzJRk7A\"; dkim-atps=neutral",
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-transfer-encoding;\n\tbh=EB92bJ9EOudIzzs2h5Z8/IXVRZOLG5hHaHQlFoz4MIk=;\n\tb=nVzJRk7AsaHKtJVxB7b3gjIa9Wt9j01yU5jVPP8EnrgaLGx1fC0OD6Xbf74A/ajLaY\n\tgXBoE0FQRQdldmTYamGQ5ygyck98q4ymDyqTQXGNjOjh29HT6Y81ELKA6Up28pvzen0n\n\tuDl0ySlsTeN4kzivXpM3W+LWTDSajj1wgyEHCWium7dbvF2t66WopdYMelf5RQQjyE3b\n\t5IL1byzOLteR1e/axo7J/+uvBthbhXiNUa3dTcNIOuCw6Giu3CFoaEuT3exUKhstDgxM\n\t7rsz1aojYYcYi+TbhG1JbdPjPtz0PPF5L9yTM0oOVfatZLilysOR3E9MEXGLh4+cN9So\n\t6H5Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-transfer-encoding;\n\tbh=EB92bJ9EOudIzzs2h5Z8/IXVRZOLG5hHaHQlFoz4MIk=;\n\tb=lZhascEblc5LPm43vIATydbhm3HP2ZlqSG5wlSUSavgdgcbiIeKCn1Ijtqbo51rs14\n\tcQqOhIGrBsNEBHWAp4t4QzIfxlJxAcWcQrZuvbSWb9aHmAGZZX0Cgff2TuxJ/70JDUV7\n\trs42yhe1ipsg7xk1LfQ60wqucPO/o4bQBZRhA5vg2wCtQzviJgyhkI98Z0OGV0ts6WGT\n\tYoTjeErHN+E90vXPiDZCzqtL6WE1VRVFDcZCPLZWhd0GAWS5X4q9zysjW/uF8RRluOMf\n\tYFPDytgjOEi7lPOPPsdpZxwvWsINpS0vcw+YlP4XQgtVh6kaYJ2E3CyhJBvyfE41g40n\n\tMxLg==",
        "X-Gm-Message-State": "AIkVDXKr1dhiDuch3/BpiH5/mSLm2x0ArgEbGm3HLQJ3jX2pSXiHnlhh7pqT0u6cqk0CBw==",
        "X-Received": "by 10.84.138.3 with SMTP id 3mr168949082plo.108.1483718817795;\n\tFri, 06 Jan 2017 08:06:57 -0800 (PST)",
        "From": "Alexander Duyck <alexander.duyck@gmail.com>",
        "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com",
        "Date": "Fri, 06 Jan 2017 08:06:56 -0800",
        "Message-ID": "<20170106160654.1501.10742.stgit@localhost.localdomain>",
        "In-Reply-To": "<20170106155448.1501.31298.stgit@localhost.localdomain>",
        "References": "<20170106155448.1501.31298.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Cc": "netdev@vger.kernel.org",
        "Subject": "[Intel-wired-lan] [next PATCH 04/11] ixgbe: Update code to better\n\thandle incrementing page count",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: Alexander Duyck <alexander.h.duyck@intel.com>\n\nBatch the page count updates instead of doing them one at a time.  By doing\nthis we can improve the overall performance as the atomic increment\noperations can be expensive due to the fact that on x86 they are locked\noperations which can cause stalls.  By doing bulk updates we can\nconsolidate the stall which should help to improve the overall receive\nperformance.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h      |    7 ++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   39 ++++++++++++++++---------\n 2 files changed, 31 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 97e74deecae2..717c65b0deb2 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -198,7 +198,12 @@ struct ixgbe_rx_buffer {\n \tstruct sk_buff *skb;\n \tdma_addr_t dma;\n \tstruct page *page;\n-\tunsigned int page_offset;\n+#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)\n+\t__u32 page_offset;\n+#else\n+\t__u16 page_offset;\n+#endif\n+\t__u16 pagecnt_bias;\n };\n \n struct ixgbe_queue_stats {\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 062b984ffdf4..519b6a2b65c1 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -1602,6 +1602,7 @@ static bool ixgbe_alloc_mapped_page(struct ixgbe_ring *rx_ring,\n \tbi->dma = dma;\n \tbi->page = page;\n \tbi->page_offset = 0;\n+\tbi->pagecnt_bias = 1;\n \n \treturn true;\n }\n@@ -1959,13 +1960,15 @@ static bool ixgbe_can_reuse_rx_page(struct ixgbe_rx_buffer *rx_buffer,\n \tunsigned int last_offset = ixgbe_rx_pg_size(rx_ring) -\n \t\t\t\t   ixgbe_rx_bufsz(rx_ring);\n #endif\n+\tunsigned int pagecnt_bias = rx_buffer->pagecnt_bias--;\n+\n \t/* avoid re-using remote pages */\n \tif (unlikely(ixgbe_page_is_reserved(page)))\n \t\treturn false;\n \n #if (PAGE_SIZE < 8192)\n \t/* if we are only owner of page we can reuse it */\n-\tif (unlikely(page_count(page) != 1))\n+\tif (unlikely(page_count(page) != pagecnt_bias))\n \t\treturn false;\n \n \t/* flip page offset to other buffer */\n@@ -1978,10 +1981,14 @@ static bool ixgbe_can_reuse_rx_page(struct ixgbe_rx_buffer *rx_buffer,\n \t\treturn false;\n #endif\n \n-\t/* Even if we own the page, we are not allowed to use atomic_set()\n-\t * This would break get_page_unless_zero() users.\n+\t/* If we have drained the page fragment pool we need to update\n+\t * the pagecnt_bias and page count so that we fully restock the\n+\t * number of references the driver holds.\n \t */\n-\tpage_ref_inc(page);\n+\tif (unlikely(pagecnt_bias == 1)) {\n+\t\tpage_ref_add(page, USHRT_MAX);\n+\t\trx_buffer->pagecnt_bias = USHRT_MAX;\n+\t}\n \n \treturn true;\n }\n@@ -2025,7 +2032,6 @@ static bool ixgbe_add_rx_frag(struct ixgbe_ring *rx_ring,\n \t\t\treturn true;\n \n \t\t/* this page cannot be reused so discard it */\n-\t\t__free_pages(page, ixgbe_rx_pg_order(rx_ring));\n \t\treturn false;\n \t}\n \n@@ -2104,15 +2110,19 @@ static struct sk_buff *ixgbe_fetch_rx_buffer(struct ixgbe_ring *rx_ring,\n \tif (ixgbe_add_rx_frag(rx_ring, rx_buffer, size, skb)) {\n \t\t/* hand second half of page back to the ring */\n \t\tixgbe_reuse_rx_page(rx_ring, rx_buffer);\n-\t} else if (IXGBE_CB(skb)->dma == rx_buffer->dma) {\n-\t\t/* the page has been released from the ring */\n-\t\tIXGBE_CB(skb)->page_released = true;\n \t} else {\n-\t\t/* we are not reusing the buffer so unmap it */\n-\t\tdma_unmap_page_attrs(rx_ring->dev, rx_buffer->dma,\n-\t\t\t\t     ixgbe_rx_pg_size(rx_ring),\n-\t\t\t\t     DMA_FROM_DEVICE,\n-\t\t\t\t     IXGBE_RX_DMA_ATTR);\n+\t\tif (IXGBE_CB(skb)->dma == rx_buffer->dma) {\n+\t\t\t/* the page has been released from the ring */\n+\t\t\tIXGBE_CB(skb)->page_released = true;\n+\t\t} else {\n+\t\t\t/* we are not reusing the buffer so unmap it */\n+\t\t\tdma_unmap_page_attrs(rx_ring->dev, rx_buffer->dma,\n+\t\t\t\t\t     ixgbe_rx_pg_size(rx_ring),\n+\t\t\t\t\t     DMA_FROM_DEVICE,\n+\t\t\t\t\t     IXGBE_RX_DMA_ATTR);\n+\t\t}\n+\t\t__page_frag_cache_drain(page,\n+\t\t\t\t\trx_buffer->pagecnt_bias);\n \t}\n \n \t/* clear contents of buffer_info */\n@@ -4972,7 +4982,8 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)\n \t\t\t\t     ixgbe_rx_pg_size(rx_ring),\n \t\t\t\t     DMA_FROM_DEVICE,\n \t\t\t\t     IXGBE_RX_DMA_ATTR);\n-\t\t__free_pages(rx_buffer->page, ixgbe_rx_pg_order(rx_ring));\n+\t\t__page_frag_cache_drain(rx_buffer->page,\n+\t\t\t\t\trx_buffer->pagecnt_bias);\n \n \t\trx_buffer->page = NULL;\n \t}\n",
    "prefixes": [
        "next",
        "04/11"
    ]
}