Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2834993imc; Wed, 13 Mar 2019 02:29:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyt2JWVQ30LPmsT06BaRPGt2xCdXoTIqY8lJhZevWBUq8P+cBIPe2UNbB/v5FhIhZmK+SRA X-Received: by 2002:a17:902:ab8f:: with SMTP id f15mr44569631plr.218.1552469399192; Wed, 13 Mar 2019 02:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552469399; cv=none; d=google.com; s=arc-20160816; b=iaj0TJ5/RFei1tcnULIkBuJBSQSnF8seem/m9NRCKD06jnoVgXev93tpdmK04+kjKL NtoOttGL+5ZaGrIz43MvvIbWhj8G8s3IHC6XGc2welkpZOyB5m1aYpprW1pGbNLadXIk I7F1SB9DMYVa/tkbeiZaiAvI/w5j/Se9o3og2ymuvubwkDwjN1QPvX/4JJIBCQODMPF9 sbIhdc+bufzhFr6bF8J230kdFY/0UjJgjkQlOS33u1PFXqDEwkNm2ZYwLso1bOqZqDi/ wuxkrNolp1r1+Zb/xM4mHyXvR5TJEwCwKNImZ6kgwNW9n7yqxMSVgb18YtsQV1or+Da6 kE+g== 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=V2SU/HcyKOo1yTWZv2CFgrz5XJlYH5b//sg9V29TkLI=; b=QLyUbrkkOxmXg5oGR95SeHxMkl3E8gYkKJXWFIWJ0rcgB8/JiZuZqIOk4sxvOrq5br 8hySKjxaqjnAbfDX43cmO6FNIC7jSPTAUiX5r2+1GFOmXMRvfhP2DHLrbDPkqQVQqxFq pTZYY6iYiL9xU71FnYMNWQLyLbrDbyfgBLxfVn5w4/BG6XzPmuf08WxMItatp1i4Q0I+ +HrRGYoFH+3w7Z1XjoLWtrZrT9/1e78qJVjBc9oDDSNim4wVhCLdEaL1I7so3yxAtXkC GW790TA152V3xcdzVhYql/2sXGSA/AghEAi7egCTj1mQQMhlIOmKQN/t6fPhglBCDtD8 HEXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FEQCLdDC; 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 k19si9410927pfk.281.2019.03.13.02.29.42; Wed, 13 Mar 2019 02:29:59 -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=FEQCLdDC; 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 S1727178AbfCMJ2F (ORCPT + 99 others); Wed, 13 Mar 2019 05:28:05 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43551 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfCMJ2E (ORCPT ); Wed, 13 Mar 2019 05:28:04 -0400 Received: by mail-pf1-f195.google.com with SMTP id q17so946745pfh.10; Wed, 13 Mar 2019 02:28: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:user-agent; bh=V2SU/HcyKOo1yTWZv2CFgrz5XJlYH5b//sg9V29TkLI=; b=FEQCLdDCIBXTalZGa5dDpBDTBaBTiSP9EVwRPgWowFnoqZgpeL2Nxr/Uws8KMmEwdK Nms+sE8Jpy28nspwdPPAhLOKGDJ7joTgWVWS2ZKJ5bqoWr4GUr/jUH6YebcphfGOjqpW 9HrH9fOP26C0COpV7nNxVC+7YUIFnKlh5tjvA+bfRkMH+s7ETN8viUczJtqaiBT7sLAj oZtXSsTyEODcMmOs6gOlVBEY1ATxWV4zZn5PHUjAFsmtFG7HNbyWMP1T1svl60qB80Pa NNKrNWub0jcU3NFZD+RAA8x72LyPYaA8+hTZtpAT4sbt1HQk62RT8lnPWszd5gjWWNPn ZIHw== 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=V2SU/HcyKOo1yTWZv2CFgrz5XJlYH5b//sg9V29TkLI=; b=p7BfHhtDzJB3zmNAxNFj35xctew1UZ287hnZgCgqRdsrNDvB/6uzT3mQV6J/wKrnRz x91dhuLr//qhxz/SLQh8Oo4PIiNj3dvtLAn5Marc7y8sDMT7l8i+wz/Own3BA8jB12hX y+tX30ZIXjcDLxMpWkdHp2Ns2tkeVlwEZfuxtNdwdy9EHI9Lks/1rzPCw3I6xAX66Rcs 0qIhnRT1x2hReTW0xlXtSrhOWNx9ASxRXr6kXTZ7DZjLR7o2TNs5hk6KqG3KgXPy9nzj XCZr8juWlWD0wHe9wcm1dfD4hif82xkqPzhaGLlQf2Pd3puOD2A81CGRmr3zgm8QMv2b sOqA== X-Gm-Message-State: APjAAAWquasBLFzzyk+y2dxcRC/azBmDEwcSJAIjMXzXv4ssSz1OuyVa RaIaWDdTv5AjBG8oSYDlWLo= X-Received: by 2002:a62:e80f:: with SMTP id c15mr43076554pfi.33.1552469283660; Wed, 13 Mar 2019 02:28:03 -0700 (PDT) Received: from localhost ([110.70.15.13]) by smtp.gmail.com with ESMTPSA id a4sm13471791pga.52.2019.03.13.02.28.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2019 02:28:02 -0700 (PDT) Date: Wed, 13 Mar 2019 18:27:59 +0900 From: Sergey Senozhatsky To: Sebastian Siewior Cc: John Ogness , 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 Subject: Re: [RFC PATCH v1 00/25] printk: new implementation Message-ID: <20190313092759.GA10060@jagdpanzerIV> References: <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> <20190313084028.f2m4qhxd5sjzzawr@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313084028.f2m4qhxd5sjzzawr@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:40), Sebastian Siewior wrote: > On 2019-03-13 09:19:32 [+0100], John Ogness wrote: > > 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. > > Does this mean we keep irq_work part or we bury it and solve it by other > means? That's a very good question. Because if we add console_trylock() to printk(), then we can't invoke ->atomic() consoles when console_sem is already locked, because one of the registered drivers is currently being modified by a 3rd party and printk(), thus, must stay away. Once that modification will be done console_unlock() will print all pending messages. This is current design. And this conflicts with the whole idea of ->atomic() consoles. So may be we need a whole new scheme in this department as well. For instance [*and this is completely untested idea* !!!] *May be* we can take a closer look and find cases when ->atomic consoles don't really depend on console_sem. And *may be* we can split the console drivers list and somehow forbid removal and modification (ioctl) of ->atomic consoles under us. Assuming that this is doable we then can start iterating ->atomic consoles list with unlocked console_sem. Non->atomic consoles or consoles which depend on console_sem (VT, fbcon and so on) will stay in another list, and we will take console_sem before we iterate that list and invoke those drivers. One more time - a completely random thought. -ss