Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp370809imm; Fri, 1 Jun 2018 02:19:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKR8g7LcG/pc1i3Lnf550QmLt4+CrmzEDJI+5w02+EkAnTmc/p+HlVLdI7ca600MQUusNsO X-Received: by 2002:a65:5308:: with SMTP id m8-v6mr8471768pgq.42.1527844784420; Fri, 01 Jun 2018 02:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527844784; cv=none; d=google.com; s=arc-20160816; b=EgiVRjv59evJQZmNBHH5NhISv/QZbagVeGqVyzqm0jvNNTzxAb6NNs2E32oOOTknnA guMXXG/mSrKA9vZ3+RpCYvC/0yAINT2qNEQ0/gdoGIqkotQx/IBxmn80yV+nI5jat7uq uSkCM0L3CyAr8odlmBFMtPfrCctyl1JHfMKwYOhjGOtF7fRzDgVBsRMvy/As7sC2zSUv gcSS8QXFnpg/GYYh0Ln+5nkPzpFbZZ7X9dqJNhlQn9RweSdjQQkUhCjYC9nyCpgbjcZN pb2mrFCRIH8rhtccDk15u5LhUkfbxmpaTJDL4WOxmK1uPpF54GJIF1OGr3Le/P4gdq8J lR5A== 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:arc-authentication-results; bh=wi+vmred9T0dEOPMQ1uBSxl6YVfDNOPiC5YZQSegQcc=; b=XPt3JWqFMjihgsHZ0ryJMBhd6CDKgMZTBugrdInWSqCVgGrOLNwYQ4PisZ4dRXY9Zl YqwOyC8mR0FyZWb7ePYoFOI17EYK1R+TD/cGYxpUSQQptI1l15TLKXRZuPXeC/A63/sW OJK4fpK9n2GYWiFoap7rjT8LO0nB+H4+ujRFq9/y8+SPX27c3Qvf0hz0nEKWJqbRJsWU 1EdVyUEh//wAUdo1YOMAZqh1A6QKPV5trE9YLgICqs1oJmJbJSPiG0hTJwGH9BOWJE1h ucxMKQBCWQOsDOXjjx6iqHurNHUjPtGOTUmxVbPXm2E1oM/g4ER7E7i2Ex/+LRBYjkbH GXuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DCgn4ODl; 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 j24-v6si12067000pfi.90.2018.06.01.02.19.29; Fri, 01 Jun 2018 02:19:44 -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=DCgn4ODl; 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 S1751247AbeFAJSd (ORCPT + 99 others); Fri, 1 Jun 2018 05:18:33 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:43777 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbeFAJS2 (ORCPT ); Fri, 1 Jun 2018 05:18:28 -0400 Received: by mail-pl0-f66.google.com with SMTP id c41-v6so14971957plj.10 for ; Fri, 01 Jun 2018 02:18:28 -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=wi+vmred9T0dEOPMQ1uBSxl6YVfDNOPiC5YZQSegQcc=; b=DCgn4ODlIrIzbmKf/aSwDOST8yyuMqJ00a72ESUhtqwxU1nqA2/vCy5t8fqodJ4dxI x319F4E7X3f26spy1kEH+B7ffChV4dVGRJwoU+WJH4FxvZyJA9MJlBFWztIXGkBzR1RM OAGOh+Zy2cVwK0k7WDi7R1Rgx6mMsWmY8kbnA+cmD9S9pZPwacjj+9MAkmXDTTqZ85vc kYds/UnaNijodwEd7013M+UxUvsNk46ChthOSWYIVDa6amHyZUjjKdh5ecw7TSI1kMt1 RhpaflZF8e6FvWrrhXNQlp+jEpu8jCSG50rNMP2/vofAouk1qevR37QVn5s8gWUgKpbR wN2w== 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=wi+vmred9T0dEOPMQ1uBSxl6YVfDNOPiC5YZQSegQcc=; b=nvrRNt5T1Shvtmvq71ErYanC6PiVeDcw7XMB+/ytiy3R6UnG8of3Z5FPt77nMoCut0 +64vaeMs0g+0lyfcMyxOSI15trcDCH3hX5pVfW54WJp4YMjBFsBgLAzJV/XAD2KaK3mj 1n7NiNrrHo6lgh3X1XOsUkLfz95TB3saOFgB/twPSnPxDYFX8cSPb0zRhmEMZiW7FH7O nrWQQ9gNNFqyJov/YeP6g6Ve4EgR6mv8pX+SaewE+BrfuNPAkdjBjSXQc9knBBPRhxrP //ZU3l0t7Glvp7lxqrXAtEK4mTPcHhVd+H8QcFMh3DHg09tq2uioFuwXDPZKMCSEzkt4 4IMQ== X-Gm-Message-State: ALKqPwdVKo3kD37kltd/TlvJf0966txeC3n6HMXfVOZ/Lzs1H4LEcfes +G+abCia466GTPq1cmr4f7OS+QFc X-Received: by 2002:a17:902:c5:: with SMTP id a63-v6mr10386365pla.149.1527844708225; Fri, 01 Jun 2018 02:18:28 -0700 (PDT) Received: from localhost ([39.7.51.205]) by smtp.gmail.com with ESMTPSA id j1-v6sm86774895pfc.159.2018.06.01.02.18.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Jun 2018 02:18:27 -0700 (PDT) Date: Fri, 1 Jun 2018 18:18:23 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Maninder Singh , sergey.senozhatsky@gmail.com, rostedt@goodmis.org, linux-kernel@vger.kernel.org, a.sahrawat@samsung.com, pankaj.m@samsung.com, v.narang@samsung.com Subject: Re: [PATCH 2/2] printk: make sure to print log on console. Message-ID: <20180601091823.GA1841@jagdpanzerIV> References: <20180531102246epcas5p2f1cbc6ff217172e12e2f78bb88eb4a7e~zs5h59tMh2250222502epcas5p2S@epcas5p2.samsung.com> <20180531105215.GF477@jagdpanzerIV> <20180531122112.bfeqtmwpl2qc67a5@pathway.suse.cz> <20180601044050.GA5687@jagdpanzerIV> <20180601085356.kncuat7epkbtythv@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180601085356.kncuat7epkbtythv@pathway.suse.cz> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (06/01/18 10:53), Petr Mladek wrote: > [...] > > > So I'd say that most likely the following scenarios can suffer: > > > > - NMI comes in, sets loglevel to X, printk-s some data, restores the > > loglevel back to Y > > - IRQ comes in [like sysrq, etc] comes in and does the same thing > > - software exception comes in and does the same thing [e.g. bust_spinlocks() > > at arch/s390/mm/fault.c] > > > My view is: > > The race with another printk() (console_lock owner) is much more > likely than a race between two CPUs manipulating console_loglevel. The race with console_loglevel manipulation from another CPU was not the main point [it is unlikely, like I said in my "nitpick"]. The point was NMI / printk_safe section saved_console_loglevel = console_loglevel console_loglevel = A printk printk printk console_loglevel = saved_console_loglevel iret Is not handled. > The proposed patch seems to be in the right direction. It is supposed > to fix the most likely scenario. Could be. > I am personally fine with this partial solution for now. We could > always make it better if people meet the other scenarios. I don't have objections. But I'd prefer to see real uses cases and to know why partial solution is good enough in this case, even though we know that NMI / printk_safe() messages may be lost due to very same problem. -ss