Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2811496imc; Wed, 13 Mar 2019 01:46:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5Fi4pMDEhkcXHuR4fjspdn/oCLqOceMtDV/CRsGLWwkV5jQYTaWHOum0BowEkkgNfru29 X-Received: by 2002:a63:4f61:: with SMTP id p33mr39260786pgl.303.1552466801796; Wed, 13 Mar 2019 01:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552466801; cv=none; d=google.com; s=arc-20160816; b=m7PZj5c0mP+AwpIKyOxmmIbwr0INCNCAXpCef5mRBAj30i5ENvXZ/Y01pcRWWBIsY/ JGbWREbgt8qvzWvaLbhfIfX/JtpB8+t/RiRayqyWR2x+upopN9SIg3x8UR4YbBWn7Zuj k12tQ8/C5rbdn/vNk91zfHGBFNHvoJOMYvoWAg9TGARHjz3LCwDfws6pKEhYLJeKYhwm As5CPkilMyfkm3NEGqsgRrES2xbugOn9qSjWkKrOeJFsy3obU8pn0sFuehQSRv/lc0Ir vsKHIzea0s3Pkoa1ytORBfPqvsb7KNgbyCrb/PGu9eED7dqwQAXi3EyWTW9masf8k9i8 vuJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=F37euZXKmVBi9fZUuOI5uoJgp4MuxAaBS48or3lcYaE=; b=gKHm6fI6I8TuzFUMSEbDGSu8rypsveqlha4o78OWpJO7uG0RFdyWSPOTBnzMlCVsqL J8BRB+QnYnbO+iVSyRrgbJ9YE08qJh1E5HxqiKxuyRiwhLEPRRfpneeqDypfEnN9qeiO VN9gXQq22LjqZBCq/I93oiCLzNO+4CBKU1s1zn6YDurvRNHCz4XMHQy7tNEyvTyxnngJ WB05TgWkH7ToIMkBbEXu/EDTM+CyY5LcFWejm9RPoQ+t4LyaMyV7Sm83zZB6dkETcFnF pX+X7vkW4ckYatTfb1vHzHeq4Uqhc67vb5nZJJ9vAT33JG2HTbUq/AkQSGUWM4AL8Fjp R01w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mJXFiMgs; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si9609004pfn.108.2019.03.13.01.46.25; Wed, 13 Mar 2019 01:46:41 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mJXFiMgs; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726812AbfCMIqG (ORCPT + 99 others); Wed, 13 Mar 2019 04:46:06 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36886 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbfCMIqF (ORCPT ); Wed, 13 Mar 2019 04:46:05 -0400 Received: by mail-pf1-f196.google.com with SMTP id s22so889483pfh.4; Wed, 13 Mar 2019 01:46:05 -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:user-agent; bh=F37euZXKmVBi9fZUuOI5uoJgp4MuxAaBS48or3lcYaE=; b=mJXFiMgsxshukjkUfi8LtIdHvjGedheWm24Cn6wVgeQy1arTLMk83RWnI9xM2yIJIQ NlABeuhEFWPgynqWq53q1bh93OXa0JinNGquFRddEh7MQ5RrgAvLIq9Rd0cilz4gJROH ZetB37wFy/QudfwJKqeBYWADy+vNddT3vA/A+5zmPGONYV58Aad6Aia5G+d1JQ7CnblU bNlmdj3SCDZUZZRzRrjMUeWG5NXalhF3IvEed8bVjnpH2XEIiaXuI+darUIFO239ywat XhDdru99j9D0DkSv/bSna0G8aJIQWzHzppsNj6BF2HON15SQQobg8wTx7DI+SEf3XWQ8 aRyQ== 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:user-agent; bh=F37euZXKmVBi9fZUuOI5uoJgp4MuxAaBS48or3lcYaE=; b=hAxFCfUvfCT7JHDFwVwcL7W8H30RPwx3FApYPjBIguReBWPGexCmb+3P4+E/itSuhv 1EbrfjjcDzB78x6zTi/8UJchEonMeOkezkdbMm6NhRHXdgLHmxPDkyk6DNa5mS08qOLw MS5lSqk68zG+dueGMzogz3+HBB9yNc1iHFAKYg47lwGjH8pPLmcZM2rigLWb3m38kfY6 klSWH1nAgciE24+C+icap6ceU/BqK33Ydh/X08nbRkuQ2A44aCKhX5dPuVMQ8J0c8cPp VihCMIqaUwSSeiPUC9JuT1wUMhh+tzhrpRT14FR9fi5dqpWTrjI+U/+JfiZilXDcEsvj hq9A== X-Gm-Message-State: APjAAAUaa67vJ8HvtehCxxykNe2DHGVz4Ge5RM25L65W85GBvScG3e4Q jbX+vy736IZQFk15J5rxOFQ= X-Received: by 2002:a63:470a:: with SMTP id u10mr39816429pga.17.1552466764703; Wed, 13 Mar 2019 01:46:04 -0700 (PDT) Received: from localhost ([110.70.15.13]) by smtp.gmail.com with ESMTPSA id f87sm16631508pff.38.2019.03.13.01.46.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2019 01:46:03 -0700 (PDT) Date: Wed, 13 Mar 2019 17:46:00 +0900 From: Sergey Senozhatsky To: John Ogness Cc: Sergey Senozhatsky , 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 Message-ID: <20190313084600.GA1748@jagdpanzerIV> 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> <87d0mv9off.fsf@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d0mv9off.fsf@linutronix.de> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (03/13/19 09:19), John Ogness wrote: > >> 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. Yeah, all I'm saying is that as it stands new printk() is missing a huge and necessary part - console semaphore. And things can get very different once you add that missing part. It brings a lot of stuff back to printk. logbuf and logbuf_lock are not really huge printk problems. scheduler, timekeeping locks, etc. are much bigger ones. Those dependencies don't come from logbuf/logbuf_lock. -ss