Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp771777rwb; Wed, 9 Nov 2022 08:26:31 -0800 (PST) X-Google-Smtp-Source: AMsMyM638+Xt4BZn68ax91RvJ3+/2vjBPK7msxrRnIcs1UokTICc3AEdWe9zmw6ZPL5WOzX6YifP X-Received: by 2002:a17:90b:1642:b0:213:f368:648b with SMTP id il2-20020a17090b164200b00213f368648bmr49938942pjb.173.1668011191480; Wed, 09 Nov 2022 08:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668011191; cv=none; d=google.com; s=arc-20160816; b=SIXKZnPinr80JmcCnSXdA5ZK/igSz5Vwn83o3dcOTb3pS/iY+MPd6uXLPcVrbOaGO8 +2qrawa6pKsL/gY95caEkgAymgaJyiIdT1TJdiaJAKNaBWp/6RBYLPCVCl748tJlP29V kOTE6LZzJe+U3hOsZbeUsl5TjjL8c89J1if8xBZP6N7sWJynFtuCL3IIbYqaMs1EXjDR 2NlJ7N0gSmAhKTgWjLFsoRa0pSmNPgKUEBy4s+esdKvJ/bnVfM9owteVJ9YlFCccyVdH 6b8Pio1JEyOBWLiF9rQVU28F7PyQ7vU4cYH+pCQk6KNECigoLlZeOcCyXIbtCYWFkhjE 0hww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V1+Ulj90x4+D/oPVdeVQI6aglYv6ToQZfDYujvKSNLQ=; b=ELH6xBMt6UCxzT38xGxKD7LmFSa2OWxUS6l5DSxthk8vRGsXlaO0F1I3nKxf4XzX1/ ZH7sQdL1FCTcxGAj+09NCUHjUB9ob9BiAzoiEd4kyKCeZczMr6kbp11sDgBi6yaA4XoU DUo5JvOsmJiPL1q46d96z4iJ8v3FQGHxzstK8BOMJkkndkBG5wybC5RecHcCwGdSxMtH w/XGx2isIhJeGjvkSiTKIkhdjBPeuNdEJ6uhXclyVqOF2ZjWjVkdzMFS9yqtqGQS9qki YkE5c4kwf0tZFqJu3Oq3VN06d7KPq4itujYOZ77Q/2RY7AMRFRDUo0/+SCyFMPCyUG/D WbYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=uD+6JYMI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h18-20020a056a00219200b0056d64402a60si20473958pfi.94.2022.11.09.08.26.19; Wed, 09 Nov 2022 08:26:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=uD+6JYMI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232095AbiKIP1t (ORCPT + 92 others); Wed, 9 Nov 2022 10:27:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232093AbiKIP1r (ORCPT ); Wed, 9 Nov 2022 10:27:47 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A3181EEE5 for ; Wed, 9 Nov 2022 07:27:46 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id ED10F22A0E; Wed, 9 Nov 2022 15:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1668007664; 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=V1+Ulj90x4+D/oPVdeVQI6aglYv6ToQZfDYujvKSNLQ=; b=uD+6JYMINwOV2Vm5q0jNPmVCJfHu73njXxbn3VTkihNixa9TCw4tv5hVaIxKroOZTEf08c hBJ5Dyi0OlaIjplZmjXckAWIBC8mzfoYe/USosGmfTzAhf94VRgyj7Ozn81iLrtSdlPbnd gRmV+f8jN/L+0CPr84wtM+80KHmDm6I= Received: from suse.cz (unknown [10.100.201.202]) (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 A987C2C141; Wed, 9 Nov 2022 15:27:44 +0000 (UTC) Date: Wed, 9 Nov 2022 16:27:44 +0100 From: Petr Mladek To: John Ogness Cc: Daniel Thompson , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Jason Wessel , Douglas Anderson , Aaron Tomlin , Luis Chamberlain , kgdb-bugreport@lists.sourceforge.net Subject: Re: [PATCH printk v3 15/40] kdb: use srcu console list iterator Message-ID: References: <20221107141638.3790965-1-john.ogness@linutronix.de> <20221107141638.3790965-16-john.ogness@linutronix.de> <20221109085325.wiub564iqnewvczb@ash.lan> <87wn848okk.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wn848okk.fsf@jogness.linutronix.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 Wed 2022-11-09 10:33:55, John Ogness wrote: > Hi Daniel, > > On 2022-11-09, Daniel Thompson wrote: > >> + /* > >> + * The console_srcu_read_lock() only provides safe console list > >> + * traversal. The use of the ->write() callback relies on all other > >> + * CPUs being stopped at the moment and console drivers being able to > >> + * handle reentrance when @oops_in_progress is set. (Note that there > >> + * is no guarantee for either criteria.) > >> + */ > > > > The debugger entry protocol does ensure that other CPUs are either > > stopped or unresponsive. In the case where the other CPU is unresponsive > > (e.g. timed out after being asked to stop) then there is a "real" printk() > > issued prior to any of the above interference with the console system to > > the developer driving the debugger gets as much clue as we can offer them > > about what is going on (typically this is emitted from regular interrupt > > context). > > > > Given this comment is part of the debugger code then for the > > oops_in_progress hack it might be more helpful to describe what > > the developer in front the debugger needs to do to have the most > > reliable debug session possible. > > > > There is no guarantee that every console drivers can handle reentrance > > in this way; the developer deploying the debugger is responsible for > > ensuring that the console drivers they have selected handle reentrance > > appropriately. > > Thanks for the explanation. I will change the comment to: > > /* > * The console_srcu_read_lock() only provides safe console list > * traversal. The use of the ->write() callback relies on all other > * CPUs being stopped at the moment and console drivers being able to > * handle reentrance when @oops_in_progress is set. > * > * There is no guarantee that every console driver can handle > * reentrance in this way; the developer deploying the debugger > * is responsible for ensuring that the console drivers they > * have selected handle reentrance appropriately. > */ Looks good to me. After merging this with the 10th patch that adds the data_race() annotated check of CON_ENABLED flag: Reviewed-by: Petr Mladek Best Regards, Petr