Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3934934pxu; Wed, 9 Dec 2020 04:32:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1/SSZnPiz5M5i+q2XN8FHfO/Z8NdwtIhFEUxAZ0XfV5Tv5CzRmb2G24g5hJfFM8brikeB X-Received: by 2002:a17:906:d0c2:: with SMTP id bq2mr1853912ejb.1.1607517133788; Wed, 09 Dec 2020 04:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607517133; cv=none; d=google.com; s=arc-20160816; b=G2v48L6gwjF/m1S8O9pErpXy3edNqV5u/deIQPehsE81cjiJgIjp3jL95+ygvD5lA3 euyV2DDlutfzh1bYZt9wWuZ0Ma/nH5aPNcRFVMNR/Za4gPIyK9tkJfw7nOo+7zHYLwgL jZ/4QSzUHgIRYEhiOhQMbLOMpJJ4k0wSzegVW4sphLjM6PuP7qvXUaD/AEBIqP6eTuX6 FcTmTNplunbCgTDG3lu1pT3+h8nR6sAtR3jXJ+wyPuUT9Uk39pnFpmzOumiv/X/kHj9t Rd0Kz0B5tPnRi1nV9u/4IxpfbRgEaVANryfM+9igj7LvLURuPs4VKalqOUTjCVXg+RtN vNaA== 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=Eqlt7Tmq/D39H0K+rnF3GJET5vEqaAZ+L8hokUf1xSA=; b=b/3fy7xTCqVMDt3Bw7h8N8znwqwspW6l2M9dBCJGLXoJSHVvNmLWB1L1EuxSlgX0So QLhemKAfMNXOSwBPlBs2zbly5PSISJw68KzDmlecwN1gmZAeh2w5Y94iht2HJRmQLJpi NdqBi6gQZKliGOHUmHbEFc/IjFavvfCKT2M2wqeFSMtl5QCFv1QeV5PX7W2peAhVoBng ZgiJk3lGxVDvIe/Zb7G7wvsccLyZLM2CA8p+JIWl5/x/YrplXsmI2NN9tTZZ4Zyw6mOR ruMFrGJtj0s0cF6zznImTbX/3ZsHBLWQF/f2SOHcLvX8hyQzX6SiMJXT03gqMoKPAQer bsUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=r4q46ZjI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp19si632708ejb.465.2020.12.09.04.31.40; Wed, 09 Dec 2020 04:32:13 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=r4q46ZjI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731508AbgLIMaI (ORCPT + 99 others); Wed, 9 Dec 2020 07:30:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730948AbgLIMaI (ORCPT ); Wed, 9 Dec 2020 07:30:08 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 070ABC061793 for ; Wed, 9 Dec 2020 04:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Eqlt7Tmq/D39H0K+rnF3GJET5vEqaAZ+L8hokUf1xSA=; b=r4q46ZjI62xeZ9ZXUgnV5rs9sU K7TYeN1eNPWSIiLTr+uS5f0ilJEA9vPkbna6jsv7tMsFRGEkHbaphLkhHqv57Tapx839joRXq6u36 uzYdm49PL6H8LrrNjC6xTdp/4l5hQoyctKN7kh5vQw7RdUjmNAmGHbACbA1M1UukgCECFIeiEfzuh 8XhGli5JLopwR3jV9dp5kfuu4S90rkXo9XmKEfUYZhQBFtzlTIURkoe2T/QJpCZF1OFwYBAthOOFt Z2YsH9SKw4K0rhEKmo8p2ugNg/R1YnteMpxWszgV7DM/sBkb8IA8+OpZwERJCb/nCwDEntZsTvzxs nXtYB7KA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmyao-00048s-Aj; Wed, 09 Dec 2020 12:29:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7420F3011F0; Wed, 9 Dec 2020 13:29:09 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5C96C205B0CA3; Wed, 9 Dec 2020 13:29:09 +0100 (CET) Date: Wed, 9 Dec 2020 13:29:09 +0100 From: Peter Zijlstra To: Sergey Senozhatsky Cc: Sergey Senozhatsky , John Ogness , Petr Mladek , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH next v2 2/3] printk: change @clear_seq to atomic64_t Message-ID: <20201209122909.GL2414@hirez.programming.kicks-ass.net> References: <20201201205341.3871-1-john.ogness@linutronix.de> <20201201205341.3871-3-john.ogness@linutronix.de> <875z5c9bhn.fsf@jogness.linutronix.de> <20201209081623.GI2414@hirez.programming.kicks-ass.net> <20201209092204.GD1667627@google.com> <20201209110042.GW3021@hirez.programming.kicks-ass.net> 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 Wed, Dec 09, 2020 at 08:28:52PM +0900, Sergey Senozhatsky wrote: > On (20/12/09 12:00), Peter Zijlstra wrote: > > > So another potential re-entry path is > > > > > > atomic_foo() > > > spin_lock_irqsave(ATOMIC_HASH(v), flags) > > > printk() > > > prb() > > > atomic_foo() > > > spin_lock_irqsave(ATOMIC_HASH(v), flags) > > > > > > which can deadlock, in theory, if both atomics HASH to the same > > > key (same spin_lock). > > > > Yep, but see the 'mostly' in the 'they mostly work'. Given the > > limitiations of these architectures there's really only so much you can > > do. > > Right, agreed. > > Nevertheless TIL that lockless printk buffer is not always lockless. > Perhaps, people that work with those archs need to also know this. Last time I broke them, they were aware they're 'special' and IIRC they're mostly just limping along on prayers. > I haven't checked all the archs, but if, somehow, (IF) some of them > can panic the system with the atomic hash entries locked, then on > those archs new printk may not be able to flush-on-panic. Because > while printk iterates logbuf it may HASH to the atomic hash table > entry, that will never be unlocked. So there are some changes in > atomic/printk department on those archs. Yeah, so I wouldn't put too much effort into thinking about it. Hopefully we can eventually delete these architectures and really forget they exist.