{"id":806912,"url":"http://patchwork.ozlabs.org/api/1.0/covers/806912/?format=json","project":{"id":19,"url":"http://patchwork.ozlabs.org/api/1.0/projects/19/?format=json","name":"Linux IMX development","link_name":"linux-imx","list_id":"linux-imx-kernel.lists.patchwork.ozlabs.org","list_email":"linux-imx-kernel@lists.patchwork.ozlabs.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<1503972142-289376-1-git-send-email-pasha.tatashin@oracle.com>","date":"2017-08-29T02:02:11","name":"[v7,00/11] complete deferred page initialization","submitter":{"id":71010,"url":"http://patchwork.ozlabs.org/api/1.0/people/71010/?format=json","name":"Pavel Tatashin","email":"pasha.tatashin@oracle.com"},"series":[{"id":287,"url":"http://patchwork.ozlabs.org/api/1.0/series/287/?format=json","date":"2017-08-29T02:02:11","name":"complete deferred page initialization","version":7,"mbox":"http://patchwork.ozlabs.org/series/287/mbox/"}],"headers":{"Return-Path":"<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming-imx@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming-imx@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"dd/uIeET\"; dkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhBsk1KwTz9s1h\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 12:09:46 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dmVyG-00059b-Gn; Tue, 29 Aug 2017 02:09:40 +0000","from aserp1040.oracle.com ([141.146.126.69])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dmVsL-0000mr-6e for linux-arm-kernel@lists.infradead.org;\n\tTue, 29 Aug 2017 02:03:38 +0000","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 v7T22Wnd011004\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:32 GMT","from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv7T22UQb006675\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:31 GMT","from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17])\n\tby aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id\n\tv7T22RdV011290; Tue, 29 Aug 2017 02:02:27 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:27 -0700"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help:\n\tList-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:\n\tFrom:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=JH0SVYKMB1H7IR8l3C79XC5q6IB8gZaHWn+Z7dJiuMc=;\n\tb=dd/uIeETg2xIJv\n\tlH3ztWMNz0+wHngKGRw9mGTbKRpm7PFrW7Fa9sO7KVuv6Og8xc09YDS+r6lovOCJeMO7KcvAfbsfq\n\tHS/WOxdu8mYySafuQN/Yj+2ODzp6HRtZFJqu28AReO3U4F6olbu5QyJOzYpdaGwcI63bVMtZ5nUhg\n\tHI7U/oaaZrzMSF+RrGsgGFqkEflXo+yDRfjnYCWKciBjSsSm+wnWRvfKcIcD9KPivIv4gjeYI7HDF\n\t48mkhm2zqInuy3umM+yrm2y+cWoesVnsc7z89jtyjj1PXM9sJVLjfpnAKbp4Xo4CqVDZnfEMwuwAF\n\tuHS2cn5CGbs4n42MohAA==;","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 00/11] complete deferred page initialization","Date":"Mon, 28 Aug 2017 22:02:11 -0400","Message-Id":"<1503972142-289376-1-git-send-email-pasha.tatashin@oracle.com>","X-Mailer":"git-send-email 1.7.1","X-Source-IP":"userv0021.oracle.com [156.151.31.71]","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170828_190333_538256_3FBC23E1 ","X-CRM114-Status":"UNSURE (   9.69  )","X-CRM114-Notice":"Please train this message.","X-Spam-Score":"-4.2 (----)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-4.2 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\n\tmedium trust [141.146.126.69 listed in list.dnswl.org]\n\t-0.0 RCVD_IN_MSPIKE_H4      RBL: Very Good reputation (+4)\n\t[141.146.126.69 listed in wl.mailspike.net]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders\n\t0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay\n\tlines","X-BeenThere":"linux-arm-kernel@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-arm-kernel/>","List-Post":"<mailto:linux-arm-kernel@lists.infradead.org>","List-Help":"<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>","Errors-To":"linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org","List-Id":"linux-imx-kernel.lists.patchwork.ozlabs.org"},"content":"Changelog:\nv7 - v6\n- Addressed comments from Michal Hocko\n- memblock_discard() patch was removed from this series and integrated\n  separately\n- Fixed bug reported by kbuild test robot new patch:\n  mm: zero reserved and unavailable struct pages\n- Removed patch\n  x86/mm: reserve only exiting low pages\n  As, it is not needed anymore, because of the previous fix\n- Re-wrote deferred_init_memmap(), found and fixed an existing bug, where\n  page variable is not reset when zone holes present.\n- Merged several patches together per Michal request\n- Added performance data including raw logs\n\nv6 - v5\n- Fixed ARM64 + kasan code, as reported by Ard Biesheuvel\n- Tested ARM64 code in qemu and found few more issues, that I fixed in this\n  iteration\n- Added page roundup/rounddown to x86 and arm zeroing routines to zero the\n  whole allocated range, instead of only provided address range.\n- Addressed SPARC related comment from Sam Ravnborg\n- Fixed section mismatch warnings related to memblock_discard().\n\nv5 - v4\n- Fixed build issues reported by kbuild on various configurations\n\nv4 - v3\n- Rewrote code to zero sturct pages in __init_single_page() as\n  suggested by Michal Hocko\n- Added code to handle issues related to accessing struct page\n  memory before they are initialized.\n\nv3 - v2\n- Addressed David Miller comments about one change per patch:\n    * Splited changes to platforms into 4 patches\n    * Made \"do not zero vmemmap_buf\" as a separate patch\n\nv2 - v1\n- Per request, added s390 to deferred \"struct page\" zeroing\n- Collected performance data on x86 which proofs the importance to\n  keep memset() as prefetch (see below).\n\nSMP machines can benefit from the DEFERRED_STRUCT_PAGE_INIT config option,\nwhich defers initializing struct pages until all cpus have been started so\nit can be done in parallel.\n\nHowever, this feature is sub-optimal, because the deferred page\ninitialization code expects that the struct pages have already been zeroed,\nand the zeroing is done early in boot with a single thread only.  Also, we\naccess that memory and set flags before struct pages are initialized. All\nof this is fixed in this patchset.\n\nIn this work we do the following:\n- Never read access struct page until it was initialized\n- Never set any fields in struct pages before they are initialized\n- Zero struct page at the beginning of struct page initialization\n\n\n==========================================================================\nPerformance improvements on x86 machine with 8 nodes:\nIntel(R) Xeon(R) CPU E7-8895 v3 @ 2.60GHz and 1T of memory:\n                        TIME          SPEED UP\nbase no deferred:       95.796233s\nfix no deferred:        79.978956s    19.77%\n\nbase deferred:          77.254713s\nfix deferred:           55.050509s    40.34%\n==========================================================================\nSPARC M6 3600 MHz with 15T of memory\n                        TIME          SPEED UP\nbase no deferred:       358.335727s\nfix no deferred:        302.320936s   18.52%\n\nbase deferred:          237.534603s\nfix deferred:           182.103003s   30.44%\n==========================================================================\nRaw dmesg output with timestamps:\nx86 base no deferred:    https://hastebin.com/ofunepurit.scala\nx86 base deferred:       https://hastebin.com/ifazegeyas.scala\nx86 fix no deferred:     https://hastebin.com/pegocohevo.scala\nx86 fix deferred:        https://hastebin.com/ofupevikuk.scala\nsparc base no deferred:  https://hastebin.com/ibobeteken.go\nsparc base deferred:     https://hastebin.com/fariqimiyu.go\nsparc fix no deferred:   https://hastebin.com/muhegoheyi.go\nsparc fix deferred:      https://hastebin.com/xadinobutu.go\n\nPavel Tatashin (11):\n  x86/mm: setting fields in deferred pages\n  sparc64/mm: setting fields in deferred pages\n  mm: deferred_init_memmap improvements\n  sparc64: simplify vmemmap_populate\n  mm: defining memblock_virt_alloc_try_nid_raw\n  mm: zero struct pages during initialization\n  sparc64: optimized struct page zeroing\n  mm: zero reserved and unavailable struct pages\n  x86/kasan: explicitly zero kasan shadow memory\n  arm64/kasan: explicitly zero kasan shadow memory\n  mm: stop zeroing memory during allocation in vmemmap\n\n arch/arm64/mm/kasan_init.c          |  42 ++++++++\n arch/sparc/include/asm/pgtable_64.h |  30 ++++++\n arch/sparc/mm/init_64.c             |  31 +++---\n arch/x86/mm/init_64.c               |   9 +-\n arch/x86/mm/kasan_init_64.c         |  66 ++++++++++++\n include/linux/bootmem.h             |  27 +++++\n include/linux/memblock.h            |  16 +++\n include/linux/mm.h                  |  26 +++++\n mm/memblock.c                       |  60 +++++++++--\n mm/page_alloc.c                     | 207 ++++++++++++++++++++----------------\n mm/sparse-vmemmap.c                 |  14 +--\n mm/sparse.c                         |   6 +-\n 12 files changed, 406 insertions(+), 128 deletions(-)"}