Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp452571rdb; Sat, 27 Jan 2024 14:01:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1NFAaVqKOiXPBtFow7p5S7gtYVCFC9n2ngrfSCN7co2PHfAx+Pak3Pj/SULHVl5tiL8N5 X-Received: by 2002:a0c:e382:0:b0:686:abd8:7758 with SMTP id a2-20020a0ce382000000b00686abd87758mr5077106qvl.54.1706392880165; Sat, 27 Jan 2024 14:01:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706392880; cv=pass; d=google.com; s=arc-20160816; b=jcZdIxljXPY35gIDUrHPkwJEiVbHNa45cH0+4czOlVg5fksqyzcEVL8UAYgIP9QedL 2JXur8Cfq8NZ7bNGWLJqdtXU9TB4/zBACw4aMMIIwuyfWG3Q4GfOUWYLjVRWdIRMGL5A KMPp6B0gyLkio2ObGGYbLK7rLVDylXC54KS8BonwvaD1Qcs9pRDVNNu/yzmNZu/Oj63t +VBBZU7+60PK+3L3fk5JE9mnw7WU5wxDeHjBXm+Lgvg4jWvaEIR0unDSLm+jOhhXh0Sl AJmVBL4fqF0r3fEGVl4KgC7XRCH5vsWANs96mLncrysycWZtn8Tr1US6i/rGet6g21NU KwMA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=VC19HgC2xBJYYLj2MNIq83FdLrZUDryfrK5B88v0kp0=; fh=NivrlqFqxHp4TgzGV63ZY1grOfXJCY/kypV4Pz8EBCQ=; b=s/MzPwsqni+NcCuR3XrYEEmziNY1e7gDAyALDoaIaxW5YKZkVl9a7AhuRi/lTlFGH9 PJ+hrr4Fg3ZrdL754tpciajRpkNqsw2H5rHsACe+ycK4/9aRT+9YNyHbbq2pNPWxKVYR KcWr+6NbmIw13z27+3IalPeOS+EAprOuf9byjqNXL5HqfPeB/9N5ihTQpZxJwQ5neqaj 2maaarjpLLcqjh6cRSMqdLx38Th2j7SJD01T9SY8gFqqfAWCLBFvfUzAYrO68QHHVRn2 9M2lZSw/Ly+FkMiMjbzwqM1imsYI+7kKtISYyE48RUW/l3fL1o7l359OmyfvfisH6MGM zYGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=aiK+ui9L; 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-41410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41410-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=smile.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vw20-20020a05620a565400b00783ebf59814si1399859qkn.360.2024.01.27.14.01.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 14:01:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41410-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=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=aiK+ui9L; 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-41410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41410-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 801071C2235E for ; Sat, 27 Jan 2024 22:01:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D80F1B80E; Sat, 27 Jan 2024 22:01:13 +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="aiK+ui9L" Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 880A21B5BB for ; Sat, 27 Jan 2024 22:01:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706392872; cv=none; b=iFIxm0O8CjjNzK4xZm9zGCJ2F/p3Yo02QKmuy5bDsCnfm0dKtujOdn5MFuqylGb3DS09nbvni/Td187trWmTQNdX9uaYV7BJ7RUhSRF4VWPycnv6Ajn50wv9unkP5eiQquTZ1KrjJ2CwZmigpCxA/BtegqwBWQD7tdOaa1gEr8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706392872; c=relaxed/simple; bh=i2YafAS6UswvrfbzFXcODF8OztRsn1M/mcDkytvk/xs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=kd0gUgOQ4ZXDtwqflO0xxa1iiJOvtY+j4WUEXxfTL5LhllWfy4013urrwMXeBXGcNCH/lVPVn+dZNMWHAEyet+YjCs7CBVPNfYHq5/dG6pvw19fgniVwKkXDatv4R3yPje/Mtm+X8X5DGhak/cyQqR79162FcYGvu7Yh+wASYUU= 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=aiK+ui9L; arc=none smtp.client-ip=209.85.221.48 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-wr1-f48.google.com with SMTP id ffacd0b85a97d-3394bec856fso1547605f8f.0 for ; Sat, 27 Jan 2024 14:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1706392867; x=1706997667; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VC19HgC2xBJYYLj2MNIq83FdLrZUDryfrK5B88v0kp0=; b=aiK+ui9LKgFOpV0pF01GQmSuAu5bvYjeZy8Ak/3pdeBkxQGL50rSvE23eoCjJLsAR4 gf9r/9EPW9e1bTrrTferkPIFrYRQTIDe+uAxbRFEVfIWbfTk9+8QbwhCPSi3cNdzClJK H8RoIAaJ2MRyZHy+Gn7Xse+7RX7xyVYooUODuGIlMs+jk9NIa+NloOoPgLma5fsuXyTs Qkv4j+/cSxS9bRFhwL2+Khencqio74W57UvFu+kdO1ZHLgGcglcFh2nueuOfUkvuA3z1 9yVx1mrlkcP0cPlBWhuXtabd/5JAtXFhVBStpziztD9xDjSfcUtoDexPvGNrG7jlq6NL TD+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706392867; x=1706997667; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VC19HgC2xBJYYLj2MNIq83FdLrZUDryfrK5B88v0kp0=; b=PpG+EjEmW4UkmaKT5wos9fgbRl95nEcqB/QxvU3c+beOWHNYslYdGZ7anTjdkluuCL fNmWWM4OiYx/TrOin8rVzNEqI8JiQvz+jLlziPcBszlzXl3bfqjPoaYUMBgQeq/kdZVL AwDDga+m84qPdxNYBsNPTxnMmK9pjfGjhvhYbc2lq6AtjwNmfJQMl8PJGlWRrCxyO1sH +8HtjUgt3KyBLOP+CHF/aPzLWEhlFsRifXkKMDRAkUUiHMoyHzFrmTGGs5alNAXcKbMu vqCJ4FJcXQLXE9snF5zeNYDrP59tVjUlBDE+3KlBak0DKY7oJSYH/TbNvxqmkUP3Redr slcA== X-Gm-Message-State: AOJu0YzZLsCDRkfjQWAM/Jmsf6WinJV+I/R6+Iw0cN79SoSXlVPU/6Uw Idw4O8aIAGDgSmL3cRtFpbSrL3PIQWptDdNAVPSLZUH0r7Of00/x+CMgRuaNuWU= X-Received: by 2002:adf:f24c:0:b0:33a:e3ac:60d4 with SMTP id b12-20020adff24c000000b0033ae3ac60d4mr772227wrp.15.1706392865887; Sat, 27 Jan 2024 14:01:05 -0800 (PST) Received: from P-ASN-ECS-830T8C3.local ([89.159.1.53]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b0040e541ddcb1sm5755532wmg.33.2024.01.27.14.01.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 14:01:05 -0800 (PST) From: Yoann Congal To: x86@kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, Yoann Congal , Geert Uytterhoeven , "Luis R . Rodriguez" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Greg Kroah-Hartman , Jiri Slaby , Willem de Bruijn , Matthew Wilcox , Peter Zijlstra , Darren Hart , Davidlohr Bueso , =?UTF-8?q?Andr=C3=A9=20Almeida?= , Masahiro Yamada Subject: [PATCH v2] printk: Remove redundant CONFIG_BASE_SMALL Date: Sat, 27 Jan 2024 23:00:26 +0100 Message-Id: <20240127220026.1722399-1-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. In addition, recent kconfig changes (see the discussion in Closes: tag) revealed that using: config SOMETHING default "some value" if X does not work as expected if X is not of type bool. CONFIG_BASE_SMALL was used that way in init/Kconfig: config LOG_CPU_MAX_BUF_SHIFT default 12 if !BASE_SMALL default 0 if BASE_SMALL Note: This changes CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 to CONFIG_LOG_CPU_MAX_BUF_SHIFT=0 for some 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; Signed-off-by: Yoann Congal Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/all/CAMuHMdWm6u1wX7efZQf=2XUAHascps76YQac6rdnQGhc8nop_Q@mail.gmail.com/ Fixes: 4e244c10eab3 ("kconfig: remove unneeded symbol_empty variable") --- v1 patch was named "treewide: Change CONFIG_BASE_SMALL to bool type" https://lore.kernel.org/all/20240126163032.1613731-1-yoann.congal@smile.fr/ v1 -> v2: Applied Masahiro Yamada's comments (Thanks!): * Changed from "Change CONFIG_BASE_SMALL to type bool" to "Remove it and switch usage to !CONFIG_BASE_FULL" * Fixed "Fixes:" tag and reference to the mailing list thread. * Added a note about CONFIG_LOG_CPU_MAX_BUF_SHIFT changing. CC: Luis R. Rodriguez CC: Thomas Gleixner CC: Ingo Molnar CC: Borislav Petkov CC: Dave Hansen CC: "H. Peter Anvin" CC: Greg Kroah-Hartman CC: Jiri Slaby CC: Willem de Bruijn CC: Matthew Wilcox CC: Peter Zijlstra CC: Darren Hart CC: Davidlohr Bueso CC: "André Almeida" CC: Masahiro Yamada CC: x86@kernel.org CC: linux-kernel@vger.kernel.org CC: linux-serial@vger.kernel.org CC: linux-fsdevel@vger.kernel.org CC: linux-kbuild@vger.kernel.org --- 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 | 9 ++------- kernel/futex/core.c | 6 +++--- kernel/user.c | 2 +- 8 files changed, 13 insertions(+), 18 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 8d4e836e1b6b1..877b3f6f0e605 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 @@ -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 e0e853412c158..8f85afef9d061 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -1141,10 +1141,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) -- 2.39.2