Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1010805rwb; Tue, 27 Sep 2022 07:22:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7QcpdMbjJb5lZ12zwy1gbgHQiG4EpQMPFOOIGirP7h3AUkIRJnAgc2iIGq5G8dGJcAIV0s X-Received: by 2002:a05:6a00:4206:b0:545:68f2:292e with SMTP id cd6-20020a056a00420600b0054568f2292emr29329853pfb.76.1664288531334; Tue, 27 Sep 2022 07:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664288531; cv=none; d=google.com; s=arc-20160816; b=J3TRucpVXKi+ibCJSwaM+YJjpeWavBzEl7EefRUebtwX6S3Dm87+VdYQdo9G9UUydH oetXAGx8/1MhZf866Rt3onrpfh6Io6udM3aFru1LLrK6wEsjeb3CB1osOB225tpwk9vj wFWSOJCIzr5viJ12BeIILk376lyFQvG4zGYv1xqWDRHK1TzMkq86nr/O0sysQo8fdOFZ E4G2ieyRLc4JGoCkpeJNF5GyqQMWmszjkqNWyUTUPBgYRTyX8lruChx+DFDRp/dIh6hP hlFeF6/LHnpBiPxGRU0qw0FsFpb65+vYsbDTrRrO3Vol2MN0/3d/I2qHzfAaq5lm+lCe 0ksA== 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=aIU3e8VKH70dw1DweZz2Ipe29gs7JBQEVsw+CaMYFWQ=; b=O65SK2Bmv6mw/9vaBi5d+XUhoVW/EWR2bCPwTnJd/9KLlJqSAcQc7AjXVbOOPsNE5H 6Lf7IR8j1pJTvFsH14RZPjy1x54K+OqgeBaMdkXDXs/3CadTgcJ/Tckcyo6cvLBcV1nW nmweMSqNK1I8+VsiP/ptca1qiHRTFp6ysEv+jx+FlHSd3SySet3Z7VegjUrzaBKMolve 4qB1lZyGSKiQzax4/RMSq02EgbxZHyqzQEu40+A3CHv0tNP22XlEqYpww7d7XqDLSC7R mtG5jTWj3sGT0RSwGBnu55mmKE86EHwnoVgCHEXLrEZ6veAJskttl+r7/tbQsYVfcydd 4ZpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=XI9wUmed; 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 j9-20020a170902da8900b00172fa1d47d4si2011108plx.509.2022.09.27.07.21.59; Tue, 27 Sep 2022 07:22:11 -0700 (PDT) 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=XI9wUmed; 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 S232627AbiI0OH0 (ORCPT + 99 others); Tue, 27 Sep 2022 10:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbiI0OHS (ORCPT ); Tue, 27 Sep 2022 10:07:18 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3193113940B; Tue, 27 Sep 2022 07:07:14 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 3E35621E8E; Tue, 27 Sep 2022 14:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1664287633; 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=aIU3e8VKH70dw1DweZz2Ipe29gs7JBQEVsw+CaMYFWQ=; b=XI9wUmedMf6E1UyuWc4e3n79LzQubDy33YGPFwjBlfACKRnDjZyR7HEY30BmRQLbaUe0Cd qSD+VJb4hDaNJVohyul9WGMIRkObQhYCRD+u0fnDEFPzn/ND/e4I+3XQeHX6AnN8drkelU dBXjPszwCK2CCOOPC5Jj3VoDX23XI10= 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 D9B932C166; Tue, 27 Sep 2022 14:07:12 +0000 (UTC) Date: Tue, 27 Sep 2022 16:07:09 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH printk 07/18] printk: Convert console list walks for readers to list lock Message-ID: References: <20220924000454.3319186-1-john.ogness@linutronix.de> <20220924000454.3319186-8-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220924000454.3319186-8-john.ogness@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 Sat 2022-09-24 02:10:43, John Ogness wrote: > From: Thomas Gleixner > > Facilities which expose console information to sysfs or procfs can use the > new list protection to keep the list stable. No need to hold console lock. > > drivers/tty/tty_io.c | 6 +++--- > fs/proc/consoles.c | 6 +++--- > kernel/printk/printk.c | 8 ++++---- As described in the review of the 6th patch, the semantic of the list_lock (module_mutex) is not well defined from my POV. I would prefer to keep only one global console lock. That said, the procf and sysfs interface is read-only. It seems to be safe to show the info under the new console_srcu read lock. On the other hand, console_device() should see the console list in a consistent state. The first console with tty console->driver should have the CON_CONSDEV flag set. Alternatively, we could manipulate the list and the flag a safe way from the SRCU POV but it is not worth it. So, I would keep console_lock() in console_device() for now. Best Regards, Petr