Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806904/?format=api
{ "id": 806904, "url": "http://patchwork.ozlabs.org/api/patches/806904/?format=api", "web_url": "http://patchwork.ozlabs.org/project/sparclinux/patch/1503972142-289376-3-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-3-git-send-email-pasha.tatashin@oracle.com>", "list_archive_url": null, "date": "2017-08-29T02:02:13", "name": "[v7,02/11] sparc64/mm: setting fields in deferred pages", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "c41caeb023d58a5b51a7dfd84842eee3a93c21cd", "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-3-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/806904/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806904/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 3xhBn85Bk8z9sRm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 12:05:48 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751319AbdH2CDx (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 28 Aug 2017 22:03:53 -0400", "from aserp1040.oracle.com ([141.146.126.69]:25865 \"EHLO\n\taserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751241AbdH2CDu (ORCPT\n\t<rfc822; sparclinux@vger.kernel.org>); Mon, 28 Aug 2017 22:03:50 -0400", "from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v7T22XfE011013\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:34 GMT", "from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv7T22X2G006868\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:33 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\tv7T22T9x010241; Tue, 29 Aug 2017 02:02:30 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:29 -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 02/11] sparc64/mm: setting fields in deferred pages", "Date": "Mon, 28 Aug 2017 22:02:13 -0400", "Message-Id": "<1503972142-289376-3-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": "userv0021.oracle.com [156.151.31.71]", "Sender": "sparclinux-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<sparclinux.vger.kernel.org>", "X-Mailing-List": "sparclinux@vger.kernel.org" }, "content": "Without deferred struct page feature (CONFIG_DEFERRED_STRUCT_PAGE_INIT),\nflags and other fields in \"struct page\"es are never changed prior to first\ninitializing struct pages by going through __init_single_page().\n\nWith deferred struct page feature enabled there is a case where we set some\nfields prior to initializing:\n\nmem_init() {\n register_page_bootmem_info();\n free_all_bootmem();\n ...\n}\n\nWhen register_page_bootmem_info() is called only non-deferred struct pages\nare initialized. But, this function goes through some reserved pages which\nmight be part of the deferred, and thus are not yet initialized.\n\nmem_init\nregister_page_bootmem_info\nregister_page_bootmem_info_node\n get_page_bootmem\n .. setting fields here ..\n such as: page->freelist = (void *)type;\n\nfree_all_bootmem()\nfree_low_memory_core_early()\n for_each_reserved_mem_region()\n reserve_bootmem_region()\n init_reserved_page() <- Only if this is deferred reserved page\n __init_single_pfn()\n __init_single_page()\n memset(0) <-- Loose the set fields here\n\nWe end-up with similar issue as in the previous patch, where currently we\ndo not observe problem as memory is zeroed. But, if flag asserts are\nchanged we can start hitting issues.\n\nAlso, because in this patch series we will stop zeroing struct page memory\nduring allocation, we must make sure that struct pages are properly\ninitialized prior to using them.\n\nThe deferred-reserved pages are initialized in free_all_bootmem().\nTherefore, the fix is to switch the above calls.\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 arch/sparc/mm/init_64.c | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)", "diff": "diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c\nindex b3020a956b87..12dbba85a2e2 100644\n--- a/arch/sparc/mm/init_64.c\n+++ b/arch/sparc/mm/init_64.c\n@@ -2508,9 +2508,15 @@ void __init mem_init(void)\n {\n \thigh_memory = __va(last_valid_pfn << PAGE_SHIFT);\n \n-\tregister_page_bootmem_info();\n \tfree_all_bootmem();\n \n+\t/* Must be done after boot memory is put on freelist, because here we\n+\t * might set fields in deferred struct pages that have not yet been\n+\t * initialized, and free_all_bootmem() initializes all the reserved\n+\t * deferred pages for us.\n+\t */\n+\tregister_page_bootmem_info();\n+\n \t/*\n \t * Set up the zero page, mark it reserved, so that page count\n \t * is not manipulated when freeing the page from user ptes.\n", "prefixes": [ "v7", "02/11" ] }