Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1303053pxa; Thu, 13 Aug 2020 05:58:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSlzNm9U49g3f30El+JEAeEsXpKOXVbu9kzDR3mjcd480IAqR43I8+Y9nR5lUalz1q7oHF X-Received: by 2002:a05:6402:a59:: with SMTP id bt25mr3818385edb.71.1597323482831; Thu, 13 Aug 2020 05:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597323482; cv=none; d=google.com; s=arc-20160816; b=JIjY1TqWE/tdtSJrjbGTqyZOqEnhq5+M32Fz0ZvSpJhyV1XTWOy4bn2l6jAASQxmzO sD/KU8YBRwzsNsfzQD3oL3CMqvN2q7P3kqsVMzXlU9bCcQzOT/7ki/kQh31ly8nK9r8N 9tsh4QoTXOYY4srqPJNmqRjC+SOyhX9+Pw3JSTKo7lD92h1Cu9Nw9l55NgAKbOfB3sUG ZkTZyuxYd5RFHHp2cAXlLmpID/pFLDww1MwNQBKTm8X/0uDfnUlg/zIpPowAlCyc9tI+ TLZhgXgJ8aBcouEUM2VBbJhpSxB4LBlwKd9Fw+GqfXTfhanhpwZ/klERg93VJhUrlCaM U/Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=IynXGUVGGV2ju8DcTjfhWA3UoX1sTqax00zI9lndlNM=; b=XYzjyEcCod4L5nEpe0PxgwrYB+LKBXq7CWxOaVjguiTsbNWEy/AWBoD/L23+6RMREo jcIC/g2suA1yofw7ZC5Va7qSwOX/WUKzuT+7/5VnX8VXyy+BJvPn4TQTiRTpBU4n5j0p 5YXH2rrYq9hXDe4G3Xdb8zIqZu8OAmu8bkY5+2z8059uJdU7x30S0N36ttesQbT/EPKu 1/4Ih57vg1CKGvpKlmIabnQ57//nlTFQJ8LQ7MeGtVNHkEHsTnr2gnl8C1Q3WBnXtWtJ PFdbWxAws7PmEoQQizT/HZ0gsy9rS3nZjJqg7BT6l/np267XaKsBmVeUfl+Po+X1toal IOMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p21si3735754eds.193.2020.08.13.05.57.38; Thu, 13 Aug 2020 05:58:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726419AbgHMMzA (ORCPT + 99 others); Thu, 13 Aug 2020 08:55:00 -0400 Received: from smtp.h3c.com ([60.191.123.50]:26134 "EHLO h3cspam02-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbgHMMzA (ORCPT ); Thu, 13 Aug 2020 08:55:00 -0400 X-Greylist: delayed 4762 seconds by postgrey-1.27 at vger.kernel.org; Thu, 13 Aug 2020 08:54:59 EDT Received: from h3cspam02-ex.h3c.com (localhost [127.0.0.2] (may be forged)) by h3cspam02-ex.h3c.com with ESMTP id 07DBZXOS027013 for ; Thu, 13 Aug 2020 19:35:33 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from DAG2EX03-BASE.srv.huawei-3com.com ([10.8.0.66]) by h3cspam02-ex.h3c.com with ESMTPS id 07DBYhDN026643 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Aug 2020 19:34:43 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from localhost.localdomain (10.99.212.201) by DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 13 Aug 2020 19:34:46 +0800 From: Xianting Tian To: , CC: , Xianting Tian Subject: [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable() Date: Thu, 13 Aug 2020 19:28:03 +0800 Message-ID: <20200813112803.12256-1-tian.xianting@h3c.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.99.212.201] X-ClientProxiedBy: BJSMTP01-EX.srv.huawei-3com.com (10.63.20.132) To DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) X-DNSRBL: X-MAIL: h3cspam02-ex.h3c.com 07DBYhDN026643 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code is executed with preemption disabled, so it's safe to use __this_cpu_read(). Signed-off-by: Xianting Tian --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index bb6226972..7d0d71ce9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -2514,7 +2514,7 @@ void trace_buffered_event_enable(void) preempt_disable(); if (cpu == smp_processor_id() && - this_cpu_read(trace_buffered_event) != + __this_cpu_read(trace_buffered_event) != per_cpu(trace_buffered_event, cpu)) WARN_ON_ONCE(1); preempt_enable(); -- 2.17.1