Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4129718pxb; Mon, 30 Aug 2021 20:07:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTLC4uFAv1kySPUuiEvmGqMzawnzk92Nit6atbzfVSBPyOTXJFrK9Op/Vbntl6S0dBXKhM X-Received: by 2002:a17:906:b00c:: with SMTP id v12mr28076968ejy.222.1630379231955; Mon, 30 Aug 2021 20:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630379231; cv=none; d=google.com; s=arc-20160816; b=dNO/lA390mrB/wlbV9DrS8UKFfa6QZPb94fhvGw1PVK8ZcUYgCKUvZK8SlH1PiQviU sgk/DC/cDF6AA2W36k/pWXVPlOLBEhqv2UeLCrCgX5tSSailBeP9ezHovc9ys4cxJlF8 Giaea4TeRb1lNNrlYcrdW64pI+fX49Ex1JctB7bFqJR8JoNYc6Pg8bl6cpADDZ/sYXQG G2AUOHpuzIj4daehksfq4F00SiFYzls5wvWWHnqQcDjwzf+IeKh8TWSkOO55bsEgp0l3 mEG6EeC4wdUtufeo7I27OZ6PRv3/lRQ2HfrrEVW5BFO8pU4RE+V5MG1VHPSviC3Xk6lA gZug== 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=vzU1A7A9dM6sOFHUb4Dm16KSmTy2qTEVAOWldoDjUvI=; b=vViyCyafsECEkdt8pI3LpWWjJMpAMkezf6WYBuTGIHTjTDqz2k+HIgwigoDdoj0NOj PpPL+mvT+UB1VOexMDu05AxVToFP0tZ1tpg4iD/KrtAlb195NFa8ofYGDOHPtzJFtEEp Kl6QijkmhBf9dTaX1smuPfCB67bEUNz61ExK4WT9PwxQa4d7rFcUMJdjvzJ873HSOQgs bSs2ZyJzXwthX2f7PzQfUIs6PBQ0uFH8K4bcSECuVJJkOFc/SiC4xQgwzTvoTm1DA/UO RLkHa+tJZaP2sJdlhEQfF9JU0ekDgFbJ8WkpxfcYgbW8e3PeJmkLA4maV/ISyrMfsEvE YEEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Y6GZTvHo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si14945750eje.67.2021.08.30.20.06.47; Mon, 30 Aug 2021 20:07:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Y6GZTvHo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbhHaDG0 (ORCPT + 99 others); Mon, 30 Aug 2021 23:06:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239317AbhHaDGZ (ORCPT ); Mon, 30 Aug 2021 23:06:25 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED8FDC061575 for ; Mon, 30 Aug 2021 20:05:30 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id y23so15354104pgi.7 for ; Mon, 30 Aug 2021 20:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vzU1A7A9dM6sOFHUb4Dm16KSmTy2qTEVAOWldoDjUvI=; b=Y6GZTvHocXTL9Usa+zrNZpBvv/xgN/DAYog0Xg4Pbw42E+tQW6TeMBqEhqn/DF5HwJ PQTwLGjqDIbh3Z9xyjXhnXs4PYId/bvA2mXPTXjarlrHe/6OJplZymhbfghcJsaVmF9F qxgo4aDXcxoj7omQDuBQNZ9seX7r6UcefKyI4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vzU1A7A9dM6sOFHUb4Dm16KSmTy2qTEVAOWldoDjUvI=; b=tGIhace0HrdB9rXigKJQGtQIzgmpld21Bu//VfO0kafnUf0Tkt1kkWFwE9ygHPe/9E H5vGsW97s2RStjAQYXOuRK/Yntd0DLzrAdJCipnRNlSggS9JnCtLZT72KZAe6X351e10 /w+c00PT96ImDVUArhvusyKFPhe7wGlYMP6IPCXR2XCqSygfZ2HC14jfl1Bn0Do8gXy6 7Tl2g0npHMJZ3wKZI2WLwefWVw83iL7I0LDHbWCFEeP9IBTSs4zusM0OTSslHWkXppif sO7NVjRQ3U4hayma4dzqyGSB+9/Zoi9cuYJc0iJfdWWnOPGdRmxjWwC7y9n49Og30RfM G2fA== X-Gm-Message-State: AOAM5321vioqGxlQg7I0K7JhNSV10fxsZbE77xnTYVvsE2lCVIZ8d1au MPOsJ/Xm9Aumr/OCnhbN1gCUZPMjdP7Dlg== X-Received: by 2002:a63:ce0f:: with SMTP id y15mr20646899pgf.249.1630379130477; Mon, 30 Aug 2021 20:05:30 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:6d52:87b8:b55b:8800]) by smtp.gmail.com with ESMTPSA id u21sm18911863pgk.57.2021.08.30.20.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 20:05:30 -0700 (PDT) Date: Tue, 31 Aug 2021 12:05:25 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: John Ogness , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v1 06/10] printk: use seqcount_latch for console_seq Message-ID: References: <20210803131301.5588-1-john.ogness@linutronix.de> <20210803131301.5588-7-john.ogness@linutronix.de> <87bl6bx68f.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (21/08/06 17:56), Petr Mladek wrote: > > A solution might be to implement a generic cycle that would use > the right latched_seq and buffers. Something like: > > enum console_mode { > CONSOLE_MODE_NORMAL = 0, > CONSOLE_MODE_ATOMIC, > CONSOLE_MODE_ATOMIC_NMI, > CONSOLE_MODE_REPLAY_ALL, > CONSOLE_MODE_LAST > }; > > struct console_mode_info > { > static char text[CONSOLE_LOG_MAX]; > static char ext_text[CONSOLE_EXT_LOG_MAX]; > static struct latched_seq seq; > }; Seems to me like this wants to be part of struct console. [..] > Problems: > > a) The same line might be printed by more contexts. > b) per-console kthreads? > > > Ad a) I am not sure if we could prevent duplicated lines when > the nested IRQ/NMI writes the same message that is just > being written by the outer context. But it should be > an acceptable corner case. > > Ad b) Everything will get much more complicated with per-console > kthreads. We will need counters and buffers for each console > and each context. Oh, yes, you are talking about per-console counters/buffers too. > This is what I was able to come up before leaving for vacation. I am > not sure if it is the best design/naming and it if it has a chance > to work. > > But it looks like a way how to re-use the same code in all modes. > It might help to see what is the same and what is special about each > mode. > > > I would prefer to see something like this instead of the completely > different code paths for atomic consoles that are proposed by 7th > patch of this patchset. I agree.