Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp735713pxk; Thu, 24 Sep 2020 17:55:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBL8G838+LymurlGouTLWMD1SQ0xy9TRPOc5FXwdsthM6eUnUvcM492+TgEY56VziY78Bm X-Received: by 2002:aa7:c394:: with SMTP id k20mr1364282edq.279.1600995352200; Thu, 24 Sep 2020 17:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600995352; cv=none; d=google.com; s=arc-20160816; b=Ur3VA9Fc7tjY/srvDoAjEfHrWcru9wQpOj5x8bEdq4AdZasczT+3SCBzVWkDchOCkB Wtz8b0k0bvI+dAs5I3fMXxNCkaVT94aKZvIuK4m3QRBnQkzy6jE9lK19hxBlcaWywxod dpRJ2PFhYuXxVZBroAsRHImOp9jqgQ2zMH9otJ5K5TKYlbDsQcpUFupXDAAMmW4SK64Q UaIdzo7TANtH97vNb8R/jSf/I0o8DP7Klzl27/TAAKSBcfBAdy0VtNbskfuYQgKpeYw0 KhtzZfb/H1hvu3857Ve8nKBCbRDFeQavrPTTOEUGNmN4Wycc2U4r3BL1YTRx5amxtRTX vksg== 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=pci8wc6C3sL56nLHCcZggaiDkvGB6P5cNXj+K5byzNE=; b=XkgfKubzfhcTz+TAT7vy4LOPa94p58PwCVw6exLbrzTXk7+Khc7Q8qqv3WnvKd/G5R IqeAtszwpm4JjuT/MTXckv3UMuY9Gnkmr3FN6vJ5f9zOD5clIPzzNptAC1/uXTO2Nlvp 3WDQ3HBHXfzwNEmvcVLXFKHBR+FTp+sV+2n5BLzYUWpmQoPasJfoh7vqrzaAKPWWwFKf XrKu+dSJR2+X238yX3DXwyKn+kT8u0YN6XgWi2Gh59qz3L5PT5GGGQq9hfW8go9KGS/J FxQgEca/0j4K6iMg47EQYjFRGMFsj+8MCDCs20BHXYCZdPMAA6sWvjBWSc4YDZORybf9 CSDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZkGUt2PZ; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 39si704808edr.435.2020.09.24.17.55.29; Thu, 24 Sep 2020 17:55:52 -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=@gmail.com header.s=20161025 header.b=ZkGUt2PZ; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbgIYAyE (ORCPT + 99 others); Thu, 24 Sep 2020 20:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbgIYAyE (ORCPT ); Thu, 24 Sep 2020 20:54:04 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 509ADC0613CE for ; Thu, 24 Sep 2020 17:54:04 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id bw23so951716pjb.2 for ; Thu, 24 Sep 2020 17:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pci8wc6C3sL56nLHCcZggaiDkvGB6P5cNXj+K5byzNE=; b=ZkGUt2PZtlRrXjXYuZhhn2xi5M3Ro/NfLR0zFG7qndd/iC5ST5IwbkDvA7aHSTFehS FdslJhI8zB3VkjGiDRzvixS2KukLQhBVbUJUHyoS1SdsKAS041G5x4r4iOViiVjqsiPl h0FvW4JsHNPxv5Z+GfPiaXseX636qzYPkwJAVU1mTimHXSNWeZ3CgJWuSxx6qBP3dSyh GVWE7ZVPbEIys1JDKQaVPHQslMJKfExg+RY8JGqRpxF96QVfDU9JYKuCYHTejflwXqqt pHAk6C3B724hnqbueS98e5GUiwnO1SN5qmEdCFKGuK+NVhdDbbpoeKkn1hJ+VA31zJk/ TxFw== 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=pci8wc6C3sL56nLHCcZggaiDkvGB6P5cNXj+K5byzNE=; b=FrbNpjlvk5N7cbfvDSXgJPZQN05SAdBfy4P5rNSCEQdbqf/pJ5hAw9xWHRjo/L7yLJ iVSJZxlXItDBlg3uV53NoCXG5MGq6fhVHDLGm6L5mBQ0eBP2qztiiIj1PPQak6bnCHVF 2pJssXdlsIU5NIAPa5FOiO8MrN7mii6kNxQ4oz1aseIEbYsznjBYmtR/h/qCnrVmnXEo uT5OrVgJK+zECZj440hMtbgEYWK8nIL917eoZmnapP0NdgSmP6ggTguQzocGmDYvlCve X/3JhLNF3Z2ZWPlo8BR4hu6tkYLPxt/69kQxYNuGnfGB06gvrzO3y7Zic6/4VX9UBE7m NlRw== X-Gm-Message-State: AOAM532+Co/KfeV6+vE8LVsRSe1y6kB4Y/GdVxY/MlZElidlXivynT03 yxkLfoh9BGIcqSuHHLYhMFU= X-Received: by 2002:a17:90a:b64:: with SMTP id 91mr268059pjq.93.1600995243767; Thu, 24 Sep 2020 17:54:03 -0700 (PDT) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id i15sm605270pfk.145.2020.09.24.17.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 17:54:02 -0700 (PDT) Date: Fri, 25 Sep 2020 09:54:00 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: "Ahmed S. Darwish" , Sergey Senozhatsky , Steven Rostedt , John Ogness , 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 Message-ID: <20200925005400.GD541@jagdpanzerIV.localdomain> References: <20200923135617.27149-1-pmladek@suse.com> <20200923135617.27149-3-pmladek@suse.com> <20200924042414.GA6039@lx-t490> <20200924125259.GC29288@alley> <20200924133850.GF29288@alley> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924133850.GF29288@alley> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/09/24 15:38), Petr Mladek wrote: [..] > > Grrrr, I wonder why I thought that in_irq() covered also the situation > when IRQ was disabled. It was likely my wish because disabled > interrupts are problem for printk() because the console might > cause a softlockup. preempt_disable() can also trigger softlockup. > in_irq() actually behaves like in_serving_softirq(). > > I am confused and puzzled now. I wonder what contexts are actually > interesting for developers. It goes back to the ideas from Sergey > about preemption disabled, ... Are we talking about context tracking for LOG_CONT or context on the serial console and /dev/kmsg? If the latter, then my 5 cents, is that something like preemptible(), which checks (preempt_count() == 0 && !irqs_disabled()) does not look completely unreasonable. We had a rather OK context tracking in printk() before, but for a completely different purpose: console_may_schedule = !oops_in_progress && preemptible() && !rcu_preempt_depth(); We know that printk() can cause RCU stalls [0]. Tracking this part of the context state is sort of meaningful. Let's look at this from this POV - why do we add in_irq()/etc tracking info? Perhaps because we want to connect the dots between printk() caller state and watchdog reports. Do we cover all watchdogs? No, I don't think so. RCU stalls, local_irq_disable(), preempt_disable() are not covered. Do we have any technical reasons not to add those missing bits? [0] https://lkml.org/lkml/2018/1/9/485 -ss