Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp582852imm; Fri, 8 Jun 2018 01:40:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKEkFpdoQ631LhBM6jbvo6LHGC6ug28bMDxJJYoMfmVeEKzCrOPkono4PrpQVYfudJohx8Q X-Received: by 2002:a17:902:7089:: with SMTP id z9-v6mr5506653plk.231.1528447233474; Fri, 08 Jun 2018 01:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528447233; cv=none; d=google.com; s=arc-20160816; b=X0pp/bIzkPupScllOCDjvjvpd1GJlcFTnAHg7IoALAbZFRnyRLtxjrhOkTmmYZ1M8G fo6JTkebRhbb0WY2oBYp14wGL1eHRbb3zlJLe4fZ+Lt7gQNlQ6ssRwTz5EuDlE5/VuPI d3qcSD5xh+McnDprsUbyIhfZayCILTwq/RUkto0TuKE7VgbdlfBafkOVBR9X2csqqH+6 zhPP3Y0bPrGmqY647jjQppKunT0mXTanhLLX/PimUBqXdxSKZf9EK0DarVzxHkkH/Mea N9v+gTUespsDv9b8Br0f0VPdsAzccEzMqG+kuRrp01g3TfRqgzEvkFmOEk4LLDkZ10Cb Kt/Q== 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:arc-authentication-results; bh=CMKVmKQ3kIyOU7iqovmJyfVVzm2P0VHOOWnl4ubhxf8=; b=miPXUrAbl8X0uUWWrl9tdBrMiJW2fqmgBhVDFS2iRqsJmQzNSOJADhmlb3zVQ4Zwuj RnmxGykLLSElSPTz/oK/2G6vLfJCYp7Ti1jMtXrfzxKyIOCgxopy5BQK6aDRNghxzGNc LErdSzQyrgLsUx2aI8gVmcAU7ozaqWLLADJ8AhEsXtHEC4INefbm5BUAucmz16doOOfD hih03PJS5Ew/VDUACRdkgLVCdz8ypPav5AENFQcNlmcy4uW1KF6qUUTVkAxqMlSdu3wx brPvhuc1N/V8IV573quDrlSZiEQuSZ+MPEw9wl4PVj6vYSORzFnr4X8Y7YfYXDwi8HE4 pPEA== 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 w3-v6si27608092pgb.588.2018.06.08.01.40.19; Fri, 08 Jun 2018 01:40:33 -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 S1752897AbeFHIjK (ORCPT + 99 others); Fri, 8 Jun 2018 04:39:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:44550 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752326AbeFHIjI (ORCPT ); Fri, 8 Jun 2018 04:39:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 49018AC2E; Fri, 8 Jun 2018 08:39:07 +0000 (UTC) Date: Fri, 8 Jun 2018 10:39:06 +0200 From: Petr Mladek To: Maninder Singh Cc: 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 v2] printk: make sure to print log on console. Message-ID: <20180608083906.fwx3r3y2pxtv3ga6@pathway.suse.cz> References: <20180601090029epcas5p3cc93d4bfbebb3199f0a2684058da7e26~z-a_jkmrI2993329933epcas5p3q@epcas5p3.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180601090029epcas5p3cc93d4bfbebb3199f0a2684058da7e26~z-a_jkmrI2993329933epcas5p3q@epcas5p3.samsung.com> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 2018-06-01 14:26:42, Maninder Singh wrote: > This patch make sure printing of log on console if loglevel > at time of storing log is less than current console loglevel. > > @why > In SMP printk can work asynchronously, logs can be missed on console > because it checks current log level at time of console_unlock, > not at time of storing logs. > > func() > { > .... > .... > console_verbose(); // user wants to have all the logs on console. > pr_alert(); > dump_backtrace(); //prints with default loglevel. > ... > console_silent(); // stop all logs from printing on console. > } > > Now if console_lock was owned by another process, the messages might > be handled after the consoles were silenced. It might make sense to document the limitations reported by Sergey. I mean to add something like: "There are still some corner cases where this patch is not enough, for example, when the messages are flushed later from printk_safe buffers or when there are races between console_verbose() and console_silent() callers." > reused flag LOG_NOCONS as its usage is gone long back. > (5c2992ee7fd8a29d04125dc0aa3522784c5fa5eb) > > Signed-off-by: Vaneet Narang > Signed-off-by: Maninder Singh Anyway. the patch helps in many situations and it is a step in the right direction: Reviewed-by: Petr Mladek Best Regards, Petr PS: There is no need to resend the patch. I could update the commit message when pushing the patch. I am just going to wait a bit for other potential reviewers.