get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806917,
    "url": "http://patchwork.ozlabs.org/api/patches/806917/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1503972142-289376-9-git-send-email-pasha.tatashin@oracle.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": "<1503972142-289376-9-git-send-email-pasha.tatashin@oracle.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1503972142-289376-9-git-send-email-pasha.tatashin@oracle.com/",
    "date": "2017-08-29T02:02:19",
    "name": "[v7,08/11] mm: zero reserved and unavailable struct pages",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "4326ea5f7ac0c7be26d9eec03fdc9a9dadac7eee",
    "submitter": {
        "id": 71010,
        "url": "http://patchwork.ozlabs.org/api/people/71010/?format=api",
        "name": "Pavel Tatashin",
        "email": "pasha.tatashin@oracle.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1503972142-289376-9-git-send-email-pasha.tatashin@oracle.com/mbox/",
    "series": [
        {
            "id": 286,
            "url": "http://patchwork.ozlabs.org/api/series/286/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=286",
            "date": "2017-08-29T02:02:21",
            "name": "complete deferred page initialization",
            "version": 7,
            "mbox": "http://patchwork.ozlabs.org/series/286/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806917/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806917/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 [103.22.144.68])\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 3xhC2b0TClz9s75\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 12:17:27 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhC2Z6DFFzDqGh\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 12:17:26 +1000 (AEST)",
            "from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xhBkp46Y2zDqM0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 29 Aug 2017 12:03:46 +1000 (AEST)",
            "from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74])\n\tby aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v7T22clB011065\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:39 GMT",
            "from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])\n\tby userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv7T22bZs005359\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:38 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\tv7T22aOG010266; Tue, 29 Aug 2017 02:02:36 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:36 -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, willy@infradead.org, \n\tmhocko@kernel.org, ard.biesheuvel@linaro.org, will.deacon@arm.com,\n\tcatalin.marinas@arm.com, sam@ravnborg.org, mgorman@techsingularity.net,\n\tSteven.Sistare@oracle.com, daniel.m.jordan@oracle.com,\n\tbob.picco@oracle.com",
        "Subject": "[PATCH v7 08/11] mm: zero reserved and unavailable struct pages",
        "Date": "Mon, 28 Aug 2017 22:02:19 -0400",
        "Message-Id": "<1503972142-289376-9-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": "userv0022.oracle.com [156.151.31.74]",
        "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>",
        "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": "Some memory is reserved but unavailable: not present in memblock.memory\n(because not backed by physical pages), but present in memblock.reserved.\nSuch memory has backing struct pages, but they are not initialized by going\nthrough __init_single_page().\n\nIn some cases these struct pages are accessed even if they do not contain\nany data. One example is page_to_pfn() might access page->flags if this is\nwhere section information is stored (CONFIG_SPARSEMEM,\nSECTION_IN_PAGE_FLAGS).\n\nSince, struct pages are zeroed in __init_single_page(), and not during\nallocation time, we must zero such struct pages explicitly.\n\nThe patch involves adding a new memblock iterator:\n\tfor_each_resv_unavail_range(i, p_start, p_end)\n\nWhich iterates through reserved && !memory lists, and we zero struct pages\nexplicitly by calling mm_zero_struct_page().\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>\n---\n include/linux/memblock.h | 16 ++++++++++++++++\n include/linux/mm.h       |  6 ++++++\n mm/page_alloc.c          | 30 ++++++++++++++++++++++++++++++\n 3 files changed, 52 insertions(+)",
    "diff": "diff --git a/include/linux/memblock.h b/include/linux/memblock.h\nindex bae11c7e7bf3..bdd4268f9323 100644\n--- a/include/linux/memblock.h\n+++ b/include/linux/memblock.h\n@@ -237,6 +237,22 @@ unsigned long memblock_next_valid_pfn(unsigned long pfn, unsigned long max_pfn);\n \tfor_each_mem_range_rev(i, &memblock.memory, &memblock.reserved,\t\\\n \t\t\t       nid, flags, p_start, p_end, p_nid)\n \n+/**\n+ * for_each_resv_unavail_range - iterate through reserved and unavailable memory\n+ * @i: u64 used as loop variable\n+ * @flags: pick from blocks based on memory attributes\n+ * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL\n+ * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL\n+ *\n+ * Walks over unavailabled but reserved (reserved && !memory) areas of memblock.\n+ * Available as soon as memblock is initialized.\n+ * Note: because this memory does not belong to any physical node, flags and\n+ * nid arguments do not make sense and thus not exported as arguments.\n+ */\n+#define for_each_resv_unavail_range(i, p_start, p_end)\t\t\t\\\n+\tfor_each_mem_range(i, &memblock.reserved, &memblock.memory,\t\\\n+\t\t\t   NUMA_NO_NODE, MEMBLOCK_NONE, p_start, p_end, NULL)\n+\n static inline void memblock_set_region_flags(struct memblock_region *r,\n \t\t\t\t\t     unsigned long flags)\n {\ndiff --git a/include/linux/mm.h b/include/linux/mm.h\nindex 183ac5e733db..0a440ff8f226 100644\n--- a/include/linux/mm.h\n+++ b/include/linux/mm.h\n@@ -1968,6 +1968,12 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn,\n \t\t\t\t\tstruct mminit_pfnnid_cache *state);\n #endif\n \n+#ifdef CONFIG_HAVE_MEMBLOCK\n+void zero_resv_unavail(void);\n+#else\n+static inline void __paginginit zero_resv_unavail(void) {}\n+#endif\n+\n extern void set_dma_reserve(unsigned long new_dma_reserve);\n extern void memmap_init_zone(unsigned long, int, unsigned long,\n \t\t\t\tunsigned long, enum memmap_context);\ndiff --git a/mm/page_alloc.c b/mm/page_alloc.c\nindex 4d67fe3dd172..484c16fb5f0d 100644\n--- a/mm/page_alloc.c\n+++ b/mm/page_alloc.c\n@@ -6261,6 +6261,34 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size,\n \tfree_area_init_core(pgdat);\n }\n \n+#ifdef CONFIG_HAVE_MEMBLOCK\n+/*\n+ * Only struct pages that are backed by physical memory are zeroed and\n+ * initialized by going through __init_single_page(). But, there are some\n+ * struct pages which are reserved in memblock allocator and their fields\n+ * may be accessed (for example page_to_pfn() on some configuration accesses\n+ * flags). We must explicitly zero those struct pages.\n+ */\n+void __paginginit zero_resv_unavail(void)\n+{\n+\tphys_addr_t start, end;\n+\tunsigned long pfn;\n+\tu64 i, pgcnt;\n+\n+\t/* Loop through ranges that are reserved, but do not have reported\n+\t * physical memory backing.\n+\t */\n+\tpgcnt = 0;\n+\tfor_each_resv_unavail_range(i, &start, &end) {\n+\t\tfor (pfn = PFN_DOWN(start); pfn < PFN_UP(end); pfn++) {\n+\t\t\tmm_zero_struct_page(pfn_to_page(pfn));\n+\t\t\tpgcnt++;\n+\t\t}\n+\t}\n+\tpr_info(\"Reserved but unavailable: %lld pages\", pgcnt);\n+}\n+#endif /* CONFIG_HAVE_MEMBLOCK */\n+\n #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP\n \n #if MAX_NUMNODES > 1\n@@ -6684,6 +6712,7 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)\n \t\t\tnode_set_state(nid, N_MEMORY);\n \t\tcheck_for_memory(pgdat, nid);\n \t}\n+\tzero_resv_unavail();\n }\n \n static int __init cmdline_parse_core(char *p, unsigned long *core)\n@@ -6847,6 +6876,7 @@ void __init free_area_init(unsigned long *zones_size)\n {\n \tfree_area_init_node(0, zones_size,\n \t\t\t__pa(PAGE_OFFSET) >> PAGE_SHIFT, NULL);\n+\tzero_resv_unavail();\n }\n \n static int page_alloc_cpu_dead(unsigned int cpu)\n",
    "prefixes": [
        "v7",
        "08/11"
    ]
}