Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp773047lqh; Sun, 5 May 2024 01:04:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkXP1DAprVuHd0WA3OrU6S8UPT6mjm8zV/B846CVGwCe3hUx6Thm40LmlWlLe3CXk3mkwIfXEeCuZIbXuov09fi3XO68ddKckf3pwV4g== X-Google-Smtp-Source: AGHT+IFXU9IRqVx417klHPjc9dfsWrCg3vcCv0BlmJDtte8X6pA6JGn07Yym4WDGGvg1CT5d+Yeo X-Received: by 2002:a17:90b:23c8:b0:2a5:e087:768a with SMTP id md8-20020a17090b23c800b002a5e087768amr7350741pjb.29.1714896284526; Sun, 05 May 2024 01:04:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714896284; cv=pass; d=google.com; s=arc-20160816; b=wBOrA5FT8FT8q9crKAxPSjYK36fvuRxFMJ2InTv/D2TTMmNkHlVmfNcp0AIGWrLnrk IHn9MxkXltUmYIvvByZx3+LZVsypfjn7WwInr0ZhbExfOPNAeLJD86W25tuOscUAu1zw 4hfLRdB6BHRB51f0dqiFnbl7I/OWcgrwjKh50aly7ufzUv3BJnnFPrXdlF/Zef77gbnM S5UTRqdv1+wRp0X/sqG0ePIafTlU/UcKS+5hrzCFlQd3/2BvDp2p1TEL+dZLgOfG8hyb O9c5ax+a5B5Tjy9FTEUQJu0k14SWs7Zgk7gHBre1Sfbz1C6Iv5Qr5tZA3afkfxXvUdVL JgTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=x7A8dE17N1A44dcO35ZoDRK7fDnlK9Qrxz49fhZ+FnQ=; fh=Qg4dLrg4lHgbj4TmvqjtkrFPeIS7K29OLx7C9zOgR5I=; b=d0LDSlGA+AyjUkP6hdLLSukKdHIKZHBOqHPJchI8jINt/65rP0bEXk4QqnKyctTw1O nBZXNp++wDIosQSuoT1Yey5hxYilkpThH9f5MGERMC+DXFNH1LwM8wzmB7cQEAOS9U7G QkByt/kJl49FeXG6tri0/7fjDFCdd+rzmLStNQddjTdcZUwW3SVUIIkEHJzUXCFLu5l3 4Uc55GQr9xQs3MUHzFmKOoT/+dTMgAZGQP0Ece4ByMriuL0wJ+dETQfgplfPsTZk6fd+ fNypE2T5yKwUknqF04F4zbcU9zFSxCkLHL+jz/mYmlQFf9+DqILxSZxFyJMS+EiSKIsI 9vJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=vQygRbFB; arc=pass (i=1 spf=pass spfdomain=smile.fr dkim=pass dkdomain=smile-fr.20230601.gappssmtp.com dmarc=pass fromdomain=smile.fr); spf=pass (google.com: domain of linux-kernel+bounces-168914-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=smile.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r1-20020a17090a438100b002a27f4c5d43si8615722pjg.66.2024.05.05.01.04.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 01:04:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168914-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=vQygRbFB; arc=pass (i=1 spf=pass spfdomain=smile.fr dkim=pass dkdomain=smile-fr.20230601.gappssmtp.com dmarc=pass fromdomain=smile.fr); spf=pass (google.com: domain of linux-kernel+bounces-168914-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=smile.fr 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 27E62281E76 for ; Sun, 5 May 2024 08:04:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F60EB662; Sun, 5 May 2024 08:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=smile-fr.20230601.gappssmtp.com header.i=@smile-fr.20230601.gappssmtp.com header.b="vQygRbFB" Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7685BAD48 for ; Sun, 5 May 2024 08:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714896259; cv=none; b=Pi6ldLq1TcM9S2PSkPDiKeIzwi2eU9HWECeE54vsgyCWl+PJmhsipJyKa+cPNpBLlxdyKGn/UycA+GbYnsipOp0UgRX8CQFcYdBwM4HU1ZVLFPzZ5J5a2TIaLGalwB+/IUIVLVrHmiivO5OfViirp9ZZVfYXQQXj8+M2qJBjDWo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714896259; c=relaxed/simple; bh=ulZeqyMK9SIzCAJwRgdu/XvQvdV7+I9mcGDrXJ3xQl4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RkVvvpQvubG2QFN/1TmwAm5lPM/pQtvAU2iJ4gAbubURqU4YVXfsIJgzC8ezK6wpujBZ6HIbwQtYMJr1/mCBzt2pinkIg+tctCE3KQtlCvOyIGkwxJ6/hTlMl56PgEcLrsGZUoPQtDVDTuRnn6RR5KUAt0MzvAXpgeKovr0cqHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=smile.fr; spf=pass smtp.mailfrom=smile.fr; dkim=pass (2048-bit key) header.d=smile-fr.20230601.gappssmtp.com header.i=@smile-fr.20230601.gappssmtp.com header.b=vQygRbFB; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=smile.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=smile.fr Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2e09138a2b1so11889821fa.3 for ; Sun, 05 May 2024 01:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1714896254; x=1715501054; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x7A8dE17N1A44dcO35ZoDRK7fDnlK9Qrxz49fhZ+FnQ=; b=vQygRbFBemTaFxNuEfbwj8eaibSHDDFoLOOIiZsUuvLcBcG53asbvrHYoLK8vTIh4c K5RpOTJpxpUkQGOQ6J6Nlt6OgitZjcIh79l5LGQvONg+XMA801CHG5IDHkUV9Vq285Zr FfBV3j0a5Zs3usxrJuGoQ9SWoTGkRwvYh4tx2bHdq+QSktnDw7jPQGAyuOMRXsmbAIE1 uw0Q4DE/AjpPk7aH81AmE20suFb9g4vO/18f7A+94ZwfhAsDo53lpxSTGkU4QTH4hE5U lFr7O+WNJcK406JjTqtJjMalqP5ufb1uskb2eHURa7Wza+Uk7aoPcRLCeUkzKZeCE3yY pBmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714896254; x=1715501054; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x7A8dE17N1A44dcO35ZoDRK7fDnlK9Qrxz49fhZ+FnQ=; b=FhPhHA/sJ76pWrrUUzJFfXg0F31lpsJab6hLU39pLdH8Zvs8KF+JH4Vf9cv72kE0fC I6yfTKcmBQoDlQDMS+sOJ1p23wYKUut0IbwV2sD/i28/n/rZ/lDShk8YOKhtG/E+EKU0 Ao2qS6akIpJj9OpDV0PkPzQvmbdVH/oATCc/VuGI3QUV7ETYaT1wJJTC+exnVNbpSe8f XWFfDNE+jbErxLWwA3O/ad79apYww4Y9sSVPLI+yQ1cwJjb1urhotA303HtH5D0ok0O/ PwYTPeHkjV8Lcm0q94bjd3ci/cp+/qQuIAhc0RMJPNcqmuFDF3vNEDsRuPHYb2bnQQio EKMg== X-Forwarded-Encrypted: i=1; AJvYcCWGzFpowjqP89/TnMEPuRG1Jxmxl3hZHkrLvajXfdtZe8OeseNs3zMHCERSUzXq3OGFmFjw9P0GjA1/rhKX27aF7Tz2giLvjcLCxFdX X-Gm-Message-State: AOJu0YytIemH9oLfLt7L3ThFdACFzJRWVypZb/qz85QDLuMmWUEQIsL4 UVydVl058Xd2Vayci3aUuA/HEmjvc7ZekD9TMKFubKKuwXTs/ICeMF4qo+hsEMU= X-Received: by 2002:a2e:9e07:0:b0:2e2:7f2:9f9d with SMTP id e7-20020a2e9e07000000b002e207f29f9dmr3944919ljk.24.1714896254378; Sun, 05 May 2024 01:04:14 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local ([89.159.1.53]) by smtp.gmail.com with ESMTPSA id s3-20020adfe003000000b0034e8a10039esm4705295wrh.10.2024.05.05.01.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 01:04:14 -0700 (PDT) From: yoann.congal@smile.fr To: linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, x86@kernel.org Cc: =?UTF-8?q?Andr=C3=A9=20Almeida?= , Borislav Petkov , Darren Hart , Dave Hansen , Davidlohr Bueso , Geert Uytterhoeven , Greg Kroah-Hartman , "H . Peter Anvin" , Ingo Molnar , Jiri Slaby , John Ogness , Josh Triplett , Masahiro Yamada , Matthew Wilcox , Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Willem de Bruijn , Yoann Congal , Vegard Nossum Subject: [PATCH RESEND v6 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Date: Sun, 5 May 2024 10:03:41 +0200 Message-Id: <20240505080343.1471198-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240505080343.1471198-1-yoann.congal@smile.fr> References: <20240505080343.1471198-1-yoann.congal@smile.fr> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Yoann Congal 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 != 0. Note: This changes CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 to CONFIG_LOG_CPU_MAX_BUF_SHIFT=0 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 <= __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. Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/all/CAMuHMdWm6u1wX7efZQf=2XUAHascps76YQac6rdnQGhc8nop_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: Petr Mladek Reviewed-by: Masahiro Yamada Signed-off-by: Yoann Congal --- init/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index 8426d59cc634d..ad4b6f778d2bd 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -743,8 +743,8 @@ config LOG_CPU_MAX_BUF_SHIFT int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" depends on SMP range 0 21 - default 12 if !BASE_SMALL - default 0 if BASE_SMALL + default 0 if BASE_SMALL != 0 + default 12 depends on PRINTK help This option allows to increase the default ring buffer size -- 2.39.2