Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2397985rdb; Mon, 5 Feb 2024 05:34:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGm2AiDbz4mFdFgdLAI7n8j+dpLHjrx30y98sgD0Vl5dv6UCVQeIHbQi9aa0Oz0qRg0dVJS X-Received: by 2002:a17:906:1152:b0:a31:1c94:3431 with SMTP id i18-20020a170906115200b00a311c943431mr10797118eja.46.1707140088234; Mon, 05 Feb 2024 05:34:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707140088; cv=pass; d=google.com; s=arc-20160816; b=YsR1kNKlC7FaNEcjW7JAyIln1cVVKHFz/vYUI1HM2MPiwlYw91P537JuDd4KBxBLsl yXCwpOLlfQRZD7paSilodyan4lADCTFMUm9+WpZ0XZGaPGfQ3Yb4pUKVG4RMAAzUS4hT qIEQSgj8wr7fq2u+CgESC6cgLr6VbVSDxi1gujbbTTbCbJV24i1e/zAPmCcgxbQ8Qsz/ shueWjy2HT2Xx5CadQZEIBCdo1wDTKmT4OxJ/YTi/C2ZbTrxt+U/OPhwnJuWTWxv+OYw gcz96GhWS2P8bcMg+TasGtBTCslZtLjc0a+2cz6i/F1H7FMU2wMY1SnGle9v6Rje1Z2/ yq2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MoY22caN72Vu9KETh7xj+mgQ1cwoewKUNf39bRI8TM4=; fh=W2sMsyzyI/mdv4x5dQAbX60Kcp7IjNVqxOsyyEyh+FQ=; b=OCPnfL+ZCA7aR0mIVa3FbwIJhy8tBJS823N6XCBbBo0ldcJTNe/UsW3Ku1qeakS+94 qkfrZJbpwd4XN8KX5YP9olpc+t645Mck3WP9djTzvmJHgi6nP5+rp39PyTZP5C1Ny6IX drKuCsFDxQ+17qo77gs57cGH5CbX5JVThVf7Z6+m33LqlyUx8h3mgHEUXuVztW2UYE9Y WDXMgDoD6Agqa65EEZ7wmBGd1ImuS0PTA+OHKS/pIyPaJYi6G3ZUtCy/O8dFNk07rfOG zA9N0Jw8ojuVNsYvvRx6Nv4Xe4tTqL3fmyv4RuCxJdf2/c9b88zL9D1MfxarVBi6JDoM rsAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=QvflKCCq; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-52721-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52721-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=1; AJvYcCUc8P1rIm/Hu5+T4ERE8gCghT3RC8ogtJ4uMYR667Wj0Uw44VrwRVbEpvbFE4K56Lj8o3ZttD2HEv4H4bWCYtdIBIrOd3XAff8ECrT/ew== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m21-20020a17090607d500b00a371ca999e1si3355003ejc.68.2024.02.05.05.34.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 05:34:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52721-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=QvflKCCq; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-52721-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52721-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id CAA961F2446A for ; Mon, 5 Feb 2024 13:34:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81BEB20B3E; Mon, 5 Feb 2024 13:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="QvflKCCq" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.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 7817528E22 for ; Mon, 5 Feb 2024 13:34:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707140076; cv=none; b=qnW6TGTk5My3xKcOI6gs7eSyLk74T0kPk/qaarz19oyKkAiuBr9QCVAoPg0HL7lawRRDpvrmw5ZwGx6ZcaGC7HnqTeyUkLlsB+TDAbI+39t1bqRMLfDHrTzdedJqigfMF0B6iFSDLZRmSFMm4Mxs2lw2UvubpjhZ2xuE/t5Uh2k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707140076; c=relaxed/simple; bh=UW3im1Ox52r7lMN+hqUD1btlAY9FG9HoD4t9HdhYE9w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P0sRhAULc8ogtFnqwNLfCA0HXYtd3HxbkY/budInJmEtfyh64s9iMUWVTY2+uUUaqoCs6Rdqoa37acvjPAWTMipzvsql1o7l+nmvkaTAkXof+PUz7oMG3pYQa+mV3nvdnbQTnmXOmbl0g2WHyTt4G9vNvPvxhHABWq+PZ+fyRF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=QvflKCCq; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-557dcb0f870so5763542a12.2 for ; Mon, 05 Feb 2024 05:34:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1707140073; x=1707744873; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MoY22caN72Vu9KETh7xj+mgQ1cwoewKUNf39bRI8TM4=; b=QvflKCCqPT8NaOkNUQLqtciDfXwlIRUFHRJxHry180Am8utFKkstCAa5P2g5wL2mTy D0sx4+i69x94FFoLXRJy1kCNqOeTaP8hZT9pjzMCIXmPn2wTAuVlhQX3vp7s99NpTFn3 k+8quJ9db25UqbTP1YOTlzJyCHZH+HuV1O2a/H8bN6WCnN8N0C8OSaDlvA0lrkSmYos+ rnzavng8fi+1zc8YclT898Dg5PPbQCr/eN7j0qmZsTvavTkFMKGusMjaITS25Bl2mwoQ PJ8KdLiyULQGEdsBt3YBR1z7Oal9l8fLGmK/ufHCnL5k8Jp9vWCSAdFeaJ4b7d5sOEDh L8dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707140073; x=1707744873; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MoY22caN72Vu9KETh7xj+mgQ1cwoewKUNf39bRI8TM4=; b=LHbTeHt0w6f7eeyex5UCe6rYuFgXc5GlNgUuo2Q/B5GibLGAwdYejTZIQmmWU0y6Mj 2sKCF/W8wyV9knrfinhCy4IfaFyvITezcKXeKDuQDr4m2c77mqTOUPc1WcUqjEYmAgAI fmRSWJPXjaJjrMMgLroTcccsc6BVaDj5ggTkENfCsbzbSUzjB0bVtFhDGIATySAtE/jI yhKObZ52MF+2HCKg+kCR31JL3jA8peaw87z+KKWEkggKVoEAgcIDHi0enq6ZcIHNX96Z 37QNrg5/jLVlYcA+1LppYGtZrI4NXxbVJi79eai69B4Xw/gdHApF1dAIe7YJ5I943lRv 1xQg== X-Gm-Message-State: AOJu0YyDP8QkoYBXNU9eKMN2J8faMgHABTSLpn1bujheXQ7jHOmJxVtc A7wVQObungWjn0HHfgrjpW7WXsS9CFnEWgchjpYm8RYHe30Y4p/V/bwJqv6cvQE= X-Received: by 2002:aa7:d053:0:b0:560:1c4:cb31 with SMTP id n19-20020aa7d053000000b0056001c4cb31mr5211174edo.17.1707140072720; Mon, 05 Feb 2024 05:34:32 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWHvq8X17Q4c52RNFavgb5jCUgIyRYRaA7nmdEqwDRd8gtd1CIP7FTGjqjnlcFy9HC8NgTPlJjX1a6MB1SL/XYNjUvOFM2/ZVKmpLUANk9reiPUl/r7cFZq6Q68RMZ2KMNNoY/OmBdTr+j6PY6OZIc5zehJcaXY0BkPHtJ10damWnmTsIx0rX9pELJEYlI9Xe2owYhNT403E92YKvFvEUMp1pa2HVpN7mZZyuJn9NDNJRU6CZqfvhNkn6T9lJUEYBIphM5I3ZOmlaEuSVPHpBs8vplk6Syf7V6K7JlPQ0J0wbhxTt2ei2bDeN9eZ7LeJxMUpvAx0PkkCr3yrS8CJtqu/8QLHetSIYcfOuWMOz/WvYKE8EXKJC9CQNXGJZcEIpASA8jdLhSxFRh2odfpdKd9/ek2MaaIraTkonN+f0hUE9QPTXArPcNnmkck7rIy3MM0ETv3Idb3C4RrF57UhHsdw1B+58QEW1NPQoR1KPCX4akh1v/2UWpgqR+bqq4pxdmblx13T0S6PxCqEggOia5cdZ+YVjqedsSGxGsi/fd5oGc01RTu8TYrZS9zvryqI3aKkVulI8oGLq7vxy9akEMaeGOP+BJxorOjjAngW/8vB0APgHAE18Hxtv/o8AZUn8x9r8GMLGt7q5qEidT9eOls2oUEuFQduq29WmCn6vkyYdPbsSySuYWuFOvLLH2TlQgo/DUbST2vDu2VgkbdgZVMpLa8VkepdEdNYtEAovYT8vqYkOKU0OT2DVj+wMwaM2NvPpdd3KoE9pLcmO0jLUvgUUe9XPTOA+2f8XlaVXA= Received: from alley ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id ew11-20020a056402538b00b0055fed0e2017sm3601596edb.16.2024.02.05.05.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 05:34:32 -0800 (PST) Date: Mon, 5 Feb 2024 14:34:30 +0100 From: Petr Mladek 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, =?iso-8859-1?Q?Andr=E9?= 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 , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Willem de Bruijn , Vegard Nossum Subject: Re: [PATCH v3 1/2] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Message-ID: References: <20240204232945.1576403-1-yoann.congal@smile.fr> <20240204232945.1576403-2-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240204232945.1576403-2-yoann.congal@smile.fr> On Mon 2024-02-05 00:29:44, 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 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). 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. I believe that this patch won't have any effect in practice. It is hard to imagine a system with >64 CPUs which would require BASE_SMALL kernel. Well, never say never ;-) > 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 Best Regards, Petr