{"id":806907,"url":"http://patchwork.ozlabs.org/api/1.0/patches/806907/?format=json","project":{"id":10,"url":"http://patchwork.ozlabs.org/api/1.0/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},"msgid":"<1503972142-289376-8-git-send-email-pasha.tatashin@oracle.com>","date":"2017-08-29T02:02:18","name":"[v7,07/11] 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/1.0/people/71010/?format=json","name":"Pavel Tatashin","email":"pasha.tatashin@oracle.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.0/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/sparclinux/patch/1503972142-289376-8-git-send-email-pasha.tatashin@oracle.com/mbox/","series":[{"id":285,"url":"http://patchwork.ozlabs.org/api/1.0/series/285/?format=json","date":"2017-08-29T02:02:11","name":"complete deferred page initialization","version":7,"mbox":"http://patchwork.ozlabs.org/series/285/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806907/checks/","tags":{},"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 3xhBnh2qkNz9s7c\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 12:06:16 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751394AbdH2CGO (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 28 Aug 2017 22:06:14 -0400","from aserp1040.oracle.com ([141.146.126.69]:25868 \"EHLO\n\taserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751271AbdH2CDu (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 v7T22bJ2011059\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:37 GMT","from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v7T22aeb007095\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 29 Aug 2017 02:02:36 GMT","from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17])\n\tby userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id\n\tv7T22Zma011213; Tue, 29 Aug 2017 02:02:35 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:35 -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 07/11] sparc64: optimized struct page zeroing","Date":"Mon, 28 Aug 2017 22:02:18 -0400","Message-Id":"<1503972142-289376-8-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":"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>\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 6fbd931f0570..cee5cc7ccc51 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":["v7","07/11"]}