Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp136808pxk; Thu, 24 Sep 2020 01:25:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx03Sc0fbpdbF7z8QSJeiRI5gTziaNUDr5773ED/iRv8ASqoO9pjsBdsKAB0wAdls1lh0nq X-Received: by 2002:a17:906:fa01:: with SMTP id lo1mr3571002ejb.394.1600935916625; Thu, 24 Sep 2020 01:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600935916; cv=none; d=google.com; s=arc-20160816; b=hGOrXCalmcckBprIIGQJb91zRtlANPBopR+HbwKkRwGvVqTkvGGVzMlRVlL+hCdCkc Yy77YWYQDi97byHlaQOxpvc7Ttbe5v75SX+Tx4tYyXobWCAYp2UU+bQYBS4vHVpcOXqJ sjgJcwzckQyRRgfN7IPNMW3vIJRwUGPbPW8DUvH3F4Hn/GcKy1cyAnQxq2DTQEz0KBNr 0QoZ02GAw+fKHoaAruiBTmGISmMxuWyOigZoV5qG10r+gwqG3nZ+NBJe/UEUWmjD5Q5X vHm+BlrVnMs0nus7bQmo/5PDD7WRAvESOdF47JJOycw4LGfF6whhwKuc3wIAPgseoTI3 LH8Q== 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=JZTmrEhF94tTpAzcznU17tH7F+Pkuoo4kJb8xylKuEc=; b=002aicxN/DcR89MSo8pP9MyVd26x3vnPsO05qy5xs3aL2Z4rJ3azmBuSu4zpwXzNaE 6jQoYNjQp+SOAy578Z6Opb35oWShwHy3zXATzqDqXqPcnvlva1STGgzkLo5AyJ8ong2F P1S/M2uRA5U243LB3+50UsYeJs/4M/sGLE1Z0MVoEb3j2QDRb6WhdhBs3OSOn0p8kjER JcVOCAXybP3T/I3sDFZthCp0caCPB5YIO/EIADnoojXwuegMijXEy5SM7xD2BIEZKeOj fd7LK2EoxC/Egb8McE4yIzqXlnTlzFyfIF2CsfmmSdTFlCJux4XMzKooMDiQIJZfDneq MZLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TO3zo7xH; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi9si973995edb.4.2020.09.24.01.24.53; Thu, 24 Sep 2020 01:25:16 -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=@linutronix.de header.s=2020 header.b=TO3zo7xH; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727262AbgIXIXe (ORCPT + 99 others); Thu, 24 Sep 2020 04:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727237AbgIXIXe (ORCPT ); Thu, 24 Sep 2020 04:23:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 314E4C0613CE for ; Thu, 24 Sep 2020 01:23:34 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1600935812; 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=JZTmrEhF94tTpAzcznU17tH7F+Pkuoo4kJb8xylKuEc=; b=TO3zo7xHA0YfgQf9adnSbJMvebNu9SUqTA0sTUpjWZa+4n7rPH5KHVeLJkHuKebbl+2DMl xHquRqwX3wMPPLntKVuv6crtHzqRO611zoQ3GjstmfX02hgge940LsiigIhRWwpsuYguQ5 fxT411Fh1blJurQpkL9QVc6nqqhIUMa7JpEXmX/w7O3AuUF3uLx3cGJUwKbEv3Qer3oYuA FFkiCpO2/KBnfK7GYROMyc1zxEyy+EBtiZXL5Rk9egDt2ylNUjvGJQeH71+Zg+HFoZ5yuq e/F234jKVoMGD0IVYdQ3Lu9VkRXwt0fzSYHl7ibHvUcyobqPdpqBxW/xEX8CWg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1600935812; 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=JZTmrEhF94tTpAzcznU17tH7F+Pkuoo4kJb8xylKuEc=; b=sbXhIKk+Iu+GuTcpd62ZQsv7YYXvIkjHSD0ldyaq1b/ajj7ThyRA7K5QBhirECrMkPD1CR ca36UeZOsESqVbBw== To: Sergey Senozhatsky , Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Thomas Gleixner , Prarit Bhargava , Mark Salyzyn , Chunyan Zhang , Orson Zhai , Changki Kim , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [RFC 2/2] printk: Add more information about the printk caller In-Reply-To: <20200924021756.GD577@jagdpanzerIV.localdomain> References: <20200923135617.27149-1-pmladek@suse.com> <20200923135617.27149-3-pmladek@suse.com> <20200924021756.GD577@jagdpanzerIV.localdomain> Date: Thu, 24 Sep 2020 10:29:31 +0206 Message-ID: <87k0wj7fcs.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-09-24, Sergey Senozhatsky wrote: > A question. Suppose we have a task which does > > CPU0 > > pr_err(...); > > preempt_disable(); > pr_err(...); > preempt_enable(); > > pr_err(...); > > rcu_read_lock(); > pr_info(...); > rcu_read_unlock(); > > Should we distinguish those as 3 different contexts? > > - normal printk > - printk under disabled preemption (affects scheduling) > - printk under RCU read side lock (affects RCU grace periods) The internal purpose of the printk_info's @caller_id is to support _some_ sanity with LOG_CONT. True LOG_CONT sanity will not be available until we provide a context API like we previously talked about [0]. But for now it is good enough (even if it is not good). We can also store various flags and counters to describe the current context. But these would only exist to provide the user with information rather than because printk itself needs it. I only mention this so that we don't get things mixed up. We can add as much information as want, but LOG_CONT will only be interested in a subset of that. John Ogness