From patchwork Thu May 19 21:29:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 68203 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3435712qge; Thu, 19 May 2016 14:56:16 -0700 (PDT) X-Received: by 10.98.29.137 with SMTP id d131mr23329132pfd.2.1463694976170; Thu, 19 May 2016 14:56:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x66si22662367pfj.205.2016.05.19.14.56.15; Thu, 19 May 2016 14:56:16 -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=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755070AbcESV4O (ORCPT + 30 others); Thu, 19 May 2016 17:56:14 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:33974 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646AbcESV4M (ORCPT ); Thu, 19 May 2016 17:56:12 -0400 Received: by mail-pf0-f171.google.com with SMTP id y69so34018272pfb.1 for ; Thu, 19 May 2016 14:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=EObCtFiitORx1hAgfGff/yW19j+cymIgrTAAwLwko1g=; b=SwGxR0Tvc+jh7d2xzWmX6HCFgRG5D4eufseHjFzaN/pbgaHgOW4lN5zYrwPurLc/gt 76va85jtg55SU6Dc0VrOTMozpsU9TcPNZRiKQbXPUxW/i4sPUrsrVgMB8cKoWyQhJKI5 eHHoj3OS3yMeTTnX5iGjBsTXZT0wv9YFmuxmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EObCtFiitORx1hAgfGff/yW19j+cymIgrTAAwLwko1g=; b=eutOP0HFLrOJku5fP89c27Ef48o2RfstmWNSFRxtBxeSa8HRd94EJ2gIx2kMWJhQlF FTL3G7WWs8Sz8EI5VWwVwTYKJkqjYeaBWlsA3MYVnunWpSYZC4XHkrS3wZbR/jDaUx18 yMQqjrCe/ZKQ8jHJGSpvRVPgRXmQGzzh2M7FW6kyNsChbcSp/rixj7Yaw0AtpHM5088l E/URWowTBxij1HcoWwraQ5HOMNkFVjFHBbvgmg3p2GJxkk1VYusCwjLI6qiUyRTtHDSZ aqF+ZX30RDpfQ0IdjQn60cv9whNURmCa4ouXhYdnaY/i3DHBcvLRqPZ83rF5giX+7TVr f55A== X-Gm-Message-State: AOPr4FW5kvMe+vucDkkBvKC/tp8PrzoTDUiDZnCEPk2gSDNhev4hRwNuHvqurXwgrW7TbQhK X-Received: by 10.98.77.199 with SMTP id a190mr22867391pfb.37.1463694971758; Thu, 19 May 2016 14:56:11 -0700 (PDT) Received: from yshi-Precision-T5600.corp.ad.wrs.com (unknown-216-82.windriver.com. [147.11.216.82]) by smtp.gmail.com with ESMTPSA id h1sm22055954pfh.49.2016.05.19.14.56.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 14:56:11 -0700 (PDT) From: Yang Shi To: akpm@linux-foundation.org, iamjoonsoo.kim@lge.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linaro-kernel@lists.linaro.org, yang.shi@linaro.org Subject: [PATCH] mm: move page_ext_init after all struct pages are initialized Date: Thu, 19 May 2016 14:29:05 -0700 Message-Id: <1463693345-30842-1-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When DEFERRED_STRUCT_PAGE_INIT is enabled, just a subset of memmap at boot are initialized, then the rest are initialized in parallel by starting one-off "pgdatinitX" kernel thread for each node X. If page_ext_init is called before it, some pages will not have valid extension, so move page_ext_init() after it. CC: Joonsoo Kim Signed-off-by: Yang Shi --- init/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.0.2 diff --git a/init/main.c b/init/main.c index b3c6e36..2075faf 100644 --- a/init/main.c +++ b/init/main.c @@ -606,7 +606,6 @@ asmlinkage __visible void __init start_kernel(void) initrd_start = 0; } #endif - page_ext_init(); debug_objects_mem_init(); kmemleak_init(); setup_per_cpu_pageset(); @@ -1004,6 +1003,8 @@ static noinline void __init kernel_init_freeable(void) sched_init_smp(); page_alloc_init_late(); + /* Initialize page ext after all struct pages are initializaed */ + page_ext_init(); do_basic_setup();