Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp579734pxb; Tue, 15 Feb 2022 22:44:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNLAVg31A/Khz7whGP3I4nPxiyr1ahYOCYk5td/QaGwnpfnFYPbB5rOqgC/fESiXDSw38b X-Received: by 2002:a17:902:c784:b0:14c:8b35:e16d with SMTP id w4-20020a170902c78400b0014c8b35e16dmr1539615pla.78.1644993888049; Tue, 15 Feb 2022 22:44:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644993888; cv=none; d=google.com; s=arc-20160816; b=EvbFyjgCAoqn3Vmh0Osc9U9h73+0St7O2NJVtAuAgaZX6oVzRt3Sk3RzPGnHEVny0C qD2GKcgOTdDvbaCkBiOPx+1srtvItkfRX6xnihFx+AGvZBvMnuWPZua4lfqQ39+7OU9a KL/Y+QrmodYhfyrQOzybMhjQquJk+S2IcuejAoEHd+3RWP1dHCDFHVsrr7AYEnBufKpa 5CjzjNUtQX15QMp330kpiQ2yE3sFyVYgarr/8/tAcM5BNNbjvRmkPJjbKgyCaR+5P+rc r/pPD3CyscDjvCP0vnnmzlFOo+GSRPdR0xdwt/mJmqmjzUmCdyTpkV7zLdssI9Bu7dJ3 2glQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=6PgsBMBaD1VL/blQ9NGFYKVy9dzfRCvZ4SmB2o7/hv0=; b=JP0d+Ob8x2KGC0Sk1I7uffhBqx8urO7Jr6tz8NO569an/bLVH8oKIbK5VdqSgC/Ohd nD3i8YX0LWNN4rRh5UL09QIgl+bz/FTBYtN+8VTFv2bGUeKsUKC7yq5jKtb8v0wy8nP9 mvSWTxzK26meSl84z6cRuGV5XErGJSLHSxQVanUx4kMHb0AJr/yrlXFjl+bU62HUykY5 hzPX0NFxQfS36D5TwaQIQwj5r7abe2/yX2VB074PfUy+guT+hPGdeifvN1N6CpDXUEZd CpCZlk4A0ekFJsZAlfSXTNSjTb49pykIinxodADJjfF/8Nq43lwBw9wmaz7IEy6Ra6t7 Wf5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=C3LVhzk8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z9si5327259pgu.60.2022.02.15.22.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:44:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=C3LVhzk8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 01896275DC; Tue, 15 Feb 2022 22:31:34 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241514AbiBOTdY (ORCPT + 99 others); Tue, 15 Feb 2022 14:33:24 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233812AbiBOTdW (ORCPT ); Tue, 15 Feb 2022 14:33:22 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 130DBB7C72; Tue, 15 Feb 2022 11:33:11 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1644953589; 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=6PgsBMBaD1VL/blQ9NGFYKVy9dzfRCvZ4SmB2o7/hv0=; b=C3LVhzk8ug+ZT17S1HvaW+HMsdFerPa+zBeWUuRyzN32pFYEcihEuz8evEnCqtZravA1s7 MMNQT+e5oWjqZpC8QGpUKW0FYaNNbQMAnsCwNDpygvIX/CCEor4ZJ/Y0LYYWipNWTvbFi+ 0E3pVP0SRbOqJGZEZvQ7nvUB1HjEPtxiYhKLXKRHSI4oKsX5LHYZMJE3BlTt6Sih1O6uMb 7WoU+QR8Ucwsa5b9oN73B9yyS0zJBNtTDN7YgTcyg2htWlacWz9ffG9ZsU875Xy1g/mAV7 GmNZC/BmfRZsTTS0GsItNoNbr0OZXEb/X/vVNq12daUUyzq8d6IfudbyoSti2A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1644953589; 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=6PgsBMBaD1VL/blQ9NGFYKVy9dzfRCvZ4SmB2o7/hv0=; b=r8YVCNMtnNMWlKQh6mpyzy8Lii7Hxnfat9/Yy8v7nrBFS8ZHA5jEZayKmaX1yiHQl0KEqQ E9128Mys8LAY+JDw== To: Daniel Bristot de Oliveira , Shuah Khan , Steven Rostedt Cc: Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Gabriele Paoloni , Juri Lelli , Clark Williams , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org Subject: Re: [RFC V2 12/21] rv/reactor: Add the printk reactor In-Reply-To: <65172f14-bad6-37b1-d243-e91ca472d22e@kernel.org> References: <10cf6003-6d2b-056b-11bb-3ae9c342a369@linuxfoundation.org> <87v8xg30qc.fsf@jogness.linutronix.de> <45179cdb-2391-207a-2f7b-2dea828d1606@kernel.org> <87r1842r1m.fsf@jogness.linutronix.de> <65172f14-bad6-37b1-d243-e91ca472d22e@kernel.org> Date: Tue, 15 Feb 2022 20:39:08 +0106 Message-ID: <874k50hqmj.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INVALID_DATE_TZ_ABSURD,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-02-15, Daniel Bristot de Oliveira wrote: > I am aware of printk_deferred(), and every once and while I am Cc'ed > on patches suggesting changing printk() to printk_deferred(), but they > are not, let's say, welcome [1]... that is why I am not using it. Yes. printk_deferred() is a workaround until we can get printk "PROVE_RAW_LOCK_NESTING clean". But currently there is real deadlock potential in the kernel with printk. For the most common cases, we use printk_deferred() to get around it. Once printk() is clean, we can replace all printk_deferred() call sites with printk(). I haven't looked into the details of your runtime verification method, but I assume it digs deep into some interfaces. In that case, the deadlock potential of printk may be relatively high. (And indeed, you have seen some.) IMHO, before warning users not to use this reactor if locks XYZ are taken, it would be better just to use printk_deferred() and it will always log without causing problems to the system you are trying to verify. > I saw deadlocks in the past, and while testing the WIP monitor some > time ago, it seems it depends on the console type. If such restriction > does not exist anymore, I can remove that comment, it would be even > better! If you say it depended on the console type, then it was probably the framebuffer console that was at fault. The fbcon is a landmine for deadlocks, which is why PREEMPT_RT avoids fbcon printing from non-preemptible context. For mainline, the series is currently in review. Perhaps avoiding fbcon would be good enough for you to avoid deadlocks with this reactor using printk(). John > [1] https://lore.kernel.org/lkml/e68888438cec9a1da53aaa1647720ade638d6ad4.1600705105.git.bristot@redhat.com/