Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1349106rdb; Wed, 24 Jan 2024 12:13:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJk/xUaIBH9ylOrQ8CJ/cd+Ez+iLkUsjH6OHi06Bt4ETsnyTzkzoe+XOqWWzoarfvlPxmp X-Received: by 2002:a05:6358:729c:b0:176:4b1a:8360 with SMTP id w28-20020a056358729c00b001764b1a8360mr97989rwf.28.1706127204749; Wed, 24 Jan 2024 12:13:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706127204; cv=pass; d=google.com; s=arc-20160816; b=HfDD1OeVnsftQGkMPp1QTW2eiJuvgKNRmVnWkAYvDOWzApwbChAFFFIkXkefAF82We hkWkoUfAnxMGEHip1Qbf3Z5daGLUD95BwlcbHBtYIr2orZ/vQFVudf0JEaVqqXx39skQ M/Jvuz8KbQscVo8ifrWQNrU268UpTUsSxQz0FKAFVgGxgz/mW+1E0E0XVw6ZZcw2h8By WJyEGMVBZglkSNZ2VPDo0N5vkKIcLKSLe2URJ8F4rzggfApWTNKY2hRbPPMgCSEgMWZU DQE9uDY0Flsrd+4NNDzHBWTiIdx4KjiAyLX8vWRhtLvewe7fSjGixEbExK3HaOmSh/+e FXjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=VhLbsQjcxA11HkrQnB+3eg6wpiyR5fBaPDrN2u2dC+Q=; fh=H5U8SK+H924fwGVQPudyy+OYa47r+Io+cV71nSudrLY=; b=EQu4vh2Sf8riBXQ86IzOu8zRai/AziR14QbiTzTHIcXx8q+VNz9sdn4o5IB+b/v9vG V4jFO6qx4FKSLvt320BcXR9UDuhKdWQwbuYBXL6Ivdz4nAOSP/ySpjSl0MYXmxHnZjEy mS79TknWpOz8JbbF4B4ziLLIjQGOwbU4w5w56YiPVdY1btunADdJSQehP9XIHHss3fpV lKs8F7S3LXM7DQF0/go1hbr9WVKHg1oRc6nPL5B0MHfUCMkC6XpVAemMjLba0qcqmI+v xjISp5+qRBIgN7hIlQXrMe8oymnlxWupjc2GS1n5Ssj/rOwFd8kuOV8jfRsEWtexjiUu jH3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJ5rCX0S; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37635-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a1-20020a0cca81000000b00680ce50b84bsi11310296qvk.567.2024.01.24.12.13.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 12:13:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJ5rCX0S; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37635-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6FE821C221BA for ; Wed, 24 Jan 2024 20:13:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AE46133433; Wed, 24 Jan 2024 20:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kJ5rCX0S" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E137133402; Wed, 24 Jan 2024 20:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706127197; cv=none; b=fgDH0Ump01ZC/JCFr5so1ynlldC7j6udllhuf2i9jKVbhIYoqSTVPfcmM+WVCuh5OAY6ddGLIiSpGTxX7Xzzr/pA8m5DuFFB7QfApegauEj+W6jrQDKrFZrXLY+/D0aDajzZSxnWBjcVXYu/vTHROFYU14evJJaOjMsbbwntq6Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706127197; c=relaxed/simple; bh=Twdinh4ZzSq2XBDa62Pj66mxim/LoN3y8w5gfBuM//c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=PZ6XK6I/EBe2MGP9Er5bY52JLzlFkX6xCkvXdUVF1vFzIx3H7Cb0LOdY1UR9DRWAsWuJL+4oKPVPf/A4OOBZkyZDNRbvzUd0Ks1CSWDRCsXIORgoEhxsmt4POmKkverbFuJEROxTNDSbqlKe7VfXNBZTnA5Xu1qCNiWz/Yp8Xjg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kJ5rCX0S; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91FB2C43394; Wed, 24 Jan 2024 20:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706127196; bh=Twdinh4ZzSq2XBDa62Pj66mxim/LoN3y8w5gfBuM//c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=kJ5rCX0SFT9rgDc/fP3b8dpnnHH0VuOjTzPSMKMqnrOlNp8Svp3qWxgijE5XF3Cri z8/7E8RTzSiKdrS52Ywyr3Sdv4C5mw1eV0bqrumWoFLyU8AH0uTL3kWPHD5aJYxrrc OdC35+REDjzsqWXWKk/DczEkXaUojRFZauhQ9iNyB7TFiPDG1Pzm0g1Fbd0ncZ4lmt bzUczuvI8yxYRGgh7NkNvt1aIhEUcxTIlSvC/Mwxn7ztbmwDwSClwXkzvMzqV16nn5 +DojygSfXlbb/aEWLgiVbY598+ewOxE4Qgkakdd6uypraeDtIWGyXyGb/aYOFBfGAe Kk+fPDRR6MGmw== Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-20536d5c5c7so3466274fac.2; Wed, 24 Jan 2024 12:13:16 -0800 (PST) X-Gm-Message-State: AOJu0YxraSA+RKNnDfl6cQO1MrDvaX4gnOd1bCxzASU7b46j0W50MmGW tTINYi3emtZ1ZXdnurL/yahS2BkDWCynXAVp2sVu/zQF/KJvIYxO7K+b+Fw+25vaN2AkfilAOsQ VRvk9l+L20Hn3Z/GPN8pHqYP1kWI= X-Received: by 2002:a05:6870:2008:b0:210:8b33:2c95 with SMTP id o8-20020a056870200800b002108b332c95mr3514557oab.108.1706127195872; Wed, 24 Jan 2024 12:13:15 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231125163559.824210-1-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Thu, 25 Jan 2024 05:12:39 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] kconfig: remove unneeded symbol_empty variable To: Yoann Congal Cc: Geert Uytterhoeven , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Linux-Renesas , Vegard Nossum Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 24, 2024 at 5:56=E2=80=AFPM Yoann Congal wrote: > > > > Le 24/01/2024 =C3=A0 09:09, Masahiro Yamada a =C3=A9crit : > > On Wed, Jan 24, 2024 at 12:11=E2=80=AFAM Yoann Congal wrote: > >> > >> Le 23/01/2024 =C3=A0 13:54, Geert Uytterhoeven a =C3=A9crit : > >>> Hi Yamada-san, > >> > >> Hello, > >> > >>> On Sat, Nov 25, 2023 at 5:36=E2=80=AFPM Masahiro Yamada wrote: > >>>> This is used only for initializing other variables. > >>>> > >>>> Use the empty string "". > >>>> > >>>> Please note newval.tri is unused for S_INT/HEX/STRING. > >>>> > >>>> Signed-off-by: Masahiro Yamada > >>> > >>> Thanks for your patch, which is now commit 4e244c10eab345a7 > >>> ("kconfig: remove unneeded symbol_empty variable") in v6.8-rc1. > >>> > >>> When running "make _defconfig" with _defconfig an SMP > >>> defconfig without explicit configuration of CONFIG_LOG_CPU_MAX_BUF_SH= IFT, > >>> the aforementioned commit causes a change in the generated .config: > >>> > >>> -CONFIG_LOG_CPU_MAX_BUF_SHIFT=3D12 > >>> +CONFIG_LOG_CPU_MAX_BUF_SHIFT=3D0 > >>> > >>> It looks like CONFIG_BASE_SMALL=3D0 is treated as a string instead of > >>> the integer number zero? > >>> > >>> init/Kconfig=3Dconfig LOG_CPU_MAX_BUF_SHIFT > >>> init/Kconfig- int "CPU kernel log buffer size contribution (13 =3D>= 8 > >>> KB, 17 =3D> 128KB)" > >>> init/Kconfig- depends on SMP > >>> init/Kconfig- range 0 21 > >>> init/Kconfig: default 12 if !BASE_SMALL > >>> init/Kconfig: default 0 if BASE_SMALL > >>> > >>> Note that reverting 4e244c10eab345a7 is not sufficient to fix the iss= ue. > >>> Also reverting commit 6262afa10ef7cc8f ("kconfig: default to zero if > >>> int/hex symbol lacks default property") does fix it. > >> > >> (Since I'd really like 6262afa10ef7cc8f ("kconfig: default to zero if = int/hex symbol lacks default property") to stay, allow me to try to help) > >> > >> The problem is quite easy to reproduce: > >> $ make x86_64_defconfig > >> $ grep 'LOG_CPU_MAX_BUF_SHIFT\|BASE_SMALL\|BASE_FULL' .config > >> CONFIG_LOG_CPU_MAX_BUF_SHIFT=3D0 > >> CONFIG_BASE_FULL=3Dy > >> CONFIG_BASE_SMALL=3D0 > >> Here, CONFIG_LOG_CPU_MAX_BUF_SHIFT should be 12 not 0. > > > > > > > > I could not produce it in this way. > > I ran the same commands as yours. > > > > CONFIG_LOG_CPU_MAX_BUF_SHIFT=3D12 for me. > > > > > > > > masahiro@zoe:~/ref/linux(master)$ git describe > > v6.8-rc1-29-g615d30064886 > > masahiro@zoe:~/ref/linux(master)$ git diff > > masahiro@zoe:~/ref/linux(master)$ make x86_64_defconfig > > # > > # No change to .config > > # > > You already had a .config with the correct value of LOG_CPU_MAX_BUF_SHIFT= (Maybe?) > > > masahiro@zoe:~/ref/linux(master)$ grep > > 'LOG_CPU_MAX_BUF_SHIFT\|BASE_SMALL\|BASE_FULL' .config > > CONFIG_LOG_CPU_MAX_BUF_SHIFT=3D12 > > CONFIG_BASE_FULL=3Dy > > CONFIG_BASE_SMALL=3D0 > > Try to remove the existing .config: > > $ git describe > v6.8-rc1 > $ git diff > $ rm .config -f > $ make x86_64_defconfig > # > # configuration written to .config > # > $ grep 'LOG_CPU_MAX_BUF_SHIFT\|BASE_SMALL\|BASE_FULL' .config > CONFIG_LOG_CPU_MAX_BUF_SHIFT=3D0 > CONFIG_BASE_FULL=3Dy > CONFIG_BASE_SMALL=3D0 > > >> > >> For what it is worth, CONFIG_BASE_SMALL is defined as an int but is on= ly used as a bool : > >> $ git grep BASE_SMALL > >> arch/x86/include/asm/mpspec.h:#if CONFIG_BASE_SMALL =3D=3D 0 > >> drivers/tty/vt/vc_screen.c:#define CON_BUF_SIZE (CONFIG_BASE_SMALL ?= 256 : PAGE_SIZE) > >> include/linux/threads.h:#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ?= 0x1000 : 0x8000) > >> include/linux/threads.h:#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? P= AGE_SIZE * 8 : \ > >> include/linux/udp.h:#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE= _SMALL ? 128 : 256) > >> include/linux/xarray.h:#define XA_CHUNK_SHIFT (CONFIG_BASE= _SMALL ? 4 : 6) > >> init/Kconfig: default 12 if !BASE_SMALL > >> init/Kconfig: default 0 if BASE_SMALL > >> init/Kconfig:config BASE_SMALL > >> kernel/futex/core.c:#if CONFIG_BASE_SMALL > >> kernel/user.c:#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7) > >> > >> Maybe we should change CONFIG_BASE_SMALL to the bool type? > > My first test shows that switching CONFIG_BASE_SMALL to bool type does fi= x the LOG_CPU_MAX_BUF_SHIFT default value. > > >> I'll poke around to see if I can understand why a int=3D"0" is true fo= r kconfig. > > Here's what I understood: > To get the default value of LOG_CPU_MAX_BUF_SHIFT, kconfig calls sym_get_= default_prop(LOG_CPU_MAX_BUF_SHIFT) > -> expr_calc_value("BASE_SMALL" as an expr) > -> sym_calc_value(BASE_SMALL as a symbol) and returns sym->curr.tri > > But, if I understood correctly, sym_calc_value() does not set sym->curr.t= ri in case of a int type config. Right. The following will restore the original behavior. --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -349,12 +349,15 @@ void sym_calc_value(struct symbol *sym) switch (sym->type) { case S_INT: newval.val =3D "0"; + newval.tri =3D no; break; case S_HEX: newval.val =3D "0x0"; + newval.tri =3D no; break; case S_STRING: newval.val =3D ""; + newval.tri =3D no; break; case S_BOOLEAN: case S_TRISTATE: But, I do not think that is the right thing to do. Presumably, turning CONFIG_BASE_SMALL is correct. > > Regards, > -- > Yoann Congal > Smile ECS - Tech Expert --=20 Best Regards Masahiro Yamada