From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lS9KP-00BjJi-QT for kexec@lists.infradead.org; Fri, 02 Apr 2021 02:14:32 +0000 Received: by mail-pg1-x533.google.com with SMTP id k8so2746046pgf.4 for ; Thu, 01 Apr 2021 19:14:28 -0700 (PDT) Date: Fri, 2 Apr 2021 11:14:18 +0900 From: Sergey Senozhatsky Subject: Re: [PATCH printk v2 2/5] printk: remove safe buffers Message-ID: References: <20210330153512.1182-1-john.ogness@linutronix.de> <20210330153512.1182-3-john.ogness@linutronix.de> <87a6qiqgzr.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Petr Mladek Cc: John Ogness , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Eric Biederman , Christophe Leroy , Nicholas Piggin , Alistair Popple , Jordan Niethe , Peter Zijlstra , "Aneesh Kumar K.V" , Andrew Morton , Kees Cook , Tiezhu Yang , Alexey Kardashevskiy , Yue Hu , Rafael Aquini , "Guilherme G. Piccoli" , "Paul E. McKenney" , linuxppc-dev@lists.ozlabs.org, kexec@lists.infradead.org On (21/04/01 16:17), Petr Mladek wrote: > > For the long term, we should introduce a printk-context API that allows > > callers to perfectly pack their multi-line output into a single > > entry. We discussed [0][1] this back in August 2020. > > We need a "short" term solution. There are currently 3 solutions: > > 1. Keep nmi_safe() and all the hacks around. > > 2. Serialize nmi_cpu_backtrace() by a spin lock and later by > the special lock used also by atomic consoles. > > 3. Tell complaining people how to sort the messed logs. Are we talking about nmi_cpu_backtrace()->dump_stack() or some other path? dump_stack() seems to be already serialized by `dump_lock`. Hmm, show_regs() is not serialized, seems like it should be under the same `dump_lock` as dump_stack(). _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec 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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 71B5BC433ED for ; Fri, 2 Apr 2021 02:14:59 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E39F8610A5 for ; Fri, 2 Apr 2021 02:14:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E39F8610A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FBNt94QsMz3c4v for ; Fri, 2 Apr 2021 13:14:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CiQCdaLN; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::52f; helo=mail-pg1-x52f.google.com; envelope-from=senozhatsky@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CiQCdaLN; dkim-atps=neutral Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FBNsg64Dkz3015 for ; Fri, 2 Apr 2021 13:14:29 +1100 (AEDT) Received: by mail-pg1-x52f.google.com with SMTP id p12so430718pgj.10 for ; Thu, 01 Apr 2021 19:14:29 -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=JB5UehlmQzvZFx81WrZqpYM4CZPIjgwCICp/Q33dgPY=; b=CiQCdaLNqItRdaQBOeJkErTv3n7PjSNnp+YvdQJ1ecNwMtUhwCi8shAehVOT7sxQpo nP61ASpB1NgGt9ANL4exn/Z9n7DKxzMjicech11ff/+fm4VxApqGY66Vw5/l8MC+kRoI zt+/uQlTX7cj6PZaFPDSywCRWFA6eFe3lXxPQ= 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=JB5UehlmQzvZFx81WrZqpYM4CZPIjgwCICp/Q33dgPY=; b=qkzrVfgo7tFszPAxDP4Bh7AVtOQw3nLb1X+GDIR7w/IQLkN+yv5drIVoBqBSX4wcKL N7Yf3iJStluwqJRKf8nCosdIRpHAeSmkxdO5vvneBVZqRPYUqpM2p9lQy5F0+HFAkhlh 5QGeQbeg1mMbwKomxKTuskL7341Ug08/noZ3EUndJ0QMzKaPBK6CgqeptUO59AMN+0+j 639VsUeaavtRWboWBVNBrn97Z4aPpZBbjgR2EPJJKZLMvz0DBr9pzQvTF1HV5DygBieL 5uJ/Z8aqArDcGtnCUOTQMY+TH6lug4bVNcnaSGmddZe76yZZ63FvE5kMZIu5+FEN4jNu 24uw== X-Gm-Message-State: AOAM532KhlwCX6Igz3Hqy+YyrkOZYe17yHL2evnrBXN7FYOsrhcV6KnY BYxE8jDoECyDqLk4QyJ/di5grQ== X-Google-Smtp-Source: ABdhPJy0ejIbP6LV2LsRoOa1rVdM/WfylFauJ7ONnIZVqPdmEwYb/IrcKuqgQDFSQ2rNzG87UypcyQ== X-Received: by 2002:a65:6a0e:: with SMTP id m14mr10107450pgu.448.1617329667742; Thu, 01 Apr 2021 19:14:27 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:918a:96e1:2fd5:8e77]) by smtp.gmail.com with ESMTPSA id e65sm6959948pfe.9.2021.04.01.19.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 19:14:27 -0700 (PDT) Date: Fri, 2 Apr 2021 11:14:18 +0900 From: Sergey Senozhatsky To: Petr Mladek Subject: Re: [PATCH printk v2 2/5] printk: remove safe buffers Message-ID: References: <20210330153512.1182-1-john.ogness@linutronix.de> <20210330153512.1182-3-john.ogness@linutronix.de> <87a6qiqgzr.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergey Senozhatsky , Peter Zijlstra , Paul Mackerras , Tiezhu Yang , Rafael Aquini , "Paul E. McKenney" , "Aneesh Kumar K.V" , Alexey Kardashevskiy , Yue Hu , Jordan Niethe , Kees Cook , John Ogness , Alistair Popple , "Guilherme G. Piccoli" , Nicholas Piggin , Steven Rostedt , Thomas Gleixner , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky , Eric Biederman , Andrew Morton , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On (21/04/01 16:17), Petr Mladek wrote: > > For the long term, we should introduce a printk-context API that allows > > callers to perfectly pack their multi-line output into a single > > entry. We discussed [0][1] this back in August 2020. > > We need a "short" term solution. There are currently 3 solutions: > > 1. Keep nmi_safe() and all the hacks around. > > 2. Serialize nmi_cpu_backtrace() by a spin lock and later by > the special lock used also by atomic consoles. > > 3. Tell complaining people how to sort the messed logs. Are we talking about nmi_cpu_backtrace()->dump_stack() or some other path? dump_stack() seems to be already serialized by `dump_lock`. Hmm, show_regs() is not serialized, seems like it should be under the same `dump_lock` as dump_stack(). 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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 7BABFC433B4 for ; Fri, 2 Apr 2021 02:14:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C19A610A5 for ; Fri, 2 Apr 2021 02:14:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233994AbhDBCOb (ORCPT ); Thu, 1 Apr 2021 22:14:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231836AbhDBCO3 (ORCPT ); Thu, 1 Apr 2021 22:14:29 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B590C0613E6 for ; Thu, 1 Apr 2021 19:14:28 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id i6so2762842pgs.1 for ; Thu, 01 Apr 2021 19:14:28 -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=JB5UehlmQzvZFx81WrZqpYM4CZPIjgwCICp/Q33dgPY=; b=CiQCdaLNqItRdaQBOeJkErTv3n7PjSNnp+YvdQJ1ecNwMtUhwCi8shAehVOT7sxQpo nP61ASpB1NgGt9ANL4exn/Z9n7DKxzMjicech11ff/+fm4VxApqGY66Vw5/l8MC+kRoI zt+/uQlTX7cj6PZaFPDSywCRWFA6eFe3lXxPQ= 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=JB5UehlmQzvZFx81WrZqpYM4CZPIjgwCICp/Q33dgPY=; b=bA90f9+++RFCV09LLOkl68oBR3wBzmogP5Sise+YYYkOpQgwBw8ZZRg9EFgAgplRJC 0Jr6HzwhpNMkwtx54iO2c2P3IJpqD0cwslciZ6Lb1OnMcAIZr7kzx6stA4o1QOubh7rR fHNU4jizBu7h8BfVOry/EsODXzmJ3WLskkEthSpOkWpf8jTzHYo2HGgEy3+JFLMqkCZJ oHJMuB6l/4sXRG/jS4aH5MfZTlYdQhKb9/YBJX5K91cFxuOl349Zs5bhSMxexL1YVK0g Lf8kqojhZ4zizIys5BI5UROJSCJLpUYGempqJaVKcHUaEi3+gQaC/BLgd0yhJozls/eS FzRQ== X-Gm-Message-State: AOAM533UPnM3kywzut2U/V5bsCy6D0ORuPGAhjJLyy0antAdKxQ2Yy7W gkGiSorFTot6Eh/vuDybFKplWQ== X-Google-Smtp-Source: ABdhPJy0ejIbP6LV2LsRoOa1rVdM/WfylFauJ7ONnIZVqPdmEwYb/IrcKuqgQDFSQ2rNzG87UypcyQ== X-Received: by 2002:a65:6a0e:: with SMTP id m14mr10107450pgu.448.1617329667742; Thu, 01 Apr 2021 19:14:27 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:918a:96e1:2fd5:8e77]) by smtp.gmail.com with ESMTPSA id e65sm6959948pfe.9.2021.04.01.19.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 19:14:27 -0700 (PDT) Date: Fri, 2 Apr 2021 11:14:18 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: John Ogness , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Eric Biederman , Christophe Leroy , Nicholas Piggin , Alistair Popple , Jordan Niethe , Peter Zijlstra , "Aneesh Kumar K.V" , Andrew Morton , Kees Cook , Tiezhu Yang , Alexey Kardashevskiy , Yue Hu , Rafael Aquini , "Guilherme G. Piccoli" , "Paul E. McKenney" , linuxppc-dev@lists.ozlabs.org, kexec@lists.infradead.org Subject: Re: [PATCH printk v2 2/5] printk: remove safe buffers Message-ID: References: <20210330153512.1182-1-john.ogness@linutronix.de> <20210330153512.1182-3-john.ogness@linutronix.de> <87a6qiqgzr.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/04/01 16:17), Petr Mladek wrote: > > For the long term, we should introduce a printk-context API that allows > > callers to perfectly pack their multi-line output into a single > > entry. We discussed [0][1] this back in August 2020. > > We need a "short" term solution. There are currently 3 solutions: > > 1. Keep nmi_safe() and all the hacks around. > > 2. Serialize nmi_cpu_backtrace() by a spin lock and later by > the special lock used also by atomic consoles. > > 3. Tell complaining people how to sort the messed logs. Are we talking about nmi_cpu_backtrace()->dump_stack() or some other path? dump_stack() seems to be already serialized by `dump_lock`. Hmm, show_regs() is not serialized, seems like it should be under the same `dump_lock` as dump_stack().