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 E2874C4332F for ; Tue, 15 Nov 2022 04:13:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4D9446B0071; Mon, 14 Nov 2022 23:13:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4894F6B0072; Mon, 14 Nov 2022 23:13:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3519B8E0001; Mon, 14 Nov 2022 23:13:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 24AEB6B0071 for ; Mon, 14 Nov 2022 23:13:30 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E08CB120F3C for ; Tue, 15 Nov 2022 04:13:29 +0000 (UTC) X-FDA: 80134357338.27.B766EDB Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by imf30.hostedemail.com (Postfix) with ESMTP id 8DBB680004 for ; Tue, 15 Nov 2022 04:13:29 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id p184so9798193iof.11 for ; Mon, 14 Nov 2022 20:13:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+kzsiWXbAaTfTSEeYq53aj5QUY471/DVxdjgiIyCZYk=; b=EmSghIetjRv1ZmZBkoDVZ8hvMTnuY9OK0Zd81lxCB6RT6rJ1ceCmEMZzHm7U6CgVr5 JruWfXy5FkBrYrDpoo2kPz+6wcHVxkf4nrD5baYxYexg8/NfJ1wmkFoja7ZkoUsfFoqM uwkGNw086jnR+2paB7LfcaC17BfQQx3nWqpsW46QLixzwmPSihuEMnI6Xv8qWBEtDxdY v4e8Qy3ZA5OLyL/9KP8k+j5ir8ePjIc5XnWFuqbZPxWssrE2RJ787txViPI8dg8cj1Cd N7aj1qrDCquNre9zJmMKVBpAyMyUK5MAKGoo3xFDULlm4YgwiLWW5GwEqG08462KGRZ4 YPtA== X-Gm-Message-State: ANoB5pmGnHotLN+h1A9+CDtScPDsH4f21GsIQxh5/Wa9y8JKF7VmsMvj QIqmJTRyPqmfjl9H+TNW9Q4= X-Google-Smtp-Source: AA0mqf6GLmY2F1XnOyE6lkOe8a+C8EF+DY0gL6NgwHrGxPhgOeBj39sinxwn94OMrnYYlkxLpI3u2w== X-Received: by 2002:a02:ccf5:0:b0:363:7181:954e with SMTP id l21-20020a02ccf5000000b003637181954emr7170298jaq.40.1668485608767; Mon, 14 Nov 2022 20:13:28 -0800 (PST) Received: from fedora ([2607:f598:b99a:be1:dfa7:eed0:45ca:de3c]) by smtp.gmail.com with ESMTPSA id f14-20020a02a10e000000b003760a908bfasm2481380jag.169.2022.11.14.20.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 20:13:28 -0800 (PST) Date: Mon, 14 Nov 2022 20:13:25 -0800 From: Dennis Zhou To: Vlastimil Babka Cc: Baoquan He , kernel test robot , oe-kbuild-all@lists.linux.dev, Linux Memory Management List , 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668485609; 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; bh=+kzsiWXbAaTfTSEeYq53aj5QUY471/DVxdjgiIyCZYk=; b=8pwJnSyCZHFkhrDQgnJRPm7rzTOBaY7AVFzIeiqXwboKQUahlxQismBnSvrpWcHcLVzHBX rHqbjcANs7nWrkTVd3es4zAgE/0Vj40CRLhQCt4vSLNtyGFy8Pkv5ZUdbdbvwafPEamqPv ubEK8Nuba7HqrV7BeUmpcPrArm4G8GM= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf30.hostedemail.com: domain of dennisszhou@gmail.com designates 209.85.166.49 as permitted sender) smtp.mailfrom=dennisszhou@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668485609; a=rsa-sha256; cv=none; b=r2UxDQPztRzThHLwEB0/wSI1RtijQEQmiqDiWWKOrrwoAhx39arLZZrjpGpzOu7tYt5dtw 1yE+EFzUb4TdBYFbCFPc49A/LJ0IylsbxElbTUNNnqbSfl7PSh5f7MU/PD+xD2vv5FBD82 kfgQ16xLesZfY69ielEtOeRSzeOH8zU= X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 8DBB680004 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf30.hostedemail.com: domain of dennisszhou@gmail.com designates 209.85.166.49 as permitted sender) smtp.mailfrom=dennisszhou@gmail.com X-Stat-Signature: pfk9w3g7kypk6edppzxaxmpqmeqp1wb8 X-HE-Tag: 1668485609-820670 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 Vlastimil & Baoquan, On Mon, Nov 14, 2022 at 06:58:13PM +0100, Vlastimil Babka wrote: > On 11/14/22 08:44, Baoquan He wrote: > > 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" > > Since I have that patch in slab.git exposed to -next, should I take this fix > too, to make things simpler? Dennis? > I don't have any problems with you running a fix, but I'm not quite sure this is the right fix. Though this might cause a trivial merge conflict with: d667c94962c1 ("mm/percpu: remove unused PERCPU_DYNAMIC_EARLY_SLOTS") in my percpu#for-6.2 branch. If I'm understanding this correctly, slub requires additional percpu memory due to the use of 64k pages. By increasing PERCPU_DYNAMIC_EARLY_SIZE, we solve the problem for 64k page users, but require a few unnecessary pages that can bloat the size of subsequent percpu chunks. Though, I'm not sure if that's an issue today for embedded devices. I think adding parity to PERCPU_DYNAMIC_EARLY_SIZE with PERCPU_DYNAMIC_RESERVE is defined by BITS_PER_LONG is a safer option here. A small TODO item would be to make PERCPU_DYNAMIC_RESERVE be a + value instead of a max() with PERCPU_DYNAMIC_EARLY_SIZE. Thanks, Dennis --- diff --git a/include/linux/percpu.h b/include/linux/percpu.h index f1ec5ad1351c..22ce3271eed2 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -42,7 +42,11 @@ * larger than PERCPU_DYNAMIC_EARLY_SIZE. */ #define PERCPU_DYNAMIC_EARLY_SLOTS 128 +#if BITS_PER_LONG > 32 +#define PERCPU_DYNAMIC_EARLY_SIZE (20 << 10) +#else #define PERCPU_DYNAMIC_EARLY_SIZE (12 << 10) +#endif /* * PERCPU_DYNAMIC_RESERVE indicates the amount of free area to piggy