Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2165025rdb; Sun, 4 Feb 2024 19:02:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGt32JD6GZPBnZ6uz7YlIFqJ/Snsou26oTOOFjUy6d9glpZRVnT+o2vgYVtzmgWghAB4H6n X-Received: by 2002:ac2:5f5c:0:b0:511:4cd7:7181 with SMTP id 28-20020ac25f5c000000b005114cd77181mr1334653lfz.62.1707102174706; Sun, 04 Feb 2024 19:02:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707102174; cv=pass; d=google.com; s=arc-20160816; b=QT9QzKcHbUqokYxANfiem087mjJP9TbPSuDjIoHQbqXKXZU7GWiMLu9oOBdbBJrwAz if9/8fgPZVaKYbRgucA8bXlTbFWtAfAppmTli1aqM3O+36OO49FHUkNHf1UBUkyCzkrK Yp6W7wseU6EQJ/Iu6nHk4cjreg2W5ttcLWoz1l3G0T88tZc7YN9PviTfy/Be+5srYxpR 7egOxZKcRkND9i3Y1atvwuvjZTYoBb5Qh0HK7naDipSnltYuyVEmr3NxtkedWQz073T+ HAR5Jw7MG6X9zD6E9wGz4nOhxF30ODfLebwfPRIb4e8dk7spIR9NskCxUw/IYiLKPXa3 YPOA== 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=9XvCZmoHn6JEef5537V98tgEyd6EuP5WtESbZkkU96w=; fh=SSJDdK7AsmyYzqaGcPg52Jvnl+UUQSet8QC1BMSa5FM=; b=b5RE8ZAmAGHUTkYJWbXMASwMSSYWM2OoqhEutftJCdtHqwppvTO5snqp19CiahScHz +ulspM5+DoQmPPfVZG0KVGEOhjm6efpu0rql77C+/oJtYnShzam2lzXakW6iorNFKNDY X9pnjbATx1oeAap2uL5+7h8QNIry1Grt2IPhazbzYSSmhNAb1DcThJUNIIr04R96CFCa m3CORwbCbwgbkd0kmnKsOucesx10BUnLRZsCc4xpfL8XNaogCwqrsOjYe7bAhhtk82nq IfWCRwGlCjuoJy/kKKACY97522y28CTi8zOHvXoeRezHVF5ZL1QODRRMow24i/fZAHaq X0RA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MtGBMVqV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52003-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXf3dv69N8XXwNwd4vyyNFhAl1/CLecXisg7kDt2Cen7pPSeI5qKX7gh9tIFOiD8T82RDLoVk8ZJbdOZEgvPzIdtdCF/VGfg+5Ic5osyA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ce18-20020a170906b25200b00a3773bde933si1699844ejb.501.2024.02.04.19.02.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 19:02:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MtGBMVqV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52003-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6C86D1F228F9 for ; Mon, 5 Feb 2024 03:02:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0AC6944D; Mon, 5 Feb 2024 03:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MtGBMVqV" 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 16D01B641; Mon, 5 Feb 2024 03:02:40 +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=1707102161; cv=none; b=NACliYw/N0PLwG5FwMqO9x7KqBncfxYEIgQiiqh62Zs35SxHb156LRiioPCgCWJmrJfagFWIvE+kCZ2gSs5nZ61ACkn8yIvttf39+Npjz8CPZ0/cdg5l1drgvGpS93HMxEYFhmoUL7f92ZsruzH/TcGyEkcJ8p/Dx7TU8V5V3qg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707102161; c=relaxed/simple; bh=qT1MX0tGgCIx01o3HUieKOe4gx2/zz2JUXpblxvvwKI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=KsKL85z+ywsMGFyYI+9Y0KeIDo/HLlyPDpchOx3C34BiEoX4KUdV+dAapVKHGl8T9wEtmRdtGj1UGJIAOfhrazazKNlZsSIilz5fYtY8SZtxKrQgNB6XxCjpHUuxECXdTafQKaVlFGUlJfYrAbEkH745Ge+gheZmpAt6bb/agLg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MtGBMVqV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89C87C43399; Mon, 5 Feb 2024 03:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707102160; bh=qT1MX0tGgCIx01o3HUieKOe4gx2/zz2JUXpblxvvwKI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MtGBMVqV1HxT1psSgWLfa+yj7pd4hPZTmqsSJwZQf0pijI2cHLKNzDWlPoSaG9fQN J+H06NHSF2GNeET60cObpiGeC6Uub7eHViRIXL8i02hhzaJAtgwYdT/PLgKzPwJl53 NItPVNnvB25TrUe6W7t7OEuGxDx4uYx3eoofPl09TeGLojGFj1ZkIF9qoBzby2FjzR UoHHbn+nbYJuHAIY2kslg+/Mcy3OfY68vJmOmO01Ec5kLdZREUlgoKBqU3WaWcA1G2 +cyKdSm65xvIWCYN8PkmkKY9JMbL0VlmLDJ0rB9vUCw8Mdk0eqzkNFlnmCy0dMEXDJ CoGu6w78wHgTw== Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-51147d0abd1so1057144e87.1; Sun, 04 Feb 2024 19:02:40 -0800 (PST) X-Gm-Message-State: AOJu0Yx4GlxN1deUoqdEdDq3QC1C1lEpYpGxUOX9kDjvKfsKK6/g7A4t +HuHyHXyCzRSItLOcmzarDCJ4f8mEVa7VT81Onb7f8em9us6ZLyvS1JsaudmGGSLKKlbpQoHdWf EK0Amfs4O9EZgb6ln7txJ8VzCNu0= X-Received: by 2002:a05:6512:3e05:b0:511:3232:954f with SMTP id i5-20020a0565123e0500b005113232954fmr8402346lfv.2.1707102159152; Sun, 04 Feb 2024 19:02:39 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240204232945.1576403-1-yoann.congal@smile.fr> <20240204232945.1576403-2-yoann.congal@smile.fr> In-Reply-To: <20240204232945.1576403-2-yoann.congal@smile.fr> From: Masahiro Yamada Date: Mon, 5 Feb 2024 12:02:03 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/2] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled To: Yoann Congal Cc: linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, x86@kernel.org, =?UTF-8?Q?Andr=C3=A9_Almeida?= , Borislav Petkov , Darren Hart , Dave Hansen , Davidlohr Bueso , Geert Uytterhoeven , Greg Kroah-Hartman , "H . Peter Anvin" , Ingo Molnar , Jiri Slaby , John Ogness , Josh Triplett , Matthew Wilcox , Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Willem de Bruijn , Vegard Nossum Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 5, 2024 at 8:30=E2=80=AFAM Yoann Congal = wrote: > > LOG_CPU_MAX_BUF_SHIFT default value depends on BASE_SMALL: > config LOG_CPU_MAX_BUF_SHIFT > default 12 if !BASE_SMALL > default 0 if BASE_SMALL > But, BASE_SMALL is a config of type int and "!BASE_SMALL" is always > evaluated to true whatever is the value of BASE_SMALL. > > This patch fixes this by using BASE_FULL (type bool) which is equivalent > to BASE_SMALL=3D=3D0. > > Note: This changes CONFIG_LOG_CPU_MAX_BUF_SHIFT=3D12 to > CONFIG_LOG_CPU_MAX_BUF_SHIFT=3D0 for BASE_SMALL defconfigs, but that will > not be a big impact due to this code in kernel/printk/printk.c: > /* by default this will only continue through for large > 64 CPUs */ > if (cpu_extra <=3D __LOG_BUF_LEN / 2) > return; > Systems using CONFIG_BASE_SMALL and having 64+ CPUs should be quite > rare. > > John Ogness (printk reviewer) wrote: > > For printk this will mean that BASE_SMALL systems were probably > > previously allocating/using the dynamic ringbuffer and now they will > > just continue to use the static ringbuffer. Which is fine and saves > > memory (as it should). > > Signed-off-by: Yoann Congal > Reported-by: Geert Uytterhoeven > Closes: https://lore.kernel.org/all/CAMuHMdWm6u1wX7efZQf=3D2XUAHascps76YQ= ac6rdnQGhc8nop_Q@mail.gmail.com/ > Reported-by: Vegard Nossum > Closes: https://lore.kernel.org/all/f6856be8-54b7-0fa0-1d17-39632bf29ada@= oracle.com/ > Fixes: 4e244c10eab3 ("kconfig: remove unneeded symbol_empty variable") > --- > init/Kconfig | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Masahiro Yamada --=20 Best Regards Masahiro Yamada