From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F4A8C433F5 for ; Thu, 24 Feb 2022 08:27:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231877AbiBXI1k (ORCPT ); Thu, 24 Feb 2022 03:27:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231742AbiBXI1j (ORCPT ); Thu, 24 Feb 2022 03:27:39 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDBE8114761 for ; Thu, 24 Feb 2022 00:27:09 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 7BD3D1F3A1; Thu, 24 Feb 2022 08:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1645691228; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gSTuU8j1qrBHesfm8aUsNphEOTThQkaUDOZ+qeWaRwE=; b=m3O/EhMObybgNG7yX7tVQU7By1jzUyt1VbZbeC2hmEzYUGOPTgJhBomaf9376RyINrZZvV 21IabhVIg/UbUP3HPvQomFHTpckMOCn+Au+pNNHYWTHD8yJFD2muUbZPk2PFHg7c/zMd// jlSN8Qk3NWnaihpxM49ZAj1KjFxlGm4= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 31D9AA3B83; Thu, 24 Feb 2022 08:27:04 +0000 (UTC) Date: Thu, 24 Feb 2022 09:27:04 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH printk v1 11/13] printk: reimplement console_lock for proper kthread support Message-ID: References: <20220207194323.273637-1-john.ogness@linutronix.de> <20220207194323.273637-12-john.ogness@linutronix.de> <87o8333l97.fsf@jogness.linutronix.de> <87h78pqz2h.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h78pqz2h.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2022-02-23 18:26:54, John Ogness wrote: > On 2022-02-22, Petr Mladek wrote: > >> With a mutex there is an owner. When another task tries to lock a > >> mutex, the scheduler knows which task must be scheduled to resolve > >> this true lock contention. (There are also other benefits relating to > >> priority inheritance, but I chose not to mention this.) > > > > This sounds interesting. Does scheduler wake up or prioritize > > mutex owners? > > Sorry, the only example of this is priority inheritance. But for > non-PREEMPT_RT there is no priority inheritance. The lock would need to > be an rtmutex for this ability, which probably doesn't make sense for > printk. Good to know. > The v2 commit message will focus on: > > - the motivation for per-console locks is parallel printing > > - explain about how disabling preemption is only necessary for direct > printing via printk() because the caller may be holding > system-critical and/or timing-sensitive locks (and also to allow the > console owner/waiter logic to work correctly) > > - correctly clarifying why the various types > (semaphore/mutex/flag/atomic) were chosen to implement the printing > sychronization between atomic-direct, non-atomic-direct, and kthreads > (and I will explicitly remind the audience that mutex_trylock() cannot > be used in atomic context) Sounds great. Thanks a lot for the hard work. It is very appreciated. Best Regards, Petr