Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3345306rdb; Tue, 6 Feb 2024 15:05:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMKLIEQlk+ib8AUt5TJBzgb8DP5OKjNQlgOi1NyY2n4lYszVgXxwNKpxrlfbC/A5WWWdxL X-Received: by 2002:a05:6a20:7d9f:b0:19c:a03f:9e5b with SMTP id v31-20020a056a207d9f00b0019ca03f9e5bmr3390428pzj.5.1707260661046; Tue, 06 Feb 2024 15:04:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707260661; cv=pass; d=google.com; s=arc-20160816; b=D/HHrH3t15ow1RVlaPvEeW101wt4rtoZrx1gcSH8OHru+nmgb2Dp3H6Gzm7fo86s5N 6pT5ubrSa4qXBCdq2RJDW0vZNTJugsYm6mWmt3SF7rM8zle9WceCFPkIR2i2R4fa0ul/ s+1utb1FSakaHYiBzsuymCQLTup7BpKb0ujHQKQsAux3CAjaDQJzlgsAhjM+xsDBuSQ4 7q+XqFT3ASCY11VXHjqrE2kHNLahK0deVi70ZY2TjzcAGNaDR/J2QYdmStG86aG07pZ9 gDWmwV8Pk3RUCZ86VbILQIWo5+FUHmCL1r4CxJlYTe4g/GFmoWcoCo+UPiglgqTJH0JZ ckiQ== 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=x2uevoV7QT/myFwW9bt+ucwyUJAIkMP0TJJMY2tXLJY=; fh=5W8W/DB81uQK57ycCL+9ecfgyHJ9qXwLVvuff1IZD/4=; b=M0GSEhAMZ0p8BvYCm0YLute82N0b2Jz4s84AAkPVbIhCYnOELs063Btldc9X03Fvkd dmwmtcxgtY+rHTUpJQsvuXRuKCD0oWD6VVKnJ3jgOqnbsK5B1woLeai5WYPCsOXc2sqT 7WlB3BXkoO0A4+lwnNRBReSLXobO1YoxnLM03n4gprFEkFrBVhC6ZFlMq2azw/+kSqKH 1DqLyhD0E4dOKWHJo+VHnPPSa/up0LNlkhQIMe1AC2HJ83YgaCqYcm+ZPwYGnipfoiu+ Kdt4YdKhRCb1R5bzotYVvvZcQQ49Ys5d5QsG91phKBmafHrIRzSWebziwMLEON07tqfU kmhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=llIjhFqs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUTW+3lHG3JmnTwZZiprxNYR+DvR1z3nPVP9JW1+oUtyAjkktcsODQ4Bo1mUx1oKrV01vhga1+EVcNcdNy2cqZvZm6CqgZVqjshLUk8Ow== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x187-20020a6363c4000000b005d8bb95ce76si2594pgb.285.2024.02.06.15.04.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 15:04:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=llIjhFqs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55707-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AD830286264 for ; Tue, 6 Feb 2024 23:04:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DF351C6A6; Tue, 6 Feb 2024 23:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="llIjhFqs" 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 929941C2BC; Tue, 6 Feb 2024 23:03:51 +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=1707260631; cv=none; b=FMhs5cKzl4fk1ICjPO2SzkqF5sO3GDJm5OtZtNfSlVn6wUslUL6vPjwYAEVTG7XXB3JRye1nK+Wtd3rWdVzloP//0pBeLWb04+pQNZ3KMaIRCsaTHHP0+DCFyXxrfbiqhsqUsPXpFSAthYINOc3ppmV1M4oElnEzfrCuyNM0J6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707260631; c=relaxed/simple; bh=4dxokc2QPwkquTf9uWdCyBwcesXL5u1vQk+9x9lj0w8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=noHMu5Vd2sCzxqhdo4etUhC8Ga9QdZkvF2qcHAJMyQf9NkIv5mSLvlFO7gshR3AqAm+4dFetUzjYMuFvBnOqlh91QOPMNrm9Yxvvnj+2Cat6MH22YmBl4iGtMw7Ip32WNKGasyVkn11jYC3mM/sCOcpu3xzNrG7VyOEVl4BS+VM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=llIjhFqs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BDBFC4166D; Tue, 6 Feb 2024 23:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707260631; bh=4dxokc2QPwkquTf9uWdCyBwcesXL5u1vQk+9x9lj0w8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=llIjhFqsMot38UiBSgpMbrU3q1EyAar3dbkYydDusLNp4etlKKxgYYA8CSCeeJgMR UHtcQccrBub4GX8gC81MohKFqixZ/LPqBUqQeqjwgIsDVkb+lLLrjkuvyiIUscVXlS OZ1xXJcD/bBDPoJHZL2lZyY7GMfq/MMnxGSEOKq1kfuy4wKIXLj7l/5coA+anl82ix e/QN5QfVMxTuW9iMTOKVDNts3oDTcQjExG/33DV8FaDOwpCDPvsmZR3tJGMCCBoDMA dtHox/jdzVMmhApZ0Gl2cEi4q+/8X5Ljl6cKOsOdXAwtmkuaARNvjVrTzTGX9WMGj4 76dgvpN+M1BpQ== Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2d0a0e40672so589871fa.0; Tue, 06 Feb 2024 15:03:51 -0800 (PST) X-Gm-Message-State: AOJu0Yze7ZGktVyPat4K3p5Z3AB6GtagCPm/vgD7gSQbkmqgQ1pIiqsX hJY+NJ++HLazxM6Q9dslRAS6HBLh1VaXtE9SOIBzYqXGchC8czp8y3jenBKGKmLwR9jKMRvqrWv sEJA9CC0O/LpYmdlYYS3DezS9Vrs= X-Received: by 2002:a2e:95d3:0:b0:2d0:af6e:5cb4 with SMTP id y19-20020a2e95d3000000b002d0af6e5cb4mr1383013ljh.16.1707260629362; Tue, 06 Feb 2024 15:03:49 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240206001333.1710070-1-yoann.congal@smile.fr> <20240206001333.1710070-2-yoann.congal@smile.fr> In-Reply-To: <20240206001333.1710070-2-yoann.congal@smile.fr> From: Masahiro Yamada Date: Wed, 7 Feb 2024 08:03:12 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 1/3] 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 Tue, Feb 6, 2024 at 9:13=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 the correct conditional operator for int > type : BASE_SMALL !=3D 0. > > 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). > > Petr Mladek (printk maintainer) wrote: > > More precisely, it allocated the buffer dynamically when the sum > > of per-CPU-extra space exceeded half of the default static ring > > buffer. This happened for systems with more than 64 CPUs with > > the default config values. > > 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") Reviewed-by: Masahiro Yamada --=20 Best Regards Masahiro Yamada