get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806899,
    "url": "http://patchwork.ozlabs.org/api/patches/806899/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/sparclinux/patch/1503972142-289376-6-git-send-email-pasha.tatashin@oracle.com/",
    "project": {
        "id": 10,
        "url": "http://patchwork.ozlabs.org/api/projects/10/?format=api",
        "name": "Linux SPARC Development ",
        "link_name": "sparclinux",
        "list_id": "sparclinux.vger.kernel.org",
        "list_email": "sparclinux@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1503972142-289376-6-git-send-email-pasha.tatashin@oracle.com>",
    "list_archive_url": null,
    "date": "2017-08-29T02:02:16",
    "name": "[v7,05/11] mm: defining memblock_virt_alloc_try_nid_raw",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "b4dd9e0d4397ed0840ea02ddd2d0c312acc9305e",
    "submitter": {
        "id": 71010,
        "url": "http://patchwork.ozlabs.org/api/people/71010/?format=api",
        "name": "Pavel Tatashin",
        "email": "pasha.tatashin@oracle.com"
    },
    "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/sparclinux/patch/1503972142-289376-6-git-send-email-pasha.tatashin@oracle.com/mbox/",
    "series": [
        {
            "id": 285,
            "url": "http://patchwork.ozlabs.org/api/series/285/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/sparclinux/list/?series=285",
            "date": "2017-08-29T02:02:11",
            "name": "complete deferred page initialization",
            "version": 7,
            "mbox": "http://patchwork.ozlabs.org/series/285/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806899/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806899/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<sparclinux-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=sparclinux-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xhBlw09Gkz9sRV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 12:04:44 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751532AbdH2CEO (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 28 Aug 2017 22:04:14 -0400",
            "from userp1040.oracle.com ([156.151.31.81]:44663 \"EHLO\n\tuserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751493AbdH2CEN (ORCPT\n\t<rfc822; sparclinux@vger.kernel.org>); Mon, 28 Aug 2017 22:04:13 -0400",
            "from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2)\n\twith ESMTP id v7T22Y8X022416\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:35 GMT",
            "from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])\n\tby aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv7T22YAV015973\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:34 GMT",
            "from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17])\n\tby aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv7T22XFD010250; Tue, 29 Aug 2017 02:02:33 GMT",
            "from ca-ldom-ol-build-1.us.oracle.com (/10.129.68.23)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Mon, 28 Aug 2017 19:02:33 -0700"
        ],
        "From": "Pavel Tatashin <pasha.tatashin@oracle.com>",
        "To": "linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,\n\tlinux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org,\n\tlinux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tx86@kernel.org, kasan-dev@googlegroups.com, borntraeger@de.ibm.com,\n\theiko.carstens@de.ibm.com, davem@davemloft.net,\n\twilly@infradead.org, mhocko@kernel.org, ard.biesheuvel@linaro.org,\n\twill.deacon@arm.com, catalin.marinas@arm.com, sam@ravnborg.org,\n\tmgorman@techsingularity.net, Steven.Sistare@oracle.com,\n\tdaniel.m.jordan@oracle.com, bob.picco@oracle.com",
        "Subject": "[PATCH v7 05/11] mm: defining memblock_virt_alloc_try_nid_raw",
        "Date": "Mon, 28 Aug 2017 22:02:16 -0400",
        "Message-Id": "<1503972142-289376-6-git-send-email-pasha.tatashin@oracle.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<1503972142-289376-1-git-send-email-pasha.tatashin@oracle.com>",
        "References": "<1503972142-289376-1-git-send-email-pasha.tatashin@oracle.com>",
        "X-Source-IP": "aserv0022.oracle.com [141.146.126.234]",
        "Sender": "sparclinux-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<sparclinux.vger.kernel.org>",
        "X-Mailing-List": "sparclinux@vger.kernel.org"
    },
    "content": "* A new variant of memblock_virt_alloc_* allocations:\nmemblock_virt_alloc_try_nid_raw()\n    - Does not zero the allocated memory\n    - Does not panic if request cannot be satisfied\n\n* optimize early system hash allocations\n\nClients can call alloc_large_system_hash() with flag: HASH_ZERO to specify\nthat memory that was allocated for system hash needs to be zeroed,\notherwise the memory does not need to be zeroed, and client will initialize\nit.\n\nIf memory does not need to be zero'd, call the new\nmemblock_virt_alloc_raw() interface, and thus improve the boot performance.\n\n* debug for raw alloctor\n\nWhen CONFIG_DEBUG_VM is enabled, this patch sets all the memory that is\nreturned by memblock_virt_alloc_try_nid_raw() to ones to ensure that no\nplaces excpect zeroed memory.\n\nSigned-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>\nReviewed-by: Steven Sistare <steven.sistare@oracle.com>\nReviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>\nReviewed-by: Bob Picco <bob.picco@oracle.com>\nAcked-by: Michal Hocko <mhocko@suse.com>\n---\n include/linux/bootmem.h | 27 ++++++++++++++++++++++\n mm/memblock.c           | 60 +++++++++++++++++++++++++++++++++++++++++++------\n mm/page_alloc.c         | 15 ++++++-------\n 3 files changed, 87 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h\nindex e223d91b6439..ea30b3987282 100644\n--- a/include/linux/bootmem.h\n+++ b/include/linux/bootmem.h\n@@ -160,6 +160,9 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,\n #define BOOTMEM_ALLOC_ANYWHERE\t\t(~(phys_addr_t)0)\n \n /* FIXME: Move to memblock.h at a point where we remove nobootmem.c */\n+void *memblock_virt_alloc_try_nid_raw(phys_addr_t size, phys_addr_t align,\n+\t\t\t\t      phys_addr_t min_addr,\n+\t\t\t\t      phys_addr_t max_addr, int nid);\n void *memblock_virt_alloc_try_nid_nopanic(phys_addr_t size,\n \t\tphys_addr_t align, phys_addr_t min_addr,\n \t\tphys_addr_t max_addr, int nid);\n@@ -176,6 +179,14 @@ static inline void * __init memblock_virt_alloc(\n \t\t\t\t\t    NUMA_NO_NODE);\n }\n \n+static inline void * __init memblock_virt_alloc_raw(\n+\t\t\t\t\tphys_addr_t size,  phys_addr_t align)\n+{\n+\treturn memblock_virt_alloc_try_nid_raw(size, align, BOOTMEM_LOW_LIMIT,\n+\t\t\t\t\t    BOOTMEM_ALLOC_ACCESSIBLE,\n+\t\t\t\t\t    NUMA_NO_NODE);\n+}\n+\n static inline void * __init memblock_virt_alloc_nopanic(\n \t\t\t\t\tphys_addr_t size, phys_addr_t align)\n {\n@@ -257,6 +268,14 @@ static inline void * __init memblock_virt_alloc(\n \treturn __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT);\n }\n \n+static inline void * __init memblock_virt_alloc_raw(\n+\t\t\t\t\tphys_addr_t size,  phys_addr_t align)\n+{\n+\tif (!align)\n+\t\talign = SMP_CACHE_BYTES;\n+\treturn __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT);\n+}\n+\n static inline void * __init memblock_virt_alloc_nopanic(\n \t\t\t\t\tphys_addr_t size, phys_addr_t align)\n {\n@@ -309,6 +328,14 @@ static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size,\n \t\t\t\t\t  min_addr);\n }\n \n+static inline void * __init memblock_virt_alloc_try_nid_raw(\n+\t\t\tphys_addr_t size, phys_addr_t align,\n+\t\t\tphys_addr_t min_addr, phys_addr_t max_addr, int nid)\n+{\n+\treturn ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align,\n+\t\t\t\tmin_addr, max_addr);\n+}\n+\n static inline void * __init memblock_virt_alloc_try_nid_nopanic(\n \t\t\tphys_addr_t size, phys_addr_t align,\n \t\t\tphys_addr_t min_addr, phys_addr_t max_addr, int nid)\ndiff --git a/mm/memblock.c b/mm/memblock.c\nindex 91205780e6b1..1f299fb1eb08 100644\n--- a/mm/memblock.c\n+++ b/mm/memblock.c\n@@ -1327,7 +1327,6 @@ static void * __init memblock_virt_alloc_internal(\n \treturn NULL;\n done:\n \tptr = phys_to_virt(alloc);\n-\tmemset(ptr, 0, size);\n \n \t/*\n \t * The min_count is set to 0 so that bootmem allocated blocks\n@@ -1340,6 +1339,45 @@ static void * __init memblock_virt_alloc_internal(\n \treturn ptr;\n }\n \n+/**\n+ * memblock_virt_alloc_try_nid_raw - allocate boot memory block without zeroing\n+ * memory and without panicking\n+ * @size: size of memory block to be allocated in bytes\n+ * @align: alignment of the region and block's size\n+ * @min_addr: the lower bound of the memory region from where the allocation\n+ *\t  is preferred (phys address)\n+ * @max_addr: the upper bound of the memory region from where the allocation\n+ *\t      is preferred (phys address), or %BOOTMEM_ALLOC_ACCESSIBLE to\n+ *\t      allocate only from memory limited by memblock.current_limit value\n+ * @nid: nid of the free area to find, %NUMA_NO_NODE for any node\n+ *\n+ * Public function, provides additional debug information (including caller\n+ * info), if enabled. Does not zero allocated memory, does not panic if request\n+ * cannot be satisfied.\n+ *\n+ * RETURNS:\n+ * Virtual address of allocated memory block on success, NULL on failure.\n+ */\n+void * __init memblock_virt_alloc_try_nid_raw(\n+\t\t\tphys_addr_t size, phys_addr_t align,\n+\t\t\tphys_addr_t min_addr, phys_addr_t max_addr,\n+\t\t\tint nid)\n+{\n+\tvoid *ptr;\n+\n+\tmemblock_dbg(\"%s: %llu bytes align=0x%llx nid=%d from=0x%llx max_addr=0x%llx %pF\\n\",\n+\t\t     __func__, (u64)size, (u64)align, nid, (u64)min_addr,\n+\t\t     (u64)max_addr, (void *)_RET_IP_);\n+\n+\tptr = memblock_virt_alloc_internal(size, align,\n+\t\t\t\t\t   min_addr, max_addr, nid);\n+#ifdef CONFIG_DEBUG_VM\n+\tif (ptr && size > 0)\n+\t\tmemset(ptr, 0xff, size);\n+#endif\n+\treturn ptr;\n+}\n+\n /**\n  * memblock_virt_alloc_try_nid_nopanic - allocate boot memory block\n  * @size: size of memory block to be allocated in bytes\n@@ -1351,8 +1389,8 @@ static void * __init memblock_virt_alloc_internal(\n  *\t      allocate only from memory limited by memblock.current_limit value\n  * @nid: nid of the free area to find, %NUMA_NO_NODE for any node\n  *\n- * Public version of _memblock_virt_alloc_try_nid_nopanic() which provides\n- * additional debug information (including caller info), if enabled.\n+ * Public function, provides additional debug information (including caller\n+ * info), if enabled. This function zeroes the allocated memory.\n  *\n  * RETURNS:\n  * Virtual address of allocated memory block on success, NULL on failure.\n@@ -1362,11 +1400,17 @@ void * __init memblock_virt_alloc_try_nid_nopanic(\n \t\t\t\tphys_addr_t min_addr, phys_addr_t max_addr,\n \t\t\t\tint nid)\n {\n+\tvoid *ptr;\n+\n \tmemblock_dbg(\"%s: %llu bytes align=0x%llx nid=%d from=0x%llx max_addr=0x%llx %pF\\n\",\n \t\t     __func__, (u64)size, (u64)align, nid, (u64)min_addr,\n \t\t     (u64)max_addr, (void *)_RET_IP_);\n-\treturn memblock_virt_alloc_internal(size, align, min_addr,\n-\t\t\t\t\t     max_addr, nid);\n+\n+\tptr = memblock_virt_alloc_internal(size, align,\n+\t\t\t\t\t   min_addr, max_addr, nid);\n+\tif (ptr)\n+\t\tmemset(ptr, 0, size);\n+\treturn ptr;\n }\n \n /**\n@@ -1380,7 +1424,7 @@ void * __init memblock_virt_alloc_try_nid_nopanic(\n  *\t      allocate only from memory limited by memblock.current_limit value\n  * @nid: nid of the free area to find, %NUMA_NO_NODE for any node\n  *\n- * Public panicking version of _memblock_virt_alloc_try_nid_nopanic()\n+ * Public panicking version of memblock_virt_alloc_try_nid_nopanic()\n  * which provides debug information (including caller info), if enabled,\n  * and panics if the request can not be satisfied.\n  *\n@@ -1399,8 +1443,10 @@ void * __init memblock_virt_alloc_try_nid(\n \t\t     (u64)max_addr, (void *)_RET_IP_);\n \tptr = memblock_virt_alloc_internal(size, align,\n \t\t\t\t\t   min_addr, max_addr, nid);\n-\tif (ptr)\n+\tif (ptr) {\n+\t\tmemset(ptr, 0, size);\n \t\treturn ptr;\n+\t}\n \n \tpanic(\"%s: Failed to allocate %llu bytes align=0x%llx nid=%d from=0x%llx max_addr=0x%llx\\n\",\n \t      __func__, (u64)size, (u64)align, nid, (u64)min_addr,\ndiff --git a/mm/page_alloc.c b/mm/page_alloc.c\nindex c170ac569aec..8293815ca85d 100644\n--- a/mm/page_alloc.c\n+++ b/mm/page_alloc.c\n@@ -7356,18 +7356,17 @@ void *__init alloc_large_system_hash(const char *tablename,\n \n \tlog2qty = ilog2(numentries);\n \n-\t/*\n-\t * memblock allocator returns zeroed memory already, so HASH_ZERO is\n-\t * currently not used when HASH_EARLY is specified.\n-\t */\n \tgfp_flags = (flags & HASH_ZERO) ? GFP_ATOMIC | __GFP_ZERO : GFP_ATOMIC;\n \tdo {\n \t\tsize = bucketsize << log2qty;\n-\t\tif (flags & HASH_EARLY)\n-\t\t\ttable = memblock_virt_alloc_nopanic(size, 0);\n-\t\telse if (hashdist)\n+\t\tif (flags & HASH_EARLY) {\n+\t\t\tif (flags & HASH_ZERO)\n+\t\t\t\ttable = memblock_virt_alloc_nopanic(size, 0);\n+\t\t\telse\n+\t\t\t\ttable = memblock_virt_alloc_raw(size, 0);\n+\t\t} else if (hashdist) {\n \t\t\ttable = __vmalloc(size, gfp_flags, PAGE_KERNEL);\n-\t\telse {\n+\t\t} else {\n \t\t\t/*\n \t\t\t * If bucketsize is not a power-of-two, we may free\n \t\t\t * some pages at the end of hash table which\n",
    "prefixes": [
        "v7",
        "05/11"
    ]
}