From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 5C68326E6F3 for ; Wed, 13 May 2026 13:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778677462; cv=none; b=KPyv0ljUbL4dslX3TsLq9svIo3wFvdsA/sblkpuOWhMkaavgbqI1HFn2hoknt0jZJgtgb6ICSNxNQAL0UYRzTMAr5mXP6DQd1QrSXq2IaZWp1RoQljnwotaa8j83R/yfFMz7lr1LipPQDObT74yfudTSO7/dITrLP3Uyr9xHVWM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778677462; 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=pNpr6cbSvhfKggX0hwRvJ240jDT6sjQOUZ+XRPCnsjqbUi9t/KaVxnqAhF483DNx7KuaB8qsFQluNT1bEjpS4c2nzYqbuoX7WZ+YEE4v6hemmT8u/REl0P3QhwPiVoyAHWVjVxKXjy6rYRtOsycuH4L4SONXGC6+QwU342UCFvY= 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.47 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-f47.google.com with SMTP id ffacd0b85a97d-43d77f6092eso4255829f8f.2 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=MUoY4n0QkloHdO3SQ4oF9Pzu+BrbammpZuZj8FqUgChZZhdGkSDR699nsnwHNPm15/ kGc4AyInH3X/bB0SwyTjukpan7oMsfZe4P8L0GlJBLH8KisH3LrochbuG/aFHGFxqdjz a3b+dhm2chJJW5yKw1SL6Y/j2fDDCJ3nJPkbLIQ5nC8E5E5zgKUxf47mhXP1BhAos3BI 7qkOpgGBdg8pHCkDF5VClvrTs5GH1dgK+Bt52o2V+xQbYRkescDMlyXJlWHDCQvqqMVw scS7hTYayfNzUQ3/an36K534x/yDqo+5MKS6U/Z3EHYWPS1Xnq22ZJL97PM7s3Uxxw5Q J5ug== X-Forwarded-Encrypted: i=1; AFNElJ/Q+EOK64OAW2hvKNiqHtcNTvsfXxWQ/vGT8KbZtfLgL0J09ZgluOB5fXH8n0YPCn5r9+19ViMAqd6RTkg=@vger.kernel.org X-Gm-Message-State: AOJu0Yzzfx/RhBH2pzSFNm/euQRH6VTfBrVSDPygbFwEYu2kwevg5brA 5UBHFaFifMFjI3txyT79IZsUbt9wqnE5zy+HN4Rw3dD+wtx/YMFrtsC00aABHDKLnYY= X-Gm-Gg: Acq92OEEg1cF3xm1+muRqsFpDKABQAfmc06kIizj5SBeo2NjH+UjhlJ1FXFgjajx/HT YJ5YW9Dt4eu9Sev6TGVQfF2sfqE+whwc/HM5LGJwzEOQMZ7m96cUncyH04VhZ0GGlIFyPdqmAWq 4xcTXPhKq06pw23ApiouJ6E1fhvxcbUSJHzAT1dxTPR9efB/mfjBWb3HGbpExt91KKWhGPGxYgZ C1pypJPDvVqon4Cp6dyd813u8P/eIIVuOn1+0muvYnVaMmuoMR4eN+YK06k29JBCjXHWUSJljB+ kkScz0/WfBsp0lzqS1TYwBYO3Hcu1i0/pIppJpsCa0gjjEr/qYy4iUu0cghvuzdOK4i70MUyXIU RxYuQ6hyCVs1+4bl9oCO0BCsk83+tMSUhxdxDTjaWzCTz66V06L5lU6Os6pVIHIpa+CsvwrWGq6 TZI8q1GFhi6PPDw5/IazhNOrKORqcGnqAuTpKY 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-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: 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.