From patchwork Fri Oct 18 09:42:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 11197975 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAAB714ED for ; Fri, 18 Oct 2019 09:43:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9E3F720820 for ; Fri, 18 Oct 2019 09:43:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Qnhdq/up" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E3F720820 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6A7BD8E0020; Fri, 18 Oct 2019 05:43:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 659998E0003; Fri, 18 Oct 2019 05:43:30 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 520698E0020; Fri, 18 Oct 2019 05:43:30 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id 2843D8E0003 for ; Fri, 18 Oct 2019 05:43:30 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id A76C28120 for ; Fri, 18 Oct 2019 09:43:29 +0000 (UTC) X-FDA: 76056417738.17.wind02_75c45313d401b X-Spam-Summary: 2,0,0,7ec8ef6317632192,d41d8cd98f00b204,3p4mpxqykcoosxupqdsaasxq.oayxuzgj-yywhmow.ads@flex--glider.bounces.google.com,:glider@google.com:vegard.nossum@oracle.com:pmladek@suse.com:sergey.senozhatsky@gmail.com:rostedt@goodmis.org:dvyukov@google.com:,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1313:1314:1345:1359:1437:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:3138:3139:3140:3141:3142:3152:3352:3865:3866:3867:3870:4321:5007:6120:6261:6653:7514:7901:9969:10004:10400:11026:11232:11473:11658:11914:12043:12296:12297:12438:12555:12895:12986:13069:13311:13357:13846:14096:14097:14181:14394:14659:14721:21063:21080:21365:21433:21444:21451:21627:30046:30054:30064:30070,0,RBL:209.85.128.74:@flex--glider.bounces.google.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: wind02_75c45313d401b X-Filterd-Recvd-Size: 3988 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Fri, 18 Oct 2019 09:43:29 +0000 (UTC) Received: by mail-wm1-f74.google.com with SMTP id z5so622786wma.5 for ; Fri, 18 Oct 2019 02:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=kQAVHdj1ULLW1duUtV+wvhyxEzmEv0/AhXDpZXorHfI=; b=Qnhdq/upJpo+5aEX/OtoVwQZjzU/k74/ZOcdnE3ynaXONWPwKqXTjKMRiLVuZhatDt WwaGBUMRmmJUX5yKGycTRXn/bgnkqOwr9x8q4SwsavE1hrv7j58n0CHgHJYyaSa8EAuZ aJN4ey7G4lBygDoNusFLc7d4aAzRKVqWZH89f3KEv0K1lPFzNbE/TSkatJTCp0kN6/2g gDfUtNXKeGQ9HWgCa/CXGI/SJIMj/HzJTKzS1R0vGfPNJOOcCDwXbvb/kI+RgRNldHNI gMelffsUsq84dsW7kfJiBVhX91twYe6xPGlpUgEobAAd+GCC8lMiArdJVgw3PaKKwhaR PX8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=kQAVHdj1ULLW1duUtV+wvhyxEzmEv0/AhXDpZXorHfI=; b=LjoPjGI6STbNgfQqp0mIr8OPWYIw6BoxITW1oinXeDLY5RMDdzkWjzI8zDbKkIJ00Q 8I7o79DFbGEa0FOEYV9mDAnOxL4UrHdivsWIFEP/PO7QtLzFS1XtXbRXmT+/PlMjQetS W1lfey0iIg5w9TEECPb6E3CpYWf/F+lumK1aLNY5uZEtWK0yeylhT1U7V901Z37uvuhJ M0FlDKlQV/jT/QfiMKHisVO1Yo169uAmVEDnyASonIJocHvcNXdmDJnqsH3uu1yenDM6 mWBuntBCNKoF86L1NiY9j037m40k2A7EQZECE+r4Lbz1VROf22Fk2HYgoC3na+9UulGL 70tA== X-Gm-Message-State: APjAAAXnMjvt+eW77H2z9T/95xtJJP6pTyTOp7aCzbMoIdUPXfwVCG9a 23Z8E361v/l5npDN+7CvQpV9j5LBuvk= X-Google-Smtp-Source: APXvYqxioAg7X687O5rvtifYe7NBFAcRDzwjNK+YtENx4yWZhG1Lg9NUafgZP37yAoPET60yd07IWNBX4u0= X-Received: by 2002:adf:f684:: with SMTP id v4mr1614190wrp.336.1571391807993; Fri, 18 Oct 2019 02:43:27 -0700 (PDT) Date: Fri, 18 Oct 2019 11:42:43 +0200 In-Reply-To: <20191018094304.37056-1-glider@google.com> Message-Id: <20191018094304.37056-6-glider@google.com> Mime-Version: 1.0 References: <20191018094304.37056-1-glider@google.com> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog Subject: [PATCH RFC v1 05/26] printk_safe: externalize printk_context From: glider@google.com To: Alexander Potapenko Cc: Vegard Nossum , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Dmitry Vyukov , linux-mm@kvack.org X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Petr Mladek suggested we use this_cpu_read(printk_context) & PRINTK_SAFE_CONTEXT_MASK instead of checking the spinlock status in kmsan_pr_err() This appears to be less intrusive, although we'll need to declare printk_context in some printk header. Signed-off-by: Alexander Potapenko To: Alexander Potapenko Cc: Vegard Nossum Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Dmitry Vyukov Cc: linux-mm@kvack.org --- Change-Id: Idb5e7c7cedf6ab6ba635a64423d58d702ad3eca3 --- kernel/printk/printk_safe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c index b4045e782743..5ebfc8bc5693 100644 --- a/kernel/printk/printk_safe.c +++ b/kernel/printk/printk_safe.c @@ -42,7 +42,7 @@ struct printk_safe_seq_buf { }; static DEFINE_PER_CPU(struct printk_safe_seq_buf, safe_print_seq); -static DEFINE_PER_CPU(int, printk_context); +DEFINE_PER_CPU(int, printk_context); #ifdef CONFIG_PRINTK_NMI static DEFINE_PER_CPU(struct printk_safe_seq_buf, nmi_print_seq);