From mboxrd@z Thu Jan 1 00:00:00 1970 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 5EB022701B6 for ; Wed, 13 May 2026 13:04:21 +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=1778677463; cv=none; b=nIc3TySsJu4uLmg8G9FdHQ0NhgBIo1vwnlCQ1X6vwD/AtIsphPdd/vpOu+9xev4TmSnz6dnB/+P2f0TGVMo4Ii1VHIYwfY4Vn9/F2cg1mjfSyRLvO5bRXY+tznTP8+VjURDGcEnWPRenK87H+eVZPLmnajaTGZH2uP5aHdS/SVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778677463; c=relaxed/simple; bh=+FxJG4kW9NjfhAdfAskdR39uG7HKd/rVabJUuHsVcDQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YlH8D1gvP4YLKJUMuUgqyaQDecouGPCOFG92qoovIBYaQb09qpeBjLHrjahID/YZjWceQ5jc+t2NPu9L4uLvJNHq42MSUuA44bDmB7kpp73cg18hfehYwrEG7n88a6IDakVUxPJziHX/sqkCwN2q/SPYC4vfSEPUiwsd4ELZ5IM= 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=E4R50bF1; arc=none smtp.client-ip=209.85.221.48 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="E4R50bF1" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-43fe3e22e33so4091735f8f.0 for ; Wed, 13 May 2026 06:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1778677460; x=1779282260; 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=a38+h9bWp3RlleTL1QjZzeIbioOA+x/4L20QS9dVRSE=; b=E4R50bF1Q1tFaCx6QoqPodIJXqeKf04/OZn58X388yZ5DB8bE64xkVJUCQOPoSmZ1f HvYjCmytizHWYeHs2uu5Rsy9u4F3A1yd0Dizc2sLtUAtJ75riGeIvQqZnr1B2hIpuyot TKO3QvPSb5Y6sgtU4zrGYDn/Gz5FSkpAZ9vyuFSxd6N22f7uIaEhJtN6QOxK42uT8DRA F82et/cSwIkdAQUF4XTf4L9q8ztEhMbeBsih9aKoqEzQ6PFeyTPom+bUZ/u3amxRGZDE oWZwUjoWB6gl8r8TJadguW6l0nk++3NCB6eT39PXPoQTL7UA5uI99Wxl1KdDrQp1AMA6 BC3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778677460; x=1779282260; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a38+h9bWp3RlleTL1QjZzeIbioOA+x/4L20QS9dVRSE=; b=YqL3RY/X0YrIw9PY6U6+5wRGoEmG91ePoYs7AW8K8hsu2Fe5rN+YN4LsoITQFYDq3T 9n7IZE3n/VQqzd9Cmx05K8Zf23nBY/2vaDsV0ZQPAJPlEDaWTpqOor6bDnJLxQgQsVwD GuFQmI1n2xSrlb1Y2lKe/fGSscquzVMmQBzVRhUB5UDhc4huczktEVPkUeOVUI9VVFXv P+bltxnffRQyTgVAYQXq9QddBoFCeDlqtVAuDzfiYQOz5llOTOnkPtfCKefNXYnnAzNJ uRhb2V/r2QN1/E1I1nqhO70fPm7xQ9UCsuhhB2HiOnHapNSYgLgUdrCaAgNpvmilif2T gxIA== X-Forwarded-Encrypted: i=1; AFNElJ8sQeahzZT6ka8lKGj4t35MMapsgVr+zAHhY+yGhuZ7UIbXeGe26pAXqQipsC+BpIYmJ61YIAdkENg=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8kkzyQHEcVFUSIh9uW7NhFgIlp+sOGIDxdJTftUJgODpYv5RA yez+AQk4pHxAxsz9wJ2h1pHF6kKZHXjgeso9AXqq2bkJKEOZOi37dDSma0NJ7h2Bxw8= X-Gm-Gg: Acq92OGEO1JZGckZdVbqYeZbmWoJARZnEQ+Wn5guF8wnAO15VE3CArH49FGCk1MhXxD 4sQXzDg8cXP+b5oFULrRwpV98u6UNarcHCHG+gpIfl+Qh0Ao/DC4NvjqBZqSHfB6LnNgixchLXF 5QualCkdTLdZpG9ZL7YNy2f4TRQkwheUhU97cP4Rj2xXzO6EhAhNgb0pEVyK0HUAJpqaX1pSbQj E2vugALdvxDCK5b0FR8ROofTEZKQn01L6dwpaddagWQNzTzSukCupJ8osUfYOU4DVg9qX7cnH3V ZpDcyw4m7Nf3TxS4MZItLHj8KTKzziB9hwtp8aJICDm0aEnhxKzJ7Z1+mYt9deR5euPbxv0fCEF 1+LYHGX+60tpa3jL+h1G6PTac3BWX3fInRzrfqDvcjKRYOlnCpWvAfP2XKa9NSoHJVVTDlMexs/ devODGkXL7JOjH+VP9Z3gbJz7E02ALwWho85E/ X-Received: by 2002:a05:6000:1acc:b0:43d:7e11:1b72 with SMTP id ffacd0b85a97d-45c57de9e7emr5052075f8f.9.1778677459533; Wed, 13 May 2026 06:04:19 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45ba2aaec3asm11115693f8f.15.2026.05.13.06.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 06:04:18 -0700 (PDT) Date: Wed, 13 May 2026 15:04:15 +0200 From: Petr Mladek To: Andrew Murray Cc: Jonathan Corbet , Shuah Khan , Russell King , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Steven Rostedt , John Ogness , Sergey Senozhatsky , Andrew Morton , Sebastian Andrzej Siewior , Randy Dunlap , Clark Williams , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-rt-devel@lists.linux.dev, Linus Torvalds Subject: Re: [PATCH RFC] printk: remove BOOT_PRINTK_DELAY Message-ID: References: <20260505-printk_delay-v1-1-5dba51d7f17c@thegoodpenguin.co.uk> Precedence: bulk X-Mailing-List: linux-doc@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: On Wed 2026-05-06 23:37:01, Andrew Murray wrote: > On Tue, 5 May 2026 at 15:26, Petr Mladek wrote: > > > > On Tue 2026-05-05 14:45:00, Andrew Murray wrote: > > > The CONFIG_BOOT_PRINTK_DELAY option enables support for the boot_delay > > > kernel parameter, this allows for a configurable delay to be added before > > > each and every printk is emitted. This is DEBUG_KERNEL option that is > > > helpful for debugging as kernel output can be slowed down during boot > > > allowing messages to be seen before scrolling off the screen, or to > > > correlate timing between some physical event and console output. > > > > > > However, since the introduction of nbcon and the legacy printer thread for > > > PREEMPT_RT kernels, printk records are now emited to the console > > > asynchronously to the caller of printk and its boot_delay. The delay added > > > by boot_delay continues to slow down the calling process, but may not have > > > any impact to the rate in which records are emited to the console. For > > > example, if delay_use is set to 100ms, and the printer thread has a > > > backlog of more than 100ms, perhaps due to a slow serial console, then the > > > records will appear to be printed without any delay between them. > > > > > > It would be unhelpful to add a delay to the printer thread, and it would > > > not be possible to disallow selection of CONFIG_BOOT_PRINTK_DELAY at build > > > time as it's not possible to detect which consoles are nbcon enabled at > > > build time. Therefore, let's remove this feature. > > > > Heh, Randy proposed to remove "boot_delay" few days ago. > > This RFC goes even further and remove both "boot_delay" and > > "printk_delay". > > Apologies, I didn't see this. I'll co-ordinate with Randy. No need to apologize. > > Honestly, I do not feel comfortable by this. The delay seems to > > be handy when there is only graphical console. I would suggest > > to do: > > > > 1. Obsolete "boot_delay" with "printk_delay" as > > proposed in Randy's thread, see > > https://lore.kernel.org/all/afn2sYKKsqG4QBVX@pathway.suse.cz/ > > Your suggestion was: > > " 1. Add "printk_delay" early_param() which would allow > to set "printk_delay_msec" via command line." > > And I assume the intent is to replicate the functionality of > boot_delay, by allowing printk_delay to be used to introduce delays > from early_param time? Thus deprecating delay_use. Exactly. > > " 2. Modify boot_delay_setup() to set "printk_delay_msec" as well. > In addition, it might print a message that it has been > obsoleted by "printk_delay" and will be removed." > > Given the intent may be to deprecate boot_delay, I'm not sure that > setting printk_delay_msec as well would be beneficial, as this would > extend its functionality to add delays beyond SYSTEM_RUNNING which is > where boot_delay stops. Unless you mean to use boot_delay as an alias > to an early_param hook for printk_delay? I do not think that this is a big problem. As you write below, it is a debug feature. IMHO, people debugging boot problems won't mind when the delay continues beyond SYSTEM_RUNNING. And if anyone complains than we would at least know that there are people using this feature ;-) > It seems that there are also differences in behavior between > printk_delay and boot_use, with printk_delay unconditionally adding > delays to all printks, and delay_use which considers the loglevel. The unconditional delay does not make much sense. I consider it a bug. > > > > 2. Move printk_delay() from vprintk_emit() to > > console_emit_next_record() and nbcon_emit_next_record(). > > > > For nbcon console, even better would be to use a sleeping > > wait in nbcon_kthread_func(). But it would need some > > changes to call it only when a record was really emitted. > > Also we would need to use the busy wait in > > __nbcon_atomic_flush_pending_con(). > > This makes sense. > > If the use case (in a post kthread printk thread world), is only > relevant for graphical consoles, then I do wonder if printk_delay and > boot_delay can be replaced with a more specific solution? Now that we > have printk threads, the time in which a printk is presented to the > user may not relate to when it was created, and I fear people may > continue to debug issues that rely on that assumption. > > I think the most pragmatic solution for now is: > - Move the printk delay to the point where the printk is actually > printed (e.g. console_flush_one_record and descendants) > - Add an early_param to allow for printk_delay_msec to be set > - Deprecate boot_delay, by using it as an alias for setting > printk_delay_msec, and include a user mesage that it is being > deprecated and that it now extends to beyond boot (which could impact > performance on non PREEMPT_RT and non nbcon systems) Sounds good. > - Update printk_delay function to use the appropiate mechanism to > delay based on stage of boot and using printk_delay_msec instead of > boot_delay. Good point! I thought that mdelay() can be used even for the early messages because parse_early_param() is called right before parse_args() in start_kernel() in init/main.c. But parse_early_param() might be called even earlier, for example, by setup_arch in arch/x86/kernel/setup.c. And it is called before + tsc_early_init() + tsc_enable_sched_clock() + loops_per_jiffy = get_loops_per_jiffy() which seems to be used by + mdelay() + udelay() + __const_udelay() Anyway, it has to be done before printk_delay_msec() can be set via an early parameter. > If that makes sense I can fashion a patchset. That would be great. Best Regards, Petr PS: Note that I am traveling the following week so my review might get delayed.