From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14D21C4332F for ; Mon, 14 Nov 2022 07:45:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E9196B0072; Mon, 14 Nov 2022 02:45:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 671EE6B0073; Mon, 14 Nov 2022 02:45:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 539EB6B0074; Mon, 14 Nov 2022 02:45:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4421C6B0072 for ; Mon, 14 Nov 2022 02:45:01 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 11920140443 for ; Mon, 14 Nov 2022 07:45:01 +0000 (UTC) X-FDA: 80131261602.19.8EA824A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 9A9881C0005 for ; Mon, 14 Nov 2022 07:45:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668411899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=H7Es+mdmPcACifwFPjey8kfbFYEbv3/lurjkYQxwMuc=; b=VQNm3mCE3p9OxUsPul9WO/sqNX+uPd5nS+tvjZgwCZXrmTV5AMGy/yjAzcYPviGZqigEz6 +XkfAeZ5uym6wUXcurUvpz4Zu0WqDKWRF54xo5JDiP8N9whZJTTkLXB3uEE643/tdVJPa5 /ktMMHAEBlcpIx3f+X6b8g78V+AjvwQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-101-S1uXMJ96Ml6HubMiv4BS6A-1; Mon, 14 Nov 2022 02:44:54 -0500 X-MC-Unique: S1uXMJ96Ml6HubMiv4BS6A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 208F91C07592; Mon, 14 Nov 2022 07:44:54 +0000 (UTC) Received: from localhost (ovpn-12-71.pek2.redhat.com [10.72.12.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49E89492CA5; Mon, 14 Nov 2022 07:44:52 +0000 (UTC) Date: Mon, 14 Nov 2022 15:44:49 +0800 From: Baoquan He To: kernel test robot Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , Vlastimil Babka , Dennis Zhou , 42.hyeyoo@gmail.com Subject: Re: [linux-next:master 5002/7443] include/linux/compiler_types.h:357:45: error: call to '__compiletime_assert_474' declared with attribute error: BUILD_BUG_ON failed: PERCPU_DYNAMIC_EARLY_SIZE < NR_KMALLOC_TYPES * KMALLOC_SHIFT_HIGH * sizeof(struct kmem_cache_cpu) Message-ID: References: <202211120436.HzD1i2yQ-lkp@intel.com> MIME-Version: 1.0 In-Reply-To: <202211120436.HzD1i2yQ-lkp@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668411900; a=rsa-sha256; cv=none; b=acTPgMbu8t68D0SGrbaKgwn1Lza4K//LVDxSMlOua7Ne0Rc7/e/JflZ0aVe2qn1eyzPAR5 hJyQH8r4c4lSkTQs0FFkw3Bn98yMacUyZmsp9mxlsLjMNchi6o+oqEGGpxh5fC36Eim9eZ kh/U97xSyupbz6mBkopoTZt+PyJl1iY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VQNm3mCE; spf=pass (imf21.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668411900; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=H7Es+mdmPcACifwFPjey8kfbFYEbv3/lurjkYQxwMuc=; b=QJdFUQBzm2GmovHwvrXr/JuqxQVKrWfYdDb9N/fya6QOJeEd7rcoRkh0YlmJyNjV6D1lHE Mkjw3r+PniJYHh1gFZ6BpgUY+ME7u3WW27A0pdbpzp6ig1csY1JDLXO9UbftGegx1EB1gm AwwcKuHa2TS9dwXIeAXCpnjoSoSIvco= X-Stat-Signature: en1o5acgx8okmuyfa8gmtnzzbqcuumzf Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VQNm3mCE; spf=pass (imf21.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam10 X-Rspam-User: X-Rspamd-Queue-Id: 9A9881C0005 X-HE-Tag: 1668411900-861337 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, I reproduced the build failure according to lkp report and made a patch as below to fix it. >From dae7dd9705015ce36db757e88c78802584f949b1 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Sun, 13 Nov 2022 18:08:27 +0800 Subject: [PATCH] percpu: adjust the value of PERCPU_DYNAMIC_EARLY_SIZE Content-type: text/plain LKP reported a build failure as below on the patch "mm/slub, percpu: correct the calculation of early percpu allocation size" ~~~~~~ In file included from : In function 'alloc_kmem_cache_cpus', inlined from 'kmem_cache_open' at mm/slub.c:4340:6: >> include/linux/compiler_types.h:357:45: error: call to '__compiletime_assert_474' declared with attribute error: BUILD_BUG_ON failed: PERCPU_DYNAMIC_EARLY_SIZE < NR_KMALLOC_TYPES * KMALLOC_SHIFT_HIGH * sizeof(struct kmem_cache_cpu) 357 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ~~~~~~ >From the kernel config file provided by LKP, the building was made on arm64 with below Kconfig item enabled: CONFIG_ZONE_DMA=y CONFIG_SLUB_CPU_PARTIAL=y CONFIG_DEBUG_LOCK_ALLOC=y CONFIG_SLUB_STATS=y CONFIG_ARM64_PAGE_SHIFT=16 CONFIG_ARM64_64K_PAGES=y Then we will have: NR_KMALLOC_TYPES:4 KMALLOC_SHIFT_HIGH:17 sizeof(struct kmem_cache_cpu):184 The product of them is 12512, which is bigger than PERCPU_DYNAMIC_EARLY_SIZE, 12K. Hence, the BUILD_BUG_ON in alloc_kmem_cache_cpus() is triggered. Earlier, in commit 099a19d91ca4 ("percpu: allow limited allocation before slab is online"), PERCPU_DYNAMIC_EARLY_SIZE was introduced and set to 12K which is equal to the then PERPCU_DYNAMIC_RESERVE. Later, in commit 1a4d76076cda ("percpu: implement asynchronous chunk population"), PERPCU_DYNAMIC_RESERVE was increased by 8K, while PERCPU_DYNAMIC_EARLY_SIZE was kept unchanged. So, here increase PERCPU_DYNAMIC_EARLY_SIZE by 8K too to accommodate to the slub's requirement. Reported-by: kernel test robot Signed-off-by: Baoquan He --- include/linux/percpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 70bc17db00a6..1338ea2aa720 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -41,7 +41,7 @@ * for this. Keep PERCPU_DYNAMIC_RESERVE equal to or larger than * PERCPU_DYNAMIC_EARLY_SIZE. */ -#define PERCPU_DYNAMIC_EARLY_SIZE (12 << 10) +#define PERCPU_DYNAMIC_EARLY_SIZE (20 << 10) /* * PERCPU_DYNAMIC_RESERVE indicates the amount of free area to piggy -- 2.34.1