Received: by 10.213.65.68 with SMTP id h4csp3832367imn; Tue, 3 Apr 2018 11:22:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+vip0MVNwMtKThMRgVcC29t00QZ3j2zcmSdgpvB0fG/RdLFy4eDwPzUzGtlVvA/wQVEAfi X-Received: by 2002:a17:902:a9c9:: with SMTP id b9-v6mr8467754plr.8.1522779733608; Tue, 03 Apr 2018 11:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522779733; cv=none; d=google.com; s=arc-20160816; b=l/jM/6p2ixtESDHceVxHANAhL/fT3bSnt5UqAlULaff1xv+R8gV4VSbsMcxy1rvBBk OnxYlWRNgsySV012EFB5eOc+/gPlb38xzEcIsWAi8rHCOijx1ZVIx2fQfhiqqlOjahE4 jxF0tWTOmAaMRBMFhqPRWZxsF5hRURVhu2UkIbvYdQ+9ZLjMjETInykYx+YMpzePKF80 8gU3EV33vwA/vno54Ba4U/yvhXSAQwAlDl8aRfYnGDl9YlsVqN0aFSoLQeXWYIGR/YXu QYg2cQmdefvSYsFdfyDWR4fPaEnWiYEs5infRacpV6ftMcu+dFLQkw25sBHjTnWHBRTm j8jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=Noc6Uoe2FT5hJdDfDuefKeSCNneo678QW5oj4BEkqpA=; b=IxXh+hHw4owr86YF2VpVGL2JWKpi0fCg7TvnYluxDYw14cpvtoj6hAHdHyYKzSUpEJ FSplMXdDkpubda8B/4DmCPB2yr6U0OoIiZGVzHXtIbhmoz/sx5QEQP/o0Fsb+BvupZc2 UTMU0+lm6tA0utzk4DH6l1JayxAZRsl69hoJDiVQAkWLwN1/dOpKjfXn2Y4BhCp26Fgr 5zhL3mmKQR/epxCRelpAIsPXQQedZT1+VAbs6jcMTG0ac7L0IQ1amfWFYXSiHwuoiUqy PPPMB0Slf/CuuafjkhILdVMtJCUiXE91ChOk9dfuLDdjBMKxUeMuuMKGhhQAnCXbcD1P tsPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Rf5pxT9h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g31-v6si1023547pld.180.2018.04.03.11.21.58; Tue, 03 Apr 2018 11:22:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Rf5pxT9h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752924AbeDCSRu (ORCPT + 99 others); Tue, 3 Apr 2018 14:17:50 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:47866 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753163AbeDCSRX (ORCPT ); Tue, 3 Apr 2018 14:17:23 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w33IGqLc171260; Tue, 3 Apr 2018 18:16:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id; s=corp-2017-10-26; bh=Noc6Uoe2FT5hJdDfDuefKeSCNneo678QW5oj4BEkqpA=; b=Rf5pxT9hVNiK0rwfZr0tfyYn63I1rBre5OPlAxhWGUiwAsre7Bi1VSN8+k5vjw11BVn9 4eP2DWAEPQDZGKLXeG6QGj2uxBiD4R/TPcX6IZb1SxRwanlcxU5STZGaynbwePQOOhgc F6x8/erIUgnHmRil2vYR+Sh7t1Owh8U7Z/4dkdSEWNaqLozqdtC0sH7QqaXW7rftG3MF DQi9hfo8u2OXJJTAipZ0FNlHEtBcH/xJxRU1S3oqtuWMwyvkUaieF4SbY6MnrVi63Yqn DTBaFNpHibyPR8m9hoyrcYLfH5B3zfFZ1Z5j9oTEPjslvFM/meDozS1dUubGfWdWcP+Q DQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2h4erm0009-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Apr 2018 18:16:52 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w33IGpmP015324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Apr 2018 18:16:51 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w33IGoAO028804; Tue, 3 Apr 2018 18:16:50 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Apr 2018 11:16:49 -0700 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, akpm@linux-foundation.org, mgorman@techsingularity.net, mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, vbabka@suse.cz, bharata@linux.vnet.ibm.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, dan.j.williams@intel.com, kirill.shutemov@linux.intel.com, bhe@redhat.com, alexander.levin@microsoft.com Subject: [v6 0/6] optimize memory hotplug Date: Tue, 3 Apr 2018 14:16:37 -0400 Message-Id: <20180403181643.28127-1-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.3 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8852 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804030185 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changelog: v6 - v5 - Improved "mm: add uninitialized struct page poisoning sanity checking". Fixed __dump_page() to detect that page is poisoned. This should fix a panic printing issue reported by Sasha Levin. v5 - v4 - Addressed more comments from Ingo Molnar and Michal Hocko. - In the patch "optimize memory hotplug" we are now using struct memory_block to hold node id as suggested by Michal. - In the patch "don't read nid from struct page during hotplug" renamed register_new_memory() to hotplug_memory_register() as suggested by Ingo. Also, in this patch replaced the description with the one provided by Michal. - Fixed other spelling issues found by Ingo. v3 - v4 Addressed comments from Ingo Molnar and from Michal Hocko Split 4th patch into three patches Instead of using section table to save node ids, saving node id in the first page of every section. v2 - v3 Fixed two issues found during testing Addressed Kbuild warning reports v1 - v2 Added struct page poisoning checking in order to verify that struct pages are never accessed until initialized during memory hotplug This patchset: - Improves hotplug performance by eliminating a number of struct page traverses during memory hotplug. - Fixes some issues with hotplugging, where boundaries were not properly checked. And on x86 block size was not properly aligned with end of memory - Also, potentially improves boot performance by eliminating condition from __init_single_page(). - Adds robustness by verifying that that struct pages are correctly poisoned when flags are accessed. The following experiments were performed on Xeon(R) CPU E7-8895 v3 @ 2.60GHz with 1T RAM: booting in qemu with 960G of memory, time to initialize struct pages: no-kvm: TRY1 TRY2 BEFORE: 39.433668 39.39705 AFTER: 36.903781 36.989329 with-kvm: BEFORE: 10.977447 11.103164 AFTER: 10.929072 10.751885 Hotplug 896G memory: no-kvm: TRY1 TRY2 BEFORE: 848.740000 846.910000 AFTER: 783.070000 786.560000 with-kvm: TRY1 TRY2 BEFORE: 34.410000 33.57 AFTER: 29.810000 29.580000 Pavel Tatashin (6): mm/memory_hotplug: enforce block size aligned range check x86/mm/memory_hotplug: determine block size based on the end of boot memory mm: add uninitialized struct page poisoning sanity checking mm/memory_hotplug: optimize probe routine mm/memory_hotplug: don't read nid from struct page during hotplug mm/memory_hotplug: optimize memory hotplug arch/x86/mm/init_64.c | 33 +++++++++++++++++++++++++++++---- drivers/base/memory.c | 40 ++++++++++++++++++++++------------------ drivers/base/node.c | 24 +++++++++++++++++------- include/linux/memory.h | 3 ++- include/linux/mm.h | 4 +++- include/linux/node.h | 4 ++-- include/linux/page-flags.h | 22 +++++++++++++++++----- mm/debug.c | 14 +++++++++++--- mm/memblock.c | 2 +- mm/memory_hotplug.c | 44 +++++++++++++++++--------------------------- mm/page_alloc.c | 28 ++++++++++------------------ mm/sparse.c | 8 +++++++- 12 files changed, 138 insertions(+), 88 deletions(-) -- 2.16.3