Received: by 10.192.165.148 with SMTP id m20csp267442imm; Wed, 9 May 2018 12:19:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqy2pnF6/+UuSuFeUJuJy7RUKaO7BnIQ6qB0rX+OT8jDZqYhROrQbHfuSYW+kw7GxKN8mtm X-Received: by 2002:a17:902:24c7:: with SMTP id l7-v6mr47842701plg.320.1525893588349; Wed, 09 May 2018 12:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525893588; cv=none; d=google.com; s=arc-20160816; b=vcd+vGGUpLQaNn4/dhWZopD/3PmLMXewLc8vhg/uj7xJgXpWsrV/3L/dM9ahYyjJ7a zHfbG1L9WDIuqmLwC4r/V0GI3wtceQb/90Uevz8pxFKDscVxYouKRBmxVkySKz+RsE/R SPHF8wykQIwTMq5JF4fQ3Hh5vHZfgOqIhqmwvsAzCAWWuhYYwP9AVj1mpbqrugInpU2c Q48SbLzApFdZg66F8uPUd0DaqhbLwl5FezXiSwr7vzDFviwGKnF6N6V4EePyfC6co8+I jXBEFcE6eFg1iEemlmbBWF2xR5wo+jl36MBDSqsYTcyI8EHlH9DRmpfsuJuuXJmcWQe9 r6vA== 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=OYcKhSoRVE/2kiDwIJ3ipm4lUUJCa2hjkdBR1M8OBFk=; b=EoxvPJnLAByR/6B9BZHH8XC+9G6cdflbTVv9zjaFVVDry/+yncq9uq/TdogOwgOC3m P66hV8Qlt9s+jEHdSso3QauwrAwya2tUVSc8pK72U4Rf7SelTHtz/b6jFK4L8V2gGUYZ N8zrXCAjTkzUNxhWPTofBoGyRGqUzj2/VJOcZG9VI2g4C1Np9S+m4MkXrBBVIifuAsdq w+NkYNJDjT+AvhX0VyuwoFk/rGtCW8PUhD0gC+ZNS3ZoUkpB4Ge+e1jCHVDO6xuVMIO5 wtNfaJVQyM5XmnPA6q0C1KVkyGdAEko+GO5m4wzp+xEb+HPYqlTFOaJz4FcZbNnJGqBO Su4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ijTXWr9J; 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 b5-v6si19363833ple.417.2018.05.09.12.19.33; Wed, 09 May 2018 12:19:48 -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=ijTXWr9J; 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 S965218AbeEITTB (ORCPT + 99 others); Wed, 9 May 2018 15:19:01 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:45700 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965017AbeEITTA (ORCPT ); Wed, 9 May 2018 15:19:00 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w49JG2s9094017; Wed, 9 May 2018 19:17:23 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=OYcKhSoRVE/2kiDwIJ3ipm4lUUJCa2hjkdBR1M8OBFk=; b=ijTXWr9JyOeb54GP0Nj4/m8enfsbjpDtB4uWxltSjRNxHbpDihV3pSG0lqFFRApYOrdJ DuDAUOUVYTh3ihgmjdnAxofSTGoWTd6TparIPsEeH8ic7EQ08pBo1F5xfphGoGRa/KBW /XmdXpYe/yKeQTT5f7kjt+BbTPJXUlFofPaBZZbujE1DX0cmzjPdOIBEMgh9NH2f4oHT CWHtJCNZzF6MjUIrxv3WN96Zwi340N/bLuUC9YChQTVLpClgd6po6eWpJg479DgUN1zN UBmJ4NkxLN5M+wL7DCBjSNhcON6k9Dg8zPI6l7WIg1ZKPLJdJn+ARzW4ZG9n7nUaT5jE bg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2hv6kp05c9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 May 2018 19:17:22 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w49JHMpX010339 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 May 2018 19:17:22 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w49JHKH3020990; Wed, 9 May 2018 19:17:20 GMT Received: from xakep.us.oracle.com (/10.39.228.83) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 09 May 2018 12:17:19 -0700 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mhocko@suse.com, linux-mm@kvack.org, mgorman@techsingularity.net, mingo@kernel.org, peterz@infradead.org, rostedt@goodmis.org, fengguang.wu@intel.com, dennisszhou@gmail.com Subject: [PATCH] mm: allow deferred page init for vmemmap only Date: Wed, 9 May 2018 15:17:13 -0400 Message-Id: <20180509191713.23794-1-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.17.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8888 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=959 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805090181 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is unsafe to do virtual to physical translations before mm_init() is called if struct page is needed in order to determine the memory section number (see SECTION_IN_PAGE_FLAGS). This is because only in mm_init() we initialize struct pages for all the allocated memory when deferred struct pages are used. My recent fix exposed this problem, because it greatly reduced number of pages that are initialized before mm_init(), but the problem existed even before my fix, as Fengguang Wu found. Since FLATMEM is already disallowed for deferred struct pages, it makes sense to allow deferred struct pages only on systems with SPARSEMEM_VMEMMAP. The problems are discussed in these threads: http://lkml.kernel.org/r/20180418135300.inazvpxjxowogyge@wfg-t540p.sh.intel.com http://lkml.kernel.org/r/20180419013128.iurzouiqxvcnpbvz@wfg-t540p.sh.intel.com http://lkml.kernel.org/r/20180426202619.2768-1-pasha.tatashin@oracle.com Fixes: 3a80a7fa7989 ("mm: meminit: initialise a subset of struct pages if CONFIG_DEFERRED_STRUCT_PAGE_INIT is set") Signed-off-by: Pavel Tatashin --- mm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/Kconfig b/mm/Kconfig index d5004d82a1d6..1cd32d67ca30 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -635,7 +635,7 @@ config DEFERRED_STRUCT_PAGE_INIT bool "Defer initialisation of struct pages to kthreads" default n depends on NO_BOOTMEM - depends on !FLATMEM + depends on SPARSEMEM_VMEMMAP help Ordinarily all struct pages are initialised during early boot in a single thread. On very large machines this can take a considerable -- 2.17.0