[{"id":1768860,"web_url":"http://patchwork.ozlabs.org/comment/1768860/","msgid":"<d2b52cf6-2fdf-922e-2bb7-56bd0ed67bb4@oracle.com>","list_archive_url":null,"date":"2017-09-14T22:40:22","subject":"[PATCH v8 00/11] complete deferred page initialization","submitter":{"id":71010,"url":"http://patchwork.ozlabs.org/api/people/71010/","name":"Pavel Tatashin","email":"pasha.tatashin@oracle.com"},"content":"Copy paste error, changing the subject for the header to v8 from v7.\n\nOn 09/14/2017 06:35 PM, Pavel Tatashin wrote:\n> Changelog:\n> v8 - v7\n> - Added Acked-by's from Dave Miller for SPARC changes\n> - Fixed a minor compiling issue on tile architecture reported by kbuild\n>\n> v7 - 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>\n> v6 - 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>\n> v5 - v4\n> - Fixed build issues reported by kbuild on various configurations\n>\n> v4 - 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>\n> v3 - 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>\n> v2 - 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>\n> SMP machines can benefit from the DEFERRED_STRUCT_PAGE_INIT config option,\n> which defers initializing struct pages until all cpus have been started so\n> it can be done in parallel.\n>\n> However, this feature is sub-optimal, because the deferred page\n> initialization code expects that the struct pages have already been zeroed,\n> and the zeroing is done early in boot with a single thread only.  Also, we\n> access that memory and set flags before struct pages are initialized. All\n> of this is fixed in this patchset.\n>\n> In 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> ==========================================================================\n> Performance improvements on x86 machine with 8 nodes:\n> Intel(R) Xeon(R) CPU E7-8895 v3 @ 2.60GHz and 1T of memory:\n>                          TIME          SPEED UP\n> base no deferred:       95.796233s\n> fix no deferred:        79.978956s    19.77%\n>\n> base deferred:          77.254713s\n> fix deferred:           55.050509s    40.34%\n> ==========================================================================\n> SPARC M6 3600 MHz with 15T of memory\n>                          TIME          SPEED UP\n> base no deferred:       358.335727s\n> fix no deferred:        302.320936s   18.52%\n>\n> base deferred:          237.534603s\n> fix deferred:           182.103003s   30.44%\n> ==========================================================================\n> Raw dmesg output with timestamps:\n> x86 base no deferred:    https://hastebin.com/ofunepurit.scala\n> x86 base deferred:       https://hastebin.com/ifazegeyas.scala\n> x86 fix no deferred:     https://hastebin.com/pegocohevo.scala\n> x86 fix deferred:        https://hastebin.com/ofupevikuk.scala\n> sparc base no deferred:  https://hastebin.com/ibobeteken.go\n> sparc base deferred:     https://hastebin.com/fariqimiyu.go\n> sparc fix no deferred:   https://hastebin.com/muhegoheyi.go\n> sparc fix deferred:      https://hastebin.com/xadinobutu.go\n>\n> Pavel 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                 |  15 ++-\n>   mm/sparse.c                         |   6 +-\n>   12 files changed, 406 insertions(+), 129 deletions(-)\n>\n\n--\nTo unsubscribe from this list: send the line \"unsubscribe sparclinux\" in\nthe body of a message to majordomo@vger.kernel.org\nMore majordomo info at  http://vger.kernel.org/majordomo-info.html","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 3xtYS842n9z9sCZ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 15 Sep 2017 08:42:00 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751328AbdINWl7 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 14 Sep 2017 18:41:59 -0400","from userp1040.oracle.com ([156.151.31.81]:45337 \"EHLO\n\tuserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751268AbdINWl7 (ORCPT\n\t<rfc822; sparclinux@vger.kernel.org>); Thu, 14 Sep 2017 18:41:59 -0400","from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v8EMeLh2002278\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Thu, 14 Sep 2017 22:40:21 GMT","from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])\n\tby userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v8EMeLlV005360\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Thu, 14 Sep 2017 22:40:21 GMT","from ubhmp0013.oracle.com (ubhmp0013.oracle.com [156.151.24.66])\n\tby userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v8EMeKi7005854; \n\tThu, 14 Sep 2017 22:40:20 GMT","from [172.20.162.102] (/12.145.98.253)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Thu, 14 Sep 2017 22:40:19 +0000"],"Subject":"[PATCH v8 00/11] complete deferred page initialization","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","References":"<20170914223517.8242-1-pasha.tatashin@oracle.com>","From":"Pavel Tatashin <pasha.tatashin@oracle.com>","Message-ID":"<d2b52cf6-2fdf-922e-2bb7-56bd0ed67bb4@oracle.com>","Date":"Thu, 14 Sep 2017 18:40:22 -0400","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170914223517.8242-1-pasha.tatashin@oracle.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","X-Source-IP":"userv0022.oracle.com [156.151.31.74]","Sender":"sparclinux-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<sparclinux.vger.kernel.org>","X-Mailing-List":"sparclinux@vger.kernel.org"}}]