From patchwork Sun Feb 4 23:29:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 196599 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp572833dyb; Sun, 4 Feb 2024 15:31:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1Y9c3sxNHFcuf/Fy+xcgetYJHn87zD6yGXS6WdYU5nS3vBBzZlfssYW+jpgiVe+v+8/CX X-Received: by 2002:a05:6a00:4fc4:b0:6e0:4b8f:f585 with SMTP id le4-20020a056a004fc400b006e04b8ff585mr118028pfb.7.1707089517845; Sun, 04 Feb 2024 15:31:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707089517; cv=pass; d=google.com; s=arc-20160816; b=A2Jg3XIYhZF/jDeM3dOrwK3+bJTWDsbWijKDIahbvfqbFL/ObZ6ptsxFVZNQqWVW7T wynRQQhtTzvR6dMTOLcuZWoQsaj9c1n0SaeedCvTvTJ5issr5mA2TJ7MqTmG1P0fhKk1 3LYaUM8SS64R/aCE8bAXzJlfmbEFrWKs4+B95c2WFIpb5b+71ooTp9HuKIb+yRd3vtv3 obWoP99RQ7bPdwSZqH3YDqY5py4rQfaB+RZMjzzZi02Z5p0QE+GtMFEXJEuv2fdQ4+/x LAHNtDAB1mM8DDJr5G/k+ob/wB4O+BIwMiXZT+KYD0WeHW3eSNmAUkqVATPEdbIi+0Ne k7Og== 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=xxGWGp+6jPj4xTLQgzHWqH1VGj7PXUyGIryFKMHnKQg=; fh=7lzotAyslxzfCxEXsbfAYAh/lV6VuOcU6RSHmJigmdA=; b=UFya42N1I2dSdY9qolyPz748YRzv8awFzV3zR7Xiox/Q1s0CWs5TgYiPXtLLoaPMuS yefRoZJDFKxSRuxZ2LijIBm76YgRBrB3oUrE/omCdOWzectlCer6Bap4IHHwN3dABqGD hCsyHFzUHiOrfynln8nKe6Jl1ou9V5ssytuCFnZ1Qjebs/sya3x/3WjrhGlf4mgRbtIB rWH1gfTjNGrTmZK8WtLabVedj5TtsyGhfLCF/LXtJp3ArS80p+dJW6EdgQCAgOiLYWl9 ILAkIT7Ukl3jqauo1+ft1bwVKjdhlvNZYx2hlGqEBT00tig2Eycf5oQof5QxzUt7Zyja n2GA==; 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=lbK0svEw; 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-51943-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51943-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=smile.fr X-Forwarded-Encrypted: i=1; AJvYcCVm1s+7DHYLD3xBGBkr0GbCT8Pu/Dm/yi0xRGLXy/E9COGh0t+Sv3jtcBCSDV/3Lr8xKX92bkgkJNC3hEZKJHdleWsMLA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ay32-20020a056a00302000b006e03c0c53d6si1550840pfb.206.2024.02.04.15.31.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 15:31:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51943-ouuuleilei=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=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=lbK0svEw; 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-51943-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51943-ouuuleilei=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 95429281BA3 for ; Sun, 4 Feb 2024 23:31:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A82A12B88; Sun, 4 Feb 2024 23:30:28 +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="lbK0svEw" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 62918BE4C for ; Sun, 4 Feb 2024 23:30:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707089425; cv=none; b=jF27o3zwVva3LKkXSC4/sPYI7MQ9O4P0b9Lvg1yIPpF+IVhAWs3FTcnAJ5BmNk9GbL7+nnoHX211uuwpt36DkCppH8pogK1JTGLdDI0+Zy/ZVpC74UCx/DHZhlgIgTRLTr2Qx7h/P8dzdfGk18itkYrcL4+nGq7GQmRTvdYe6JU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707089425; c=relaxed/simple; bh=wbFIUY1/ZnkZ/DTm8DYHOzPmMvhx+/DzwbZmttnRxbA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s4uSH9NB3r94MBNKddxlnmSc3uzJWoCmKbu1yrkvPmUsNrdlI3dECnIbfK00hpVwQxpv4l7wHiOeGDhwXwY9ic+uoWJzkueuYOHb8WCYqpBeM7XNzycwylzQBxfKcoLBw4lTygYdIgxGOF4K0FdwA+i8G1ZQ1SZNzAiaBNBCChA= 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=lbK0svEw; arc=none smtp.client-ip=209.85.128.54 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-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40fd55c7f93so8150825e9.1 for ; Sun, 04 Feb 2024 15:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1707089420; x=1707694220; 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=xxGWGp+6jPj4xTLQgzHWqH1VGj7PXUyGIryFKMHnKQg=; b=lbK0svEwzZZ5d4E9LL+aSa08tsSGsXyvw3oRuHWWRTeLqrcKBxXHf+Bj9V4sED5VmE Y/7aNyYJQAtG3Ho9iwwVI3+4w/KlwPclKquGK+und/XqaX48Tlqu+r7hb/1jhSG//3Qw gxPJARaC/sduZci3Fu/OPXkxTPMrYewZIm+nn8Ru9RD1Sj8RWOtdfx+LPBHiuPHjDoFr 8kBz+OwxaIw3XS9zChjJHmoEQZtONSCeCck9wtOKf7SP6cYAD1j/9e6OuHe02CLHWLH1 jnjfwjauRopKJL8E4JkTU/kp62+G45XTfIQxbtl69FVABTqCAlL15SstfrPmK3dNsX8J bITw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707089420; x=1707694220; 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=xxGWGp+6jPj4xTLQgzHWqH1VGj7PXUyGIryFKMHnKQg=; b=N+8aNPGOEHYgklo5P4uTUiILEdnGrAkwBo9XucQMMkqEY+OAHsNfVRPOi6Rn/FAEZ1 7LCsuOJ6LITGjjIAA4lhcwnOOiSPIDuJuRDwGvK9+61/elZJUnjcmnqXsvd5QXToKLLL s+5KNdzPPX5Ab3ZBA5qVhbt1QI1q55ezznGiIqf0BeSyKXi+43tTGwkFpfnjB1NCiliF s3SmohSCJek1bUrvxY4C0bD9SZExlr/+KRz+s63BYtL+qVZp23kk/wocfyp7G4QS+K85 tQT6dT3Geq4gJOinn6kLtA3K/Xqt1T8tBP1IFZ56riaPmA63068SqkGMdkUThP9j510q A/3w== X-Gm-Message-State: AOJu0YyY1CcEgLLPCXNUbabFOMIZWYFk6JiHHBU++bw17J34h1M0Iy5W w+2Ru60DXhz6MtChbvWhT82YclsgLe7aBW0oi92kG9atXAWYcjerFROqzIzGhbo= X-Received: by 2002:a05:600c:4fc7:b0:40e:f656:39f with SMTP id o7-20020a05600c4fc700b0040ef656039fmr3577612wmq.6.1707089420627; Sun, 04 Feb 2024 15:30:20 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCX/iKPsTLU6Hi82jp6bWBEzSAl/HiRvzAsG3U3m/tDs0QY8pyvyH6sMvXqECuguMeq2yUIMDK5e4Moqkkk7H8COHkS/CxIT/BUm9qt1zVjBRY0XYwmJKifT3jJvJJLnDPjLvZxb+yCmBQTb/ppIZyiLBVJzWAl+umeVfZvPpvW5uVrAcch0We5hetX/CSo9hcGtehY/IckhhBWBAfFLQb2q43lgYimgFZ/jtLR6onScdb5AT+HFoVTb4XzSWeCTChLkuO7f5XGuijB8vlUrd096viUEW3gfOeyr0Ah/bRmBokCkW5EWtbJOXCUMiQIYRcaVg4i/YF61nGWwTmEyDhot358jC0DpwMOwGRQz3wEbNvSAHyw62y9/Fx0UAStNxlsnNpsKjE1sMsJrtHVkb8KOsMQlAQBroyNXSAwpupBCebOZKV+ME0shzNK3E8+p0BvyD/LV0HsjEUQkN3w948K2LBVhxtIDbbv8PO+9Grpns8qMXU+gfUellJ0GzW15V7OTL3gdCAR6X9uhzrtc98FuDrpm3iNZoT42VJ5cRtMhzvS0htQuQH+viXAF0tf0a91O0yFiEaRIs8nMg+9oR2iTVXeL7MhmwIhaVjxmXo262y0YEelNBNZfHNsatK+fxEwlkC1KIZSSUFlEx6FI/A2tJtyR+nR+S0q50EdSLOnhZUOVA5uhJFpc8+4MW+twFqMuOSWyGacVWQa5gFsc6X/5LmAXtlhtdbbtkyHZtE03hyihx2pCBzqK5w4GClqrdE7kuo9WteMoHQe+0ktIfn7iP7iLAi+E2Zx5W/KWXNNbMoTxRWwzCaS0CS/SOGslAA== Received: from P-ASN-ECS-830T8C3.local ([89.159.1.53]) by smtp.gmail.com with ESMTPSA id n13-20020a5d588d000000b0033ae9e7f6b6sm6822576wrf.111.2024.02.04.15.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 15:30:20 -0800 (PST) From: Yoann Congal 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_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 , Masahiro Yamada , Matthew Wilcox , Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Willem de Bruijn , Yoann Congal , Vegard Nossum Subject: [PATCH v3 1/2] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Date: Mon, 5 Feb 2024 00:29:44 +0100 Message-Id: <20240204232945.1576403-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240204232945.1576403-1-yoann.congal@smile.fr> References: <20240204232945.1576403-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790013098499033792 X-GMAIL-MSGID: 1790013098499033792 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==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). Signed-off-by: Yoann Congal 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: Masahiro Yamada Reviewed-by: John Ogness Reviewed-by: Petr Mladek --- init/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index deda3d14135bb..73efb76f38734 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -734,8 +734,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 12 if BASE_FULL + default 0 depends on PRINTK help This option allows to increase the default ring buffer size From patchwork Sun Feb 4 23:29:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 196600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp572867dyb; Sun, 4 Feb 2024 15:32:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjCO18rOc7HcfKTbSePjeopmU77RoGArDY5+ONrTZBs55ZFiSqhhwDlTtBy1ShzVU3qRb9 X-Received: by 2002:ae9:e713:0:b0:785:69cf:8cd1 with SMTP id m19-20020ae9e713000000b0078569cf8cd1mr3559058qka.60.1707089524316; Sun, 04 Feb 2024 15:32:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707089524; cv=pass; d=google.com; s=arc-20160816; b=elSb+tiJOgVaQj6UI9xm1NpJZen79sTUvDlJszgx1MryJs0aX5dsmG9VU2I8nB7XRE 6KTsL82UzurWAnpU0RxV19VfksVzAM+HaBf7QArk5SQ8oF7H/RU8PB3Y65Fno1iw4cdh 8/tI+kV6SQDaJTZTzZPYvIfJVPNApk0F638R0s8i/t8hysP2DwVHvTTyx+ZXIm34qUuk 3ijYGv/QENZlSvKdRLc7MrZHBcIuIu3f6q/+xX6XOiAbPd+tpV4eqx7KsGxmwfMeFAx5 mV8c5tY+3eE0UuwCKJItnTJx7Yghfi9nXCuaJCeqpptNuBVVI5FJfWqGtRu+yWH4VxUy WVUw== 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=BqOh5UyldPlxDYLA+1PFmA3uJbDUnT3VqP7toNyEhUg=; fh=/QGIgrW2Rz7ZMaaSJ2yHB1EgejyWkefBhRRYjnLJKKU=; b=Q6JpB0151XIDCvKgvz1DLlxiFoAae0gdhASGlF3jdErimV1pPhw2Y2lDFOyjaXG+Ex u4r12gG3RVKUZ1wNreLPZGBiPrJtaD4EfVifMUY6q9WNKX6jOii3OM+bt+V3In3dWzL5 EeSad+5bVWrHdmoeTQe2jAiol6hKgUQmM4RbErvXKXrR4VLQa5erPkDJ2rjpiovJK/Mk +x1usbOEa1F6ln8XExUEEWk4Yaapijpg8btsFlWCR+rHzqBbjDk+3dNI31Jr6EbVSShO cYBSCMi3/XbEkP3j0DV8okskvk3ATIVUp7oXpHoETxnDTKGATsPS/U9CH4FAd/gUGY1A svwA==; 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=muUTaTJw; 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-51944-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51944-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=smile.fr X-Forwarded-Encrypted: i=1; AJvYcCVUdE/tv/6j1+Kchj5Sw5Ys7VTi7bVV0JHFqQCkz2yT+PhaAu8/yKw4Tq2DOyYuGnFPbrjlSuIUzDlSnjjAXNPtl8J82g== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d13-20020a05620a204d00b007840c63ac10si7296789qka.748.2024.02.04.15.32.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 15:32:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51944-ouuuleilei=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=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=muUTaTJw; 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-51944-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51944-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 11DA11C21DD2 for ; Sun, 4 Feb 2024 23:32:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9F5612E6C; Sun, 4 Feb 2024 23:30:29 +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="muUTaTJw" Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 AAEA6D310 for ; Sun, 4 Feb 2024 23:30:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707089426; cv=none; b=oXwtY5r/hVzJgS4gByaYE4lVjJ5o4OYwD/KjCHkrxB4u0yuvUvJxjFT9jD+JqXis7mHI+LOczoCRuC/IxGbpMNc+JglKtlnJ5Q2OB99q3aRt8Fcqc44cn9broOIawyTRZ3QXR2nhPCeaBMF+wTv383lRgpAcD6flKX0p1PbGJdY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707089426; c=relaxed/simple; bh=WDz9XV+IcN+z75ZIj0kVamVYFOuRXwS6pV5NF9q1TH0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aeHAnNlGI8nd0eeSP7P186F9wTqIdeOlHMP+4eQuIM0rpl3MhsfGvnDKuJ3o+1vQw6oqjZWxlB+6QArpoC+HczCwFk0E01PpntbwFNgCcwa9bXD1YZABlTj/NHXu77jWwamANfthr4ZW4pOOFbS1tq+L+y4CZfdovZ0IsdjcHV8= 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=muUTaTJw; arc=none smtp.client-ip=209.85.128.47 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-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40fb020de65so34540945e9.2 for ; Sun, 04 Feb 2024 15:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1707089422; x=1707694222; 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=BqOh5UyldPlxDYLA+1PFmA3uJbDUnT3VqP7toNyEhUg=; b=muUTaTJwJExYJc/dt80T+cbhld8/8j5PoOnmfw7yg7RpL0sdnNqtWOQHK9tk4/I8sn 9MNoEUemKa0WQz4I8JeEhGCmM/8GHcQtDdGs4D6kGaMQRmiP3d2IUZVin6oes3INhJtd JwEmj+bFq3klM6HB2SvpDfgdHOp7PCKD1BrZAAG5ySuPA1ztk1AJJ9b8ez0UAEDl4CD8 3CuVS76xBnzByKnhONKwi/oqBDe+dvaDeyVjx/JP/wofw2WhpiwCfR0tNh6Mr834zUlM LtSirslhsyLmWUWSFNfUjPoUdTSuuSxlhIeU1UMqwiL7Ffi7pObK/mBTpyxZJjOyz965 L6VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707089422; x=1707694222; 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=BqOh5UyldPlxDYLA+1PFmA3uJbDUnT3VqP7toNyEhUg=; b=IpIqxA0O+h6APzbbfFyG90pbmfxrCopD0JAi1ey+5nYiB3vijuFA36awJzJWP2HvkR GVjJTLpxpTbkQqyNYqqD9WpQ1ZW70xACwcK0NVR+aqdYUhRvaFpec6w2z0zhHTB8i8dJ 2Q4tZ+DyJQMZtNFT1zKl/3rucCUKri2uiGBTLvKd+MnJl6qwke5Kyfw7HDhw61ow1+MD 4JsVs9Ac+8lxIgusJUtwf1DYTip5KdcQu2GUfY4LnqUxIeO31N1HG1Rg+kFw3aSWXK0P ZQmdaQ3I+rnKNX692QR6E72tthucptqRH6UwGHLldRStSKEi9E6XfjEKMg7Rt14dagJl QsBA== X-Gm-Message-State: AOJu0Yy6FgdI4346rS21XEo5/YR0GyMyagpM8U71d8/gsfySE/fkm2cv TV6LMbpm6Z2RRKQXN2hE8GRp3Pl3JulxAY6b513VzCbzY0dOJCQkM+RDcLC5Y5Y= X-Received: by 2002:a05:600c:181d:b0:40e:f736:8152 with SMTP id n29-20020a05600c181d00b0040ef7368152mr3002467wmp.14.1707089421843; Sun, 04 Feb 2024 15:30:21 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXcvNauzoQLlS3V2rUQ2XoowHf8tIE3g5cfPJeRLKnVxargL9QsLMJDXjVf7tWSVT1BTPxHRNT0OBeCZnWaqdMS6qKZjyvByIzEK36mR8GkMGc+aM4kUT1HVS6fEcLn20Q7C6rxrOws2StgCxWRlOnbUdkBSWF5qNoVeO4SutgE+GsrFVhOkv/qZT3PJpaagoyPDoCpTAt3SM5ZuFf9GG7ySfo6gTGSYU2sypKzk3ODpY/1A+wRlG7HGljs2FVYhV10gep79DZgB5AIQZVz+bU38OUBQXgnObJ2lkj5BTpKr5ss+pGtRUdzJMrsmAFBwCS36HLWktc3A8pacqMht3ss/Gl9c7BHDywWxlaX+0R+qqfXn5x8uzjTo3CqZJFw0GEufxkvE5uxGK/4ZD3248E8DPTyo357Jd4/F40izCw4CkLykJpYktJvJs/221Zfaeghq9yb6tGTHgUMe3WQ0gtGoy3A3LZ9LAAkBluxaPI2rUxsQCBXNNWslbLvKV+1GNH5jbdQAog4EURqUI5wlYW1fyVVQftd6YgIcKooXIg7UKpBGsWN4GWeJzetGzU2kijHInv+ml1ZkzatajHtScXID9DJKjKCA6yZy4gnDzZYjRuwlBnLKkfqbtu4IrknGiaweo0y7VqEs5cmTotHIw48Rtw9KaMY3u/S64F35tZxTMnMlmIVs/9XT3ABI3Ah2M+8edVHQ5/J52BsOqfCgblsrDoQKZTGfE3QgIBuPt2Dg+nk6cbvOB9rlNbpyEPoFqlX1onfbC2TMf0o3248k45wFsB+ziA= Received: from P-ASN-ECS-830T8C3.local ([89.159.1.53]) by smtp.gmail.com with ESMTPSA id n13-20020a5d588d000000b0033ae9e7f6b6sm6822576wrf.111.2024.02.04.15.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 15:30:21 -0800 (PST) From: Yoann Congal 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_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 , Masahiro Yamada , Matthew Wilcox , Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Willem de Bruijn , Yoann Congal Subject: [PATCH v3 2/2] printk: Remove redundant CONFIG_BASE_SMALL Date: Mon, 5 Feb 2024 00:29:45 +0100 Message-Id: <20240204232945.1576403-3-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240204232945.1576403-1-yoann.congal@smile.fr> References: <20240204232945.1576403-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790013105231817762 X-GMAIL-MSGID: 1790013105231817762 CONFIG_BASE_SMALL is currently a type int but is only used as a boolean equivalent to !CONFIG_BASE_FULL. So, remove it entirely and move every usage to !CONFIG_BASE_FULL: Since CONFIG_BASE_FULL is a type bool config, CONFIG_BASE_SMALL == 0 becomes IS_ENABLED(CONFIG_BASE_FULL) and CONFIG_BASE_SMALL != 0 becomes !IS_ENABLED(CONFIG_BASE_FULL). Signed-off-by: Yoann Congal Reviewed-by: Masahiro Yamada Reviewed-by: Petr Mladek --- arch/x86/include/asm/mpspec.h | 2 +- drivers/tty/vt/vc_screen.c | 2 +- include/linux/threads.h | 6 +++--- include/linux/udp.h | 2 +- include/linux/xarray.h | 2 +- init/Kconfig | 5 ----- kernel/futex/core.c | 6 +++--- kernel/user.c | 2 +- 8 files changed, 11 insertions(+), 16 deletions(-) diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 4b0f98a8d338d..44307fb37fa25 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -15,7 +15,7 @@ extern int pic_mode; * Summit or generic (i.e. installer) kernels need lots of bus entries. * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */ -#if CONFIG_BASE_SMALL == 0 +#ifdef CONFIG_BASE_FULL # define MAX_MP_BUSSES 260 #else # define MAX_MP_BUSSES 32 diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index 67e2cb7c96eec..d0e4fcd1bd8b5 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -51,7 +51,7 @@ #include #define HEADER_SIZE 4u -#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) +#define CON_BUF_SIZE (IS_ENABLED(CONFIG_BASE_FULL) ? PAGE_SIZE : 256) /* * Our minor space: diff --git a/include/linux/threads.h b/include/linux/threads.h index c34173e6c5f18..f0f7a8aaba77d 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h @@ -25,14 +25,14 @@ /* * This controls the default maximum pid allocated to a process */ -#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) +#define PID_MAX_DEFAULT (IS_ENABLED(CONFIG_BASE_FULL) ? 0x8000 : 0x1000) /* * A maximum of 4 million PIDs should be enough for a while. * [NOTE: PID/TIDs are limited to 2^30 ~= 1 billion, see FUTEX_TID_MASK.] */ -#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ - (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) +#define PID_MAX_LIMIT (IS_ENABLED(CONFIG_BASE_FULL) ? \ + (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT) : PAGE_SIZE * 8) /* * Define a minimum number of pids per cpu. Heuristically based diff --git a/include/linux/udp.h b/include/linux/udp.h index d04188714dca1..ca8a172169019 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -24,7 +24,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb) } #define UDP_HTABLE_SIZE_MIN_PERNET 128 -#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) +#define UDP_HTABLE_SIZE_MIN (IS_ENABLED(CONFIG_BASE_FULL) ? 256 : 128) #define UDP_HTABLE_SIZE_MAX 65536 static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask) diff --git a/include/linux/xarray.h b/include/linux/xarray.h index cb571dfcf4b16..7e00e71c2d266 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h @@ -1141,7 +1141,7 @@ static inline void xa_release(struct xarray *xa, unsigned long index) * doubled the number of slots per node, we'd get only 3 nodes per 4kB page. */ #ifndef XA_CHUNK_SHIFT -#define XA_CHUNK_SHIFT (CONFIG_BASE_SMALL ? 4 : 6) +#define XA_CHUNK_SHIFT (IS_ENABLED(CONFIG_BASE_FULL) ? 6 : 4) #endif #define XA_CHUNK_SIZE (1UL << XA_CHUNK_SHIFT) #define XA_CHUNK_MASK (XA_CHUNK_SIZE - 1) diff --git a/init/Kconfig b/init/Kconfig index 73efb76f38734..3c1654fc770b5 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1940,11 +1940,6 @@ config RT_MUTEXES bool default y if PREEMPT_RT -config BASE_SMALL - int - default 0 if BASE_FULL - default 1 if !BASE_FULL - config MODULE_SIG_FORMAT def_bool n select SYSTEM_DATA_VERIFICATION diff --git a/kernel/futex/core.c b/kernel/futex/core.c index 1e78ef24321e8..8488d3a23e2fd 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -1150,10 +1150,10 @@ static int __init futex_init(void) unsigned int futex_shift; unsigned long i; -#if CONFIG_BASE_SMALL - futex_hashsize = 16; -#else +#ifdef CONFIG_BASE_FULL futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus()); +#else + futex_hashsize = 16; #endif futex_queues = alloc_large_system_hash("futex", sizeof(*futex_queues), diff --git a/kernel/user.c b/kernel/user.c index 03cedc366dc9e..8f39fd0236fa0 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -88,7 +88,7 @@ EXPORT_SYMBOL_GPL(init_user_ns); * when changing user ID's (ie setuid() and friends). */ -#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7) +#define UIDHASH_BITS (IS_ENABLED(CONFIG_BASE_FULL) ? 7 : 3) #define UIDHASH_SZ (1 << UIDHASH_BITS) #define UIDHASH_MASK (UIDHASH_SZ - 1) #define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)