{"id":816458,"url":"http://patchwork.ozlabs.org/api/patches/816458/?format=json","web_url":"http://patchwork.ozlabs.org/project/sparclinux/patch/20170920201714.19817-8-pasha.tatashin@oracle.com/","project":{"id":10,"url":"http://patchwork.ozlabs.org/api/projects/10/?format=json","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":"<20170920201714.19817-8-pasha.tatashin@oracle.com>","list_archive_url":null,"date":"2017-09-20T20:17:09","name":"[v9,07/12] sparc64: optimized struct page zeroing","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":false,"hash":"e491f76dd863cd259f8b65b312e161bde30fdecc","submitter":{"id":71010,"url":"http://patchwork.ozlabs.org/api/people/71010/?format=json","name":"Pavel Tatashin","email":"pasha.tatashin@oracle.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/sparclinux/patch/20170920201714.19817-8-pasha.tatashin@oracle.com/mbox/","series":[{"id":4223,"url":"http://patchwork.ozlabs.org/api/series/4223/?format=json","web_url":"http://patchwork.ozlabs.org/project/sparclinux/list/?series=4223","date":"2017-09-20T20:17:06","name":"complete deferred page initialization","version":9,"mbox":"http://patchwork.ozlabs.org/series/4223/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816458/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816458/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 3xyB3R6wv6z9ryv\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 06:21:39 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751738AbdITUV1 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 16:21:27 -0400","from userp1040.oracle.com ([156.151.31.81]:41120 \"EHLO\n\tuserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751524AbdITUSn (ORCPT\n\t<rfc822; sparclinux@vger.kernel.org>); Wed, 20 Sep 2017 16:18:43 -0400","from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v8KKHWON007866\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Wed, 20 Sep 2017 20:17:32 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\tv8KKHVTp028534\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Wed, 20 Sep 2017 20:17:32 GMT","from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14])\n\tby aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv8KKHVDD028115; Wed, 20 Sep 2017 20:17:31 GMT","from xakep.us.oracle.com (/10.154.127.176)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Wed, 20 Sep 2017 13:17:30 -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\tmark.rutland@arm.com, will.deacon@arm.com, catalin.marinas@arm.com,\n\tsam@ravnborg.org, mgorman@techsingularity.net,\n\tsteven.sistare@oracle.com, daniel.m.jordan@oracle.com,\n\tbob.picco@oracle.com","Subject":"[PATCH v9 07/12] sparc64: optimized struct page zeroing","Date":"Wed, 20 Sep 2017 16:17:09 -0400","Message-Id":"<20170920201714.19817-8-pasha.tatashin@oracle.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170920201714.19817-1-pasha.tatashin@oracle.com>","References":"<20170920201714.19817-1-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":"Add an optimized mm_zero_struct_page(), so struct page's are zeroed without\ncalling memset(). We do eight to ten regular stores based on the size of\nstruct page. Compiler optimizes out the conditions of switch() statement.\n\nSPARC-M6 with 15T of memory, single thread performance:\n\n                               BASE            FIX  OPTIMIZED_FIX\n        bootmem_init   28.440467985s   2.305674818s   2.305161615s\nfree_area_init_nodes  202.845901673s 225.343084508s 172.556506560s\n                      --------------------------------------------\nTotal                 231.286369658s 227.648759326s 174.861668175s\n\nBASE:  current linux\nFIX:   This patch series without \"optimized struct page zeroing\"\nOPTIMIZED_FIX: This patch series including the current patch.\n\nbootmem_init() is where memory for struct pages is zeroed during\nallocation. Note, about two seconds in this function is a fixed time: it\ndoes not increase as memory is increased.\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: David S. Miller <davem@davemloft.net>\n---\n arch/sparc/include/asm/pgtable_64.h | 30 ++++++++++++++++++++++++++++++\n 1 file changed, 30 insertions(+)","diff":"diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h\nindex 4fefe3762083..8ed478abc630 100644\n--- a/arch/sparc/include/asm/pgtable_64.h\n+++ b/arch/sparc/include/asm/pgtable_64.h\n@@ -230,6 +230,36 @@ extern unsigned long _PAGE_ALL_SZ_BITS;\n extern struct page *mem_map_zero;\n #define ZERO_PAGE(vaddr)\t(mem_map_zero)\n \n+/* This macro must be updated when the size of struct page grows above 80\n+ * or reduces below 64.\n+ * The idea that compiler optimizes out switch() statement, and only\n+ * leaves clrx instructions\n+ */\n+#define\tmm_zero_struct_page(pp) do {\t\t\t\t\t\\\n+\tunsigned long *_pp = (void *)(pp);\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\t /* Check that struct page is either 64, 72, or 80 bytes */\t\\\n+\tBUILD_BUG_ON(sizeof(struct page) & 7);\t\t\t\t\\\n+\tBUILD_BUG_ON(sizeof(struct page) < 64);\t\t\t\t\\\n+\tBUILD_BUG_ON(sizeof(struct page) > 80);\t\t\t\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\tswitch (sizeof(struct page)) {\t\t\t\t\t\\\n+\tcase 80:\t\t\t\t\t\t\t\\\n+\t\t_pp[9] = 0;\t/* fallthrough */\t\t\t\\\n+\tcase 72:\t\t\t\t\t\t\t\\\n+\t\t_pp[8] = 0;\t/* fallthrough */\t\t\t\\\n+\tdefault:\t\t\t\t\t\t\t\\\n+\t\t_pp[7] = 0;\t\t\t\t\t\t\\\n+\t\t_pp[6] = 0;\t\t\t\t\t\t\\\n+\t\t_pp[5] = 0;\t\t\t\t\t\t\\\n+\t\t_pp[4] = 0;\t\t\t\t\t\t\\\n+\t\t_pp[3] = 0;\t\t\t\t\t\t\\\n+\t\t_pp[2] = 0;\t\t\t\t\t\t\\\n+\t\t_pp[1] = 0;\t\t\t\t\t\t\\\n+\t\t_pp[0] = 0;\t\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\t\\\n+} while (0)\n+\n /* PFNs are real physical page numbers.  However, mem_map only begins to record\n  * per-page information starting at pfn_base.  This is to handle systems where\n  * the first physical page in the machine is at some huge physical address,\n","prefixes":["v9","07/12"]}