Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp962802ybm; Wed, 27 May 2020 12:17:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWMiOXf0mtXSBtQ5Usu6Jcd9e9ljl/781dfjm4pljw5ZCZugWCKlvae3s5upeeJJuYwYdA X-Received: by 2002:a17:906:46d3:: with SMTP id k19mr7661039ejs.349.1590607065560; Wed, 27 May 2020 12:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590607065; cv=none; d=google.com; s=arc-20160816; b=wfJ4amAjDdXgndrLhSJXhVHdL5RlAM8mLxpmz7L4juP+Cvr8a2L4YXpj9/AarwiYEM J1UgSUkwp7Ee7IjgKvCQEkJ5dfjWL/IsLMG0z8+plDVMhACKVjya3+hnmRoi3tFtSBeP DS4IAj/nHQImYcYDTPPF5YwAo0StbJKIM2sShKm+0VSTZUE2NtCp2ZZ4XBB9siumUhFr WCfLy65IXM1L3zQiOZSaQI7KVmMaT40x0APtSr0D9d0m9+r281weecI8iI4Mkn5eYKBw lh4ruetfKU44J7Z/bDM3r6FZDiL/stOZew+AQxzKpL5OzO5OfdiAZtMgvw2l/Dszsatw Krtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=efP/mXxmY+Jo1bVM+X6fJTP9YFt5MPHFZ0S23zpocQ4=; b=fvJQpkvoFE/LuI5cgDVLIOp0H/FPng70flg9fAMSwJMyWlw3v7M07A3hY3XQQQwqrc aGpwP9j5THOxtzq+vCxoADoqxD5WXvWxguCLhoojlhGImTvBPLCuT17DAjTH4re/ZFD/ WJyWq0TLT9oLy8uly0hBfg9fGF4jP4eWeoLQ5/9oiWMrZViHYN9LJUVXnVxIUxyiv3P5 Y1oTA3z3GOAzW4+t+WKXEVCUOJ3jAx6dQVpDpZkmVxrCqOIxLgV4W/3bW0btsZ8mim8u yQYuJYwP9bwyY6NY/qHpDD+SJrH2vwPnxzgPlfrkIWu1PTxM2gUCquKLaQd+Z5wdA3hB EJZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b="GMaJk/YN"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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. [23.128.96.18]) by mx.google.com with ESMTP id w5si2483148ejq.420.2020.05.27.12.17.20; Wed, 27 May 2020 12:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b="GMaJk/YN"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S2403804AbgE0Rhg (ORCPT + 99 others); Wed, 27 May 2020 13:37:36 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:56264 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403778AbgE0Rhg (ORCPT ); Wed, 27 May 2020 13:37:36 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04RHRk7S158957; Wed, 27 May 2020 17:36:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=efP/mXxmY+Jo1bVM+X6fJTP9YFt5MPHFZ0S23zpocQ4=; b=GMaJk/YNJ4X9LiJmPh3oard50FHo21spuc/kg1iGAYwJbub5g3aVkizfWzf5MWkgAXSz cAInd1o+XcfcRT1zq7MYQ/T2yadm7PdQ5FgyDlNmYilNPP6N374z/jzHL/r5OwiyDAGl +HbXKaIqWQBZcDb73/aT3iXS4Dh9oOR6H85HxlbIogB+mQvaaTOZWpq/4hMH3ci+dTDQ /WTcXndjy0DWdNku1rOf9G4K2HWec6h3ehxzMUTk9MBYtP+byjAFRvWrNheA0SToMGbq 5pYQuGRhbmCpsAZs8Q96+c/iXK9z0BKRpJ2sZq8RfXxKM5NUw1TG8OOxhGwvbRcOYQ8T 1Q== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 318xbk0v58-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 May 2020 17:36:32 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04RHXbJm142828; Wed, 27 May 2020 17:36:31 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 317dkutu3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 27 May 2020 17:36:31 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04RHaK0V003965; Wed, 27 May 2020 17:36:20 GMT Received: from localhost.localdomain (/98.229.125.203) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 27 May 2020 10:36:20 -0700 From: Daniel Jordan To: Andrew Morton , Herbert Xu , Steffen Klassert Cc: Alex Williamson , Alexander Duyck , Dan Williams , Dave Hansen , David Hildenbrand , Jason Gunthorpe , Jonathan Corbet , Josh Triplett , Kirill Tkhai , Michal Hocko , Pavel Machek , Pavel Tatashin , Peter Zijlstra , Randy Dunlap , Robert Elliott , Shile Zhang , Steven Sistare , Tejun Heo , Zi Yan , linux-crypto@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Daniel Jordan Subject: [PATCH v3 2/8] padata: initialize earlier Date: Wed, 27 May 2020 13:36:02 -0400 Message-Id: <20200527173608.2885243-3-daniel.m.jordan@oracle.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527173608.2885243-1-daniel.m.jordan@oracle.com> References: <20200527173608.2885243-1-daniel.m.jordan@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9633 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 bulkscore=0 spamscore=0 suspectscore=2 mlxscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005270137 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9633 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 cotscore=-2147483648 suspectscore=2 bulkscore=0 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005270136 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org padata will soon initialize the system's struct pages in parallel, so it needs to be ready by page_alloc_init_late(). The error return from padata_driver_init() triggers an initcall warning, so add a warning to padata_init() to avoid silent failure. Signed-off-by: Daniel Jordan Tested-by: Josh Triplett --- include/linux/padata.h | 6 ++++++ init/main.c | 2 ++ kernel/padata.c | 17 ++++++++--------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/linux/padata.h b/include/linux/padata.h index a0d8b41850b25..476ecfa41f363 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h @@ -164,6 +164,12 @@ struct padata_instance { #define PADATA_INVALID 4 }; +#ifdef CONFIG_PADATA +extern void __init padata_init(void); +#else +static inline void __init padata_init(void) {} +#endif + extern struct padata_instance *padata_alloc_possible(const char *name); extern void padata_free(struct padata_instance *pinst); extern struct padata_shell *padata_alloc_shell(struct padata_instance *pinst); diff --git a/init/main.c b/init/main.c index 03371976d3872..df32f67214d23 100644 --- a/init/main.c +++ b/init/main.c @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -1482,6 +1483,7 @@ static noinline void __init kernel_init_freeable(void) smp_init(); sched_init_smp(); + padata_init(); page_alloc_init_late(); /* Initialize page ext after all struct pages are initialized. */ page_ext_init(); diff --git a/kernel/padata.c b/kernel/padata.c index 835919c745266..6f709bc0fc413 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -31,7 +31,6 @@ #include #include #include -#include #define MAX_OBJ_NUM 1000 @@ -1050,26 +1049,26 @@ void padata_free_shell(struct padata_shell *ps) } EXPORT_SYMBOL(padata_free_shell); -#ifdef CONFIG_HOTPLUG_CPU - -static __init int padata_driver_init(void) +void __init padata_init(void) { +#ifdef CONFIG_HOTPLUG_CPU int ret; ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "padata:online", padata_cpu_online, NULL); if (ret < 0) - return ret; + goto err; hp_online = ret; ret = cpuhp_setup_state_multi(CPUHP_PADATA_DEAD, "padata:dead", NULL, padata_cpu_dead); if (ret < 0) { cpuhp_remove_multi_state(hp_online); - return ret; + goto err; } - return 0; -} -module_init(padata_driver_init); + return; +err: + pr_warn("padata: initialization failed\n"); #endif +} -- 2.26.2