From patchwork Tue Feb 6 00:13:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 13546448 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 CA07828EC for ; Tue, 6 Feb 2024 00:13:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707178435; cv=none; b=VvPo6E+F0z+p2k5UyvDiP0zh8M5bPiiaOrV1wLsAEjCGWKfRzzW274pFIVsDgpUM8FqoMohHNzedSgJesTZ2sgbAzgrPcscDDmQmGUx7RsmwY5QXpZHlJp/JPrZzggNzSgrWND+qN8J+vWY5HWB546JRnsecKf+EmiQgM0pmZRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707178435; c=relaxed/simple; bh=PZg3QWq+/GKgfZZA2qyqx39P/kRDLKfoOfmCw8uE3uc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KUkDIHci8eX1u8LNOp732UlvLCovbMSe93uPHa29eEhCx7hNYXNBX7LA4FESXyAu5qakZJKZPg9qDVVvaKcju/H491Qeb/Vq9jjrQpnUQqIOBp4SGu3Y660MPRJ/Nm0iDIbWvTEnX3mmLNaeCTuMQf3uR76zC/fG0KWqwA2ymXo= 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=PElaE5FL; arc=none smtp.client-ip=209.85.221.43 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 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="PElaE5FL" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-33b0e5d1e89so4000823f8f.0 for ; Mon, 05 Feb 2024 16:13:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1707178431; x=1707783231; 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=JGAprqtgwfmvAPo8XwmHq4MOLLyHp0qoLOC+fnp28mc=; b=PElaE5FLEeILIlVeSxLGe4wVM5aEf37u5b3k2Qcauh07I6v6rK2PfXkoxmdkooKxcN AZFOqSANlvjAbO5Wl4FMgfKUHAqErEbdLs0CY2M20hvIZmc/+n97TGqQ/LYvw2Pay62Z 5AHjAM64kvfbJ5x/96v0FNbqoBPtpQv+VYijhob1gEWUYFiBg4A4qMHckPET7u2ADGXO uZdIyj9Q+ZClFGOvg3KBuqej2KVXvk5zd3B822rEBOhz00mcHT7tCOzKDI1zTqcT9fJa aR1GgriaiZOxe5iifa9EKAx5k3lfnoxAVqegvVB7EUZtnJoaVfj4Jfv/be6eRjD+h4cO 9JiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707178431; x=1707783231; 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=JGAprqtgwfmvAPo8XwmHq4MOLLyHp0qoLOC+fnp28mc=; b=j7SlHJ+PcDrSimDb7JiIFkuoA6uDH+Oh0q1kNWnSKtY3e3HgdvZgPS6YalyFUG5Mzl xpNVVrBulBNYy5Dc4LJNLUDfQ5EEE0vcL4OwfasnSuDRMx7WrRvcdDB7AtrsYufe+bT1 NYua/wNKgi6/fROstgDmvS/zmqxOiO1xsYdPsE5z6UiGg9CGnk6mAqP79bZHPrP2/viH /W3g7E734eDsHCEWFJJQYkYmZwRYFAY5JMZ/rS3vMcu9yEDH/LyPg5nuE/yYKkHGz6Cw vbZISF2yiQX/Mq1RJPFWKQtBFe9NgjAj5sowPaesLR/zXZ089kYzDS6XqGoO3cP3+xjM g2NQ== X-Gm-Message-State: AOJu0Yx0+cPZvD7EdGoEveUgOWw8ZkWnmQn3QymU11tpOzn4Fyhb1LLX c99SlV4wLq0QmUe1Qvvl/IwN64EE1WZIeOSq7LuQ1e/A88hv617kvSN1fB00iuZakDcoxa2ucY5 6gsGWEA== X-Google-Smtp-Source: AGHT+IFVdveHEmqxwMT4/lrRvnliU1C6woy6CYFET1Y1uqw/pAcuN254xpaVv8itNDA24IGtf/7z3g== X-Received: by 2002:adf:f342:0:b0:33a:ec79:f923 with SMTP id e2-20020adff342000000b0033aec79f923mr42991wrp.54.1707178431092; Mon, 05 Feb 2024 16:13:51 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXSkm+KM6a//GM/zt8jAHlWsL+R+s9l4YXJWg1ms9wE3bjkViT7qTUvsy7b5e5PiupkD2cg693R32UTsr918zPuNWNygjG+uFSovIBuPxd5Xm7lK2IijJ2BZaSurM3ygYbTl+DotuZr2x6cWpTPXZNLyJb8/OI1MHQRo2Ghheug212Tbf6xxTZBkpMoAylnuIwCCECEsubpc09Jntn/OM89NdVfKWA3+p/ywO1gWdanNHX05R3kPNp9tFvc0P7HnuwEixWBjJX+iR3KSUD7XUrbFN6oMuhAC3uzEUTnkocCLQNsopJ3RiUcgeCAjC+Kqf8r5ORhxmxKs6nvX94tkKsvoJZBvL/rRS2V/9fmv+rg9u0A+xpyGFNPxEGRXvm1k2Y/xAcXZMlP44j9FZESuS0up5toeSJNMu1cZJ6/ggWx7n3p/ucG/mFjYeXCAM8AJDCsccm1phCeQTjjcPlgKo4jfk6EVJN0pZK2KKJpZmK0e5EvIYQ7FjcStkmYMqz00z8dmX5YR1pth/yFfrHAIch64lGYkAIMifoFVLcviHFaJ9KHw6E8/7fATdGDugocyjUvuykyXJF8ENryYOBMe7c6lkiKGYUMDp3miQX8Mgbwqp5oTYXKV9uNa6z/ANe1VjvGnwT0u1LV02nZzE11Hl84MmT5Aqgijx05nV0MLtnPuQgUHIqcXWUnqB7AwLeIIQAhAiyDEHlmhXZRxWTsboWbiDgBZksbBHmBtpJ6eEfzTHBP6/GFSaD/6Vfh1kdSf7gQdL48+HB8FBzM2VqRr0Jj6rNqZhvXiRPeQx8rcq5C/lg/qgOf9ldIZP6Tk3z8tQ== Received: from P-ASN-ECS-830T8C3.local ([89.159.1.53]) by smtp.gmail.com with ESMTPSA id b17-20020a5d40d1000000b0033ae7d768b2sm686959wrq.117.2024.02.05.16.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 16:13:50 -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 v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Date: Tue, 6 Feb 2024 01:13:31 +0100 Message-Id: <20240206001333.1710070-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240206001333.1710070-1-yoann.congal@smile.fr> References: <20240206001333.1710070-1-yoann.congal@smile.fr> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. 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: Petr Mladek Reviewed-by: Masahiro Yamada --- v3->v4: * Fix BASE_SMALL usage instead of switching to BASE_FULL because BASE_FULL will be removed in the next patches of this series. --- init/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index deda3d14135bb..d50ebd2a2ce42 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 0 if BASE_SMALL != 0 + default 12 depends on PRINTK help This option allows to increase the default ring buffer size From patchwork Tue Feb 6 00:13:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 13546449 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 060133234 for ; Tue, 6 Feb 2024 00:13:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707178437; cv=none; b=U9hUmd1DHyDFc1vKva4lLGWxqbngzNR057k2vd6nyGZtpOtptiX+VTwr3KemFpfp8VlDAUb/6fD55RAfaj4G1Ij339qp0OIuVLcxYwHb+qsg7H2KOeiKkey7Q8FZPib8o9DMaUUwyDz6mpLu67TxdnGkFQMC86rXpcCl+JKCYUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707178437; c=relaxed/simple; bh=cP/4/UkSs0FwG35VQ63HkqzL1J7Rzl17TzuFmKODFxM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=toVXkrRZJHAf2MNWPdlSl7rESjJ5SsNARsR7PmZF8pWy4kwgMk0AKzR71b/SInw2nh3a6fTPDEq/nPCgDGd9daYpX1fbsE/1aj9kvay39/j4Wpjns5AuLC/0QbBvcE+e+D8AIvFulCUHrRp45setxWNNT9S7jI8eZ3U4XxaAsu8= 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=DV73vVZ9; arc=none smtp.client-ip=209.85.128.49 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 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="DV73vVZ9" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40fe00cb134so4418975e9.3 for ; Mon, 05 Feb 2024 16:13:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1707178432; x=1707783232; 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=Gq/vJmgKCN4+43lqiOQvDvHZ5T2ZeE9RmH3a3i0S7t4=; b=DV73vVZ9DKsCo1N4zXBRa20dE3xhzfBc5afhHmDAfZlwaMj0/dHt+Xtirwkkc2YErX 3wjEdI5FCmPq/Z/JiTVfpy8q8+rU16m5AtVa6/QGDz3cXi7/BTOwAWUVMuLQbWkYLjM3 cQNzRVp9UgaHbLKMhWpt/jlMsnVZKRrvZ812vUNwlB5AxKXHtSUWyl3cvlCjtTLABeZA rzqxvuVPYRQpMiEQTw4qdeesteMzpS9+RUf9HoQvJ80WIG3QnDkXdGWougrMKfc3f5Ag g/4XLvJkRjZEXfSm2ZhJzsRzk6KVsPyH+rq/jA3RaEy2RxVJCoB0pl1CQcgYSiypTBL9 HClw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707178432; x=1707783232; 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=Gq/vJmgKCN4+43lqiOQvDvHZ5T2ZeE9RmH3a3i0S7t4=; b=cSyYHxHYeD8kzDrxX1i1TFfBznKLPrRRK+acWGvmH2bVsv6YeiU30/c5NDM1TF9N1a B033tHx6vILYBw3XWQSuhRG+elmEKzFdDbO0EtO5OQo9uD0jEzfj83CEGFb3wzlRtgd7 GS89zcFe7gi3vCx8Z0SRQNLj8UE5CjVDlBByzt0NiUJCBWluatHKxXoENUu0hEmjIWVf I+KeOpxOZSVnKhiTS/bhnp1KwGQfkcb1KYs+0mZ0jcUXWH9UM8fMsiUpYFkJJnuu82Z3 07YPc+DmwX27uGlF1HCs+9iKwILNSH61FhJ6jysghBfPGtr0IFuezT/aofZO1VcAZKrz ppJg== X-Gm-Message-State: AOJu0YxKxfNEnMuhmRGMXhtFnCks6kcCPCiBs0PsbT3S3rMCxQlx5YhS jXA5TM9RBFoyZqWpqEmmKTTZn+MqWj4HmVYoMnsIaovpMzoDYZS6qInGCHO76sHTafewg1rY/nZ SxaxpMg== X-Google-Smtp-Source: AGHT+IFDZiqZCqXSW50BaIopf3+TuvOXvtTei80hIpKW62aZOXV+z3L31NeRZ68PFAmNV5ntUy8n7g== X-Received: by 2002:a05:600c:3110:b0:40f:b45c:85a5 with SMTP id g16-20020a05600c311000b0040fb45c85a5mr869848wmo.22.1707178432482; Mon, 05 Feb 2024 16:13:52 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXYDtvhA0Pcloza39he5JBCyZ9ZNK63hXDPbN3A6qiXjD5eegCT4Hiiui8jpxnsrU7F7VMA1rUGYPCoOpELvpUR5ft3rDzXYQPgJNjz2ZCTH/2u0nwNEupG3BYZCvz5OXQur8AZC7CGZzHJ/PseuunTs2ADo8fnXRhdQY8+6IyalM+KnM7fsi0IE3VGosiQchIFbhB98tsMdgf+7Pi6ky0SAy+VJCQVFPXmvI3q9LwnA/YN3PB1i1sX4ZEAO2i//Ud0nZ/Y7jxvOm1Yg6eVytofID/X3IVEnQR+HTZiKlk3z5yBUg47/u6uJPC0BqYAIKJ9l9C0KA4FBi8AxBW5R298mN7c0Y1PZFG3HvysZFKjD0TX/XCEC+gf/NiTIuE57Inq5TSgXFM5Nno0IrzinWh0FgcjkD08JIFQmOoECuRTvev4H77qevmMM7nEJq9Xs0vuMdxSf/d028tk5qqhQc6A+glC7zrvpOf67ulDMwIHelwOpGVxI/t8veno+pXAlTR0duQLk21qtv3JC3sodp+urRyDPz1SjfNAzmBjHzGIdrSPv+4Z8PbKZNgKGNLZV/yXIZNDx1afSLvGRmrvOhkF0BA+fWbseCXp6mDC9CRbJXFlwEGg2vjH9TB94mHntEXv47BGPvK56PiZLykunFjGzO5oQMBLvFGiG9sD1iHaygnBGLZ2kUMFMKxdeQ43/EsS/UkSsd31X29MSfAp4nO5pf7hcVQ8QJkdN2hQi+jSZgGgHgUt/Z5HGN4SzOHU70co4R1NyQwK1IVXmc4i41oaWaspAPQ= Received: from P-ASN-ECS-830T8C3.local ([89.159.1.53]) by smtp.gmail.com with ESMTPSA id b17-20020a5d40d1000000b0033ae7d768b2sm686959wrq.117.2024.02.05.16.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 16:13:51 -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 v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool Date: Tue, 6 Feb 2024 01:13:32 +0100 Message-Id: <20240206001333.1710070-3-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240206001333.1710070-1-yoann.congal@smile.fr> References: <20240206001333.1710070-1-yoann.congal@smile.fr> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CONFIG_BASE_SMALL is currently a type int but is only used as a boolean. So, change its type to bool and adapt all usages: CONFIG_BASE_SMALL == 0 becomes !IS_ENABLED(CONFIG_BASE_SMALL) and CONFIG_BASE_SMALL != 0 becomes IS_ENABLED(CONFIG_BASE_SMALL). Signed-off-by: Yoann Congal Reviewed-by: Petr Mladek Reviewed-by: Greg Kroah-Hartman Reviewed-by: Masahiro Yamada --- NB: This is preliminary work for the following patch removing CONFIG_BASE_FULL (now equivalent to !CONFIG_BASE_SMALL) v3->v4: * Split "switch CONFIG_BASE_SMALL to bool" (this patch) and "Remove the redundant config" into two patches * keep CONFIG_BASE_SMALL instead of CONFIG_BASE_FULL --- arch/x86/include/asm/mpspec.h | 6 +++--- drivers/tty/vt/vc_screen.c | 2 +- include/linux/threads.h | 4 ++-- include/linux/udp.h | 2 +- include/linux/xarray.h | 2 +- init/Kconfig | 8 ++++---- kernel/futex/core.c | 2 +- kernel/user.c | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 4b0f98a8d338d..c01d3105840cf 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -15,10 +15,10 @@ 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 -# define MAX_MP_BUSSES 260 -#else +#ifdef CONFIG_BASE_SMALL # define MAX_MP_BUSSES 32 +#else +# define MAX_MP_BUSSES 260 #endif #define MAX_IRQ_SOURCES 256 diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index 67e2cb7c96eec..da33c6c4691c0 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_SMALL) ? 256 : PAGE_SIZE) /* * Our minor space: diff --git a/include/linux/threads.h b/include/linux/threads.h index c34173e6c5f18..1674a471b0b4c 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h @@ -25,13 +25,13 @@ /* * 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_SMALL) ? 0x1000 : 0x8000) /* * 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 : \ +#define PID_MAX_LIMIT (IS_ENABLED(CONFIG_BASE_SMALL) ? PAGE_SIZE * 8 : \ (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) /* diff --git a/include/linux/udp.h b/include/linux/udp.h index d04188714dca1..b456417fb4515 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_SMALL) ? 128 : 256) #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..3f81ee5f9fb9c 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_SMALL) ? 4 : 6) #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 d50ebd2a2ce42..d4b16cad98502 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -734,7 +734,7 @@ 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 0 if BASE_SMALL != 0 + default 0 if BASE_SMALL default 12 depends on PRINTK help @@ -1941,9 +1941,9 @@ config RT_MUTEXES default y if PREEMPT_RT config BASE_SMALL - int - default 0 if BASE_FULL - default 1 if !BASE_FULL + bool + default y if !BASE_FULL + default n config MODULE_SIG_FORMAT def_bool n diff --git a/kernel/futex/core.c b/kernel/futex/core.c index 1e78ef24321e8..06a1f091be81d 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -1150,7 +1150,7 @@ static int __init futex_init(void) unsigned int futex_shift; unsigned long i; -#if CONFIG_BASE_SMALL +#ifdef CONFIG_BASE_SMALL futex_hashsize = 16; #else futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus()); diff --git a/kernel/user.c b/kernel/user.c index 03cedc366dc9e..aa1162deafe49 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_SMALL) ? 3 : 7) #define UIDHASH_SZ (1 << UIDHASH_BITS) #define UIDHASH_MASK (UIDHASH_SZ - 1) #define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK) From patchwork Tue Feb 6 00:13:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 13546450 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 B227C3FC7 for ; Tue, 6 Feb 2024 00:13:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707178437; cv=none; b=nsW2nEYb/RcFoavFmdTFv7nga/vKC1PStKSYhZN1P19g84WZudrM3nRUunwHPOK/OmFMoIn0PSe/QA17EeRtp2ZqsmWrwIVdjrcqNwwVGTYJ2KCORRsBEoAjcVCpN2pErFAxV+WYha1rxjSiqHhW3pYJt1K4zYtfqFHhFTKdH1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707178437; c=relaxed/simple; bh=BvD7KT+7ul13q1wVJvqPxQDUSv1WiR9wKCxQbbEr318=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZnKuDvKPdUdMuoscoEw7bPoWWU6dPtE6Uff1JMDgbqZf6OKWRcG0eX7BKX9VYdKVWrSxMiHoyGXTJnY7zSazUdogylrKLq16wExlMQ+eNc9bv4/ByFlynomMU5/Vt8PrqAVOc5I6BwNohlwas0bKyB7atNuenZSGL7LJMKCuFh4= 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=rgV6cLJB; arc=none smtp.client-ip=209.85.128.51 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 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="rgV6cLJB" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40fe2e746bdso229935e9.3 for ; Mon, 05 Feb 2024 16:13:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1707178434; x=1707783234; 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=sFNpFi093TpETZs6mdYZEjtXAaH8xI625rElwAZwslo=; b=rgV6cLJB9BmJCHfqJ7i6XQ1wFQ3K/bhMQOZuHD0bMnpzwrZjXvrpplDfavsz1jBG1l nhaTW42WP5l5kiUjRYDnpH6iYluRCWnwtZcxSoxyXEuVs6RUBlKVU/uejeApAKpSrhwf bT63NS4n1c8yS+FTqtCrVOpA45xwRGfaCIlJUGpn2QtiyRKb5PWNII7/Em+nzFWBmCIw a5BGFEbIaiKe60WyONXW8QOsisCHHEDgPJgL+1iL2Elx+C7V40f5cCJ3KObisQIy9uZU hHaQ/YT5weS9MjgRdfY+Sf7Ki4iyMViS8GUEx9mgp9zgaRew2T/6g2il60+E+VTKrxNK /GOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707178434; x=1707783234; 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=sFNpFi093TpETZs6mdYZEjtXAaH8xI625rElwAZwslo=; b=Y0oghc/qhJMZpMMmxC9/FNb98ANop4S7cmA5jhYeSeDg3+wAUJyQ1BjnrDlJ0DEKUR I/tPAbQ51UrhpYOM29Le7ZQM/Y7KCjLBAHwFMEXiKROCmfSuWJbYf7z0yf7AoIAUDCUy goe/TltiWSc0IhyXYK559LFFg5IOBfVKaZaXOB/2oypHWBJ0VJqln82kfr8vGkMJ/ZHn nStWtBW+aAIHo2ZleepT6gEXwFGhienvjyo5X2q7FxT9qBdIwrx0q/SF+2yECwsrriER vRx/Uo/ObJ+Oa3NQ8NhFVSEsoY6Lecf4Wr9oUCwGb8fD+ZoBCjkfysywzF9BznzXPYcY jVcQ== X-Gm-Message-State: AOJu0Yy9umZGnNdagXxSo8f4qqf2oUC1BJogwRGrjXgV0J17M10tDZGh ioga0WcSoMiBDTJrSJZi8Plp4alVimWivPfkGtr8X2WEviwxi/w/Ns4Y/HKF/y9lnkcRCVUsC+4 Yt/W3eg== X-Google-Smtp-Source: AGHT+IGxueG8VUZUtZseYHBtudaN2Dfg+xA2i2bfaWYL+JCkmwEsiBKAFZ4MHTohsZXzG6iymVm9Pw== X-Received: by 2002:a05:600c:3c8a:b0:40f:de23:b8f3 with SMTP id bg10-20020a05600c3c8a00b0040fde23b8f3mr267229wmb.23.1707178433811; Mon, 05 Feb 2024 16:13:53 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXWwuJ25X3TFhf5cpubZjv3P0jtvVpxgluOyArwnSdlojbnQ4acGDwOCQfPrJE6Ev1XGktp7X3OjOkNEWC2yAp9QZw3MG7u7//ot52N8OQSL6BXaarM6yxmsJrfjFOBI3LuRCJQoLhrF2rRzhxobhoeFmtq3dhpWhv723aainhkH/CRmlvbt/WWnIMyJhu2dHqJPEM7SKlViiT3cT3VWECjVsyvwwQsr0IWdLi60kkUo6P+PpKO3E4VjYcSN4hyazIpoxZyCmXReAaDPECKyQZsEyLNJDNB8dJKgLzM+t5pa9SrRRMYhCwfrxj0yDZesLWim46+bNg+5wgJJsU9kWHgZ4XVQDaGeyYaYmsN8Af4GwvMaVRAukQHsY8dwK7S/lxgFTYSy7mki4cLxPv8tNnKbbbagqoToFaJcAAP4UBOx1MaBxCr8auuEfWN0sSG6BUqCf34j2LCFBtxK/RlrgdH0CJBVnVwRW1V8MaW1H86a1L5177676DURWdKISZO0/jJGyI/khY/ovy6RBZXJUDEVJ6UW2I6Kr2RiAsWiw1N+UADfzIFEVHhwUxh9lNBVRb0gpNjzlTjH1iY8ybmRwcQPK332VQ+XaL9M8yYVZRjK/U/WWgbFVA4u2SlDpSKHLSYAaO0DiNohXVm1fxdHjyKizT+v78PdmWH9Flv891/HffxvBd89gwEerzZVYqpcyK5Osv4DD2lMhkHc7VI1A6U6icC2G1Jo2szIa8SFb5s52iftg/IU9tIE0qAfElAxQS4W8WABNAun8aUexQA4+Q0C4pODpA= Received: from P-ASN-ECS-830T8C3.local ([89.159.1.53]) by smtp.gmail.com with ESMTPSA id b17-20020a5d40d1000000b0033ae7d768b2sm686959wrq.117.2024.02.05.16.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 16:13:53 -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 v4 3/3] printk: Remove redundant CONFIG_BASE_FULL Date: Tue, 6 Feb 2024 01:13:33 +0100 Message-Id: <20240206001333.1710070-4-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240206001333.1710070-1-yoann.congal@smile.fr> References: <20240206001333.1710070-1-yoann.congal@smile.fr> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CONFIG_BASE_FULL is equivalent to !CONFIG_BASE_SMALL and is enabled by default: CONFIG_BASE_SMALL is the special case to take care of. So, remove CONFIG_BASE_FULL and move the config choice to CONFIG_BASE_SMALL (which defaults to 'n') Signed-off-by: Yoann Congal --- v3->v4: * Split "switch CONFIG_BASE_SMALL to bool" and "Remove the redundant config" (this patch) into two patches * keep CONFIG_BASE_SMALL instead of CONFIG_BASE_FULL --- init/Kconfig | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index d4b16cad98502..4ecf2572d00ee 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1581,11 +1581,11 @@ config PCSPKR_PLATFORM This option allows to disable the internal PC-Speaker support, saving some memory. -config BASE_FULL - default y - bool "Enable full-sized data structures for core" if EXPERT +config BASE_SMALL + default n + bool "Enable smaller-sized data structures for core" if EXPERT help - Disabling this option reduces the size of miscellaneous core + Enabling this option reduces the size of miscellaneous core kernel data structures. This saves memory on small machines, but may reduce performance. @@ -1940,11 +1940,6 @@ config RT_MUTEXES bool default y if PREEMPT_RT -config BASE_SMALL - bool - default y if !BASE_FULL - default n - config MODULE_SIG_FORMAT def_bool n select SYSTEM_DATA_VERIFICATION