From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lQtWo-000j8m-Lg for kexec@lists.infradead.org; Mon, 29 Mar 2021 15:10:30 +0000 From: John Ogness Subject: Re: [PATCH next v1 2/3] printk: remove safe buffers In-Reply-To: References: <20210316233326.10778-1-john.ogness@linutronix.de> <20210316233326.10778-3-john.ogness@linutronix.de> <87pmzmi2xm.fsf@jogness.linutronix.de> Date: Mon, 29 Mar 2021 17:10:02 +0200 Message-ID: <87sg4e6lo5.fsf@jogness.linutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Eric Biederman , Nicholas Piggin , Christophe Leroy , Alistair Popple , Jordan Niethe , Peter Zijlstra , =?utf-8?Q?C=C3=A9dric?= Le Goater , Andrew Morton , Kees Cook , Yue Hu , Alexey Kardashevskiy , Rafael Aquini , Tiezhu Yang , "Guilherme G. Piccoli" , "Paul E. McKenney" , linuxppc-dev@lists.ozlabs.org, kexec@lists.infradead.org On 2021-03-29, Petr Mladek wrote: > I wonder if some console drivers rely on the fact that the write() > callback is called with interrupts disabled. > > IMHO, it would be a bug when any write() callback expects that > callers disabled the interrupts. Agreed. > Do you plan to remove the console-spinning stuff after offloading > consoles to the kthreads? Yes. Although a similar concept will be introduced to allow the threaded printers and the atomic consoles to compete. > Will you call console write() callback with irq enabled from the > kthread? No. That defeats the fundamental purpose of this entire rework excercise. ;-) > Anyway, we should at least add a comment why the interrupts are > disabled. I decided to move the local_irq_save/restore inside the console-spinning functions and added a comment for v2. John Ogness _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec 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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3BBDC433E0 for ; Mon, 29 Mar 2021 15:10:44 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4131B6192E for ; Mon, 29 Mar 2021 15:10:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4131B6192E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4F8GH64jnGz30JV for ; Tue, 30 Mar 2021 02:10:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=3lmkfVXQ; dkim=fail reason="signature verification failed" header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=IAdBFzE0; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linutronix.de (client-ip=2a0a:51c0:0:12e:550::1; helo=galois.linutronix.de; envelope-from=john.ogness@linutronix.de; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=3lmkfVXQ; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=IAdBFzE0; dkim-atps=neutral Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4F8GGb5k2Sz2yRg for ; Tue, 30 Mar 2021 02:10:15 +1100 (AEDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1617030603; h=from:from:reply-to:subject:subject: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=czaWfQDmWfTZZyk40/r3fn5m8w82rCTMKw/DG6KyCoA=; b=3lmkfVXQ6Kn8x60NUjbCQEHJ6ITAaNLJLrTnRuRX79GChppNS9h4DSkLF9ihUdwo1uxBBf nRbSqQ7ZgOFX/uwi8bTzSHRM2J7jRcMz+LBfdbllOjxGHkLMkCsWez4kglhEbvuHhpEUUs IckgkHO26+svKMgFIWzihmC95ey6tfnNRWzz33LTUZn5t6psLWN5YNgYffoS5d/azDT+4F R8YtzpNyVod55yDrfeqRVze0rWL4ZPvemU3Qvb7xvlqL2wEbZQrLZmQwA+f2tlDQdvYNHz XcUrWIXlJ6UH4PiTv6M/UYTqpmgVxiA3F7vils6OtvtTO4ZQW7Dv93hVGX8P2w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1617030603; h=from:from:reply-to:subject:subject: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=czaWfQDmWfTZZyk40/r3fn5m8w82rCTMKw/DG6KyCoA=; b=IAdBFzE0yMQolHI4rDtJPaIUbjeNL+Gd3Mx/YUdTHGxrOCZhymDMIWuCIWSOB9MI2RgLFn p9Fb5UQys2JfXMAg== To: Petr Mladek Subject: Re: [PATCH next v1 2/3] printk: remove safe buffers In-Reply-To: References: <20210316233326.10778-1-john.ogness@linutronix.de> <20210316233326.10778-3-john.ogness@linutronix.de> <87pmzmi2xm.fsf@jogness.linutronix.de> Date: Mon, 29 Mar 2021 17:10:02 +0200 Message-ID: <87sg4e6lo5.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergey Senozhatsky , Peter Zijlstra , Paul Mackerras , Tiezhu Yang , Rafael Aquini , Alexey Kardashevskiy , Yue Hu , Jordan Niethe , Kees Cook , "Paul E. McKenney" , Alistair Popple , "Guilherme G. Piccoli" , Nicholas Piggin , Steven Rostedt , Thomas Gleixner , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky , Eric Biederman , Andrew Morton , linuxppc-dev@lists.ozlabs.org, =?utf-8?Q?C=C3=A9dric?= Le Goater Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 2021-03-29, Petr Mladek wrote: > I wonder if some console drivers rely on the fact that the write() > callback is called with interrupts disabled. > > IMHO, it would be a bug when any write() callback expects that > callers disabled the interrupts. Agreed. > Do you plan to remove the console-spinning stuff after offloading > consoles to the kthreads? Yes. Although a similar concept will be introduced to allow the threaded printers and the atomic consoles to compete. > Will you call console write() callback with irq enabled from the > kthread? No. That defeats the fundamental purpose of this entire rework excercise. ;-) > Anyway, we should at least add a comment why the interrupts are > disabled. I decided to move the local_irq_save/restore inside the console-spinning functions and added a comment for v2. John Ogness 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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC267C433E1 for ; Mon, 29 Mar 2021 15:10:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91F8061987 for ; Mon, 29 Mar 2021 15:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230338AbhC2PKN (ORCPT ); Mon, 29 Mar 2021 11:10:13 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:37130 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbhC2PKF (ORCPT ); Mon, 29 Mar 2021 11:10:05 -0400 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1617030603; h=from:from:reply-to:subject:subject: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=czaWfQDmWfTZZyk40/r3fn5m8w82rCTMKw/DG6KyCoA=; b=3lmkfVXQ6Kn8x60NUjbCQEHJ6ITAaNLJLrTnRuRX79GChppNS9h4DSkLF9ihUdwo1uxBBf nRbSqQ7ZgOFX/uwi8bTzSHRM2J7jRcMz+LBfdbllOjxGHkLMkCsWez4kglhEbvuHhpEUUs IckgkHO26+svKMgFIWzihmC95ey6tfnNRWzz33LTUZn5t6psLWN5YNgYffoS5d/azDT+4F R8YtzpNyVod55yDrfeqRVze0rWL4ZPvemU3Qvb7xvlqL2wEbZQrLZmQwA+f2tlDQdvYNHz XcUrWIXlJ6UH4PiTv6M/UYTqpmgVxiA3F7vils6OtvtTO4ZQW7Dv93hVGX8P2w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1617030603; h=from:from:reply-to:subject:subject: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=czaWfQDmWfTZZyk40/r3fn5m8w82rCTMKw/DG6KyCoA=; b=IAdBFzE0yMQolHI4rDtJPaIUbjeNL+Gd3Mx/YUdTHGxrOCZhymDMIWuCIWSOB9MI2RgLFn p9Fb5UQys2JfXMAg== To: Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Eric Biederman , Nicholas Piggin , Christophe Leroy , Alistair Popple , Jordan Niethe , Peter Zijlstra , =?utf-8?Q?C=C3=A9dric?= Le Goater , Andrew Morton , Kees Cook , Yue Hu , Alexey Kardashevskiy , Rafael Aquini , Tiezhu Yang , "Guilherme G. Piccoli" , "Paul E. McKenney" , linuxppc-dev@lists.ozlabs.org, kexec@lists.infradead.org Subject: Re: [PATCH next v1 2/3] printk: remove safe buffers In-Reply-To: References: <20210316233326.10778-1-john.ogness@linutronix.de> <20210316233326.10778-3-john.ogness@linutronix.de> <87pmzmi2xm.fsf@jogness.linutronix.de> Date: Mon, 29 Mar 2021 17:10:02 +0200 Message-ID: <87sg4e6lo5.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-03-29, Petr Mladek wrote: > I wonder if some console drivers rely on the fact that the write() > callback is called with interrupts disabled. > > IMHO, it would be a bug when any write() callback expects that > callers disabled the interrupts. Agreed. > Do you plan to remove the console-spinning stuff after offloading > consoles to the kthreads? Yes. Although a similar concept will be introduced to allow the threaded printers and the atomic consoles to compete. > Will you call console write() callback with irq enabled from the > kthread? No. That defeats the fundamental purpose of this entire rework excercise. ;-) > Anyway, we should at least add a comment why the interrupts are > disabled. I decided to move the local_irq_save/restore inside the console-spinning functions and added a comment for v2. John Ogness