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.2 required=3.0 tests=BAYES_00, BUG6152_INVALID_DATE_TZ_ABSURD,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD,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 1EC36C4361B for ; Sun, 6 Dec 2020 22:18:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB745230FD for ; Sun, 6 Dec 2020 22:18:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727664AbgLFWSE (ORCPT ); Sun, 6 Dec 2020 17:18:04 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:60700 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbgLFWSE (ORCPT ); Sun, 6 Dec 2020 17:18:04 -0500 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607293042; 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=ipzVzcw1Rul4OI8CigsTMIYDObqN/WIDxB2eMNXupzY=; b=jquKGHkkReUuBh2eyWdAH8ux80UA80hwI+Jp46uEWyD6hVgS4fajJszPTk73efLBGmQckS Fug8EQqQvpjMwxXxz8vb2aUj809aRnrHE4DXSgKmyolyYRhWUMNaeZvidu/GbHZOdzCQ7T HD1uG7jEVbhKHhsacmz9c5SVgl+LGjmQMpU9nyFQVbYCjRBBjNaL6v2XFctxdD5BivryIY G/P0YCTaRveZwZS6CBQJnyLdd9d3NDDpP6J0znwVI6/QM98jwY/0CqmBl58ZcTf9FuEmjm V3+6C4IQCEnW9/iXF37MmSZkjPsUmCKN86MDlBzrD9R6NIlMSbR7z3De49Xifw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607293042; 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=ipzVzcw1Rul4OI8CigsTMIYDObqN/WIDxB2eMNXupzY=; b=39nLphRxi3T77Kuvta+LvmCyYegIX5efaZXOCVM6BQ6o81dcQZAH2PcH0oK3u4hDEHOy/O 6fFTSb89vrKG0VBw== To: Sergey Senozhatsky , Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: recursion handling: Re: [PATCH next v2 3/3] printk: remove logbuf_lock, add syslog_lock In-Reply-To: References: <20201201205341.3871-1-john.ogness@linutronix.de> <20201201205341.3871-4-john.ogness@linutronix.de> Date: Sun, 06 Dec 2020 23:23:22 +0106 Message-ID: <87mtyqmvf1.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 2020-12-05, Sergey Senozhatsky wrote: >> One reason is the use of per-cpu variables. Alternative solution would >> be to store printk_context into task_struct. > > We can keep per-CPU, disable preemption and have counters for > every context (task, soft/hard irq, NMI). Shouldn't be a problem These contexts are difficult to track correctly for all the preemption models (especially when PREEMPT_RT is included). But I will look into this idea. It would be nice to keep interrupts enabled for that first vsnprintf() in vprintk_store(). John Ogness