Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2797546imc; Wed, 13 Mar 2019 01:20:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqx72vgmKtK6PlBxng4CAyHvK1UBxWpHiBqxZAwdJWDoz8x/0Bfduy3IPxOI2YIBght8HWPM X-Received: by 2002:a62:503:: with SMTP id 3mr42083442pff.176.1552465223008; Wed, 13 Mar 2019 01:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552465222; cv=none; d=google.com; s=arc-20160816; b=aTNnGJKCuC05FeP+boOGN6N9TA4ue/dzi/em1zjPy+Kf9Fy2ZV/wQzeli+ubUCpT10 bI+TS6gpps2icSuR49ZL4nIdHuQogEHccKQOdl5tXMX9bxq9jxWfZX1KhDoEySiKWHis LoeAA55FzwEfFGDlH0KyQfMNiAmRFjj9bZ86taIt0TsUYB35dGOvSFQyKKjVYMSWzS+m DtATYxaIyJSLeqw97mZ4mu2DfmPnPgKCl4dumKU3zfN2henpFkNDmxuPPlW5jif45eXy XTNsCNUGBrVWezQl94NR74LvJjblZiKIoN5cSFifuLI421t4jADd+ZbuhXJ9WkE0Qh0r YBjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=Tbk8O/rvMSXV/FVOm6ljVIuTqaUGgFMMW6P6rBs2iEg=; b=owuSxa5AP6Dh5URrjrT9obURtdcBkne2iP9LiPv53rJur2pW5VygC7bYlKM3eBR92/ awiNB+wKFup5FQoo7gMxjlBnnBTCsAsHXgldBojhWD8kDAZCpLMVWfr9+EiBPIUeE97p YPcrpsDdfrO3uG6IY2jpy+RugRQorKT0kuXz0xwiKhSyIucmximRwo786Vr3p/DxvdiL 7sJbrjvH2D7bNoPT+aCFwlKKmbuPZRSm0ti/1Bcp13ocBDzF5yCdyOkxoO8DgJ/TQU5G jwnapJJ+BnrNc6x+TqMgr1A1ssZDirMruE9Cnd9Nw84yp+iOanL7HL1xcRjQzzHEafIv BqNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si10691897plb.216.2019.03.13.01.20.06; Wed, 13 Mar 2019 01:20:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726694AbfCMITr (ORCPT + 99 others); Wed, 13 Mar 2019 04:19:47 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:46436 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbfCMITq (ORCPT ); Wed, 13 Mar 2019 04:19:46 -0400 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1h3z6s-0000un-UF; Wed, 13 Mar 2019 09:19:35 +0100 From: John Ogness To: Sergey Senozhatsky Cc: Petr Mladek , linux-kernel@vger.kernel.org, Peter Zijlstra , Steven Rostedt , Daniel Wang , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , Alan Cox , Jiri Slaby , Peter Feiner , linux-serial@vger.kernel.org, Sergey Senozhatsky , Sebastian Siewior Subject: Re: [RFC PATCH v1 00/25] printk: new implementation References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190213025520.GA5803@jagdpanzerIV> <874l9721hf.fsf@linutronix.de> <20190304052335.GA6648@jagdpanzerIV> <87lg1rggcz.fsf@linutronix.de> <20190311105411.GA368@jagdpanzerIV> <20190312123857.juatd6fwtfmqajze@pathway.suse.cz> <874l8815uc.fsf@linutronix.de> <20190313021534.GB783@jagdpanzerIV> Date: Wed, 13 Mar 2019 09:19:32 +0100 In-Reply-To: <20190313021534.GB783@jagdpanzerIV> (Sergey Senozhatsky's message of "Wed, 13 Mar 2019 11:15:34 +0900") Message-ID: <87d0mv9off.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-03-13, Sergey Senozhatsky wrote: >>> I suggest the following way forward (separate patchsets): >>> >>> 1. Replace log buffer (least controversial thing) >> >> Yes. I will post a series that only implements the ringbuffer using >> your simplified API. That will be enough to remove printk_safe and >> actually does most of the work of updating devkmsg, kmsg_dump, and >> syslog. > > This may _not_ be enough to remove printk_safe. One of the reasons > printk_safe "condom" came into existence was console_sem (which > is a bit too important to ignore it): > > printk() > console_trylock() > console_unlock() > up() > raw_spin_lock_irqsave(&sem->lock, flags) > __up() > wake_up_process() > WARN/etc > printk() > console_trylock() > down_trylock() > raw_spin_lock_irqsave(&sem->lock, flags) << deadlock > > Back then we were looking at > > printk->console_sem->lock->printk->console_sem->lock > > deadlock report from LG, if I'm not mistaken. The main drawback of printk_safe is the safe buffers, which, aside from bogus timestamping, may never make it back to the printk log buffer. With the new ring buffer the safe buffers are not needed, even in the recursive situation. As you are pointing out, the notification/wake component of printk_safe will still be needed. I will leave that (small) part in printk_safe.c. John Ogness