Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp834326pxk; Thu, 17 Sep 2020 18:23:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqrAWlFGsWXnjSADAbf39Nhf+B18RkyAiq9U0nDevsSmuNieLrFUaf+SEK0iP0DpcR/V0V X-Received: by 2002:a17:907:110f:: with SMTP id qu15mr35023970ejb.359.1600392237686; Thu, 17 Sep 2020 18:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600392237; cv=none; d=google.com; s=arc-20160816; b=WaPmbxGD6lSuSpvj2w1Nc48ExLpQHcLvyEpCuKd6ik+7G8rv07kq8Vlygpa+Binq71 7wQgJY+w3H1zQyTgPMwA22bqZkNgdKFYmnXtIVxISUIieQ1AwJv4FMa845tJzCrY3YAR ZS74oK5ttnLJ2v1G4Orb+7SCyvS9T3cN/3PtS5L8iOLvZ/KiUN2I12oO1mBk5VO0pWoP M0pWyh3XklAFE2lN/aYSMhKIFGt5owPJqx9o2sOAqM8LdiV8elZNM9f+mGkp8QOrGgQK ALBuoKxF0+j+C7UEAba50QfiQKg85bLMqU57RMUlMYrxlqmr5XSGl98lLqO5T84vNOKX hA0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=XCRA5ShqkYFVPYXgaWFuhDPK7Vy4L3U72B/YEopxcOk=; b=HMQcnNc43hK0po+bI+ro1ezHhZ6vUv2AymPGjMiAngSv/gDvlDWX27AhdLyP8Cn2AM 06gVg6xwypDNjfkL6SZ6rHG6oCyC5OYbeXxOoqZ1yvdHobAg6IfSKlP7qHHeGBsGen5J jcvt6s1w0ijyo5zB/Ap89nHLdWC62WM2cZVUk1SqddGsyv4aKXWRgfkqtAAusPVIUsQv sKbVCm5VdbP+rugqSJWtFeboYlzRwJNEeG42Nx8hliEctbLD1JeD/fftiCGsotBl1rrd 2UWd8aB2+wuZYdx8unHErKjAudmdIYReqqdAp+V7uAXBMF55CBheeAqZfjsQGsfUO7+Z hV9g== 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 c9si1073814edt.107.2020.09.17.18.23.34; Thu, 17 Sep 2020 18:23:57 -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 S1726109AbgIRBWf convert rfc822-to-8bit (ORCPT + 99 others); Thu, 17 Sep 2020 21:22:35 -0400 Received: from smtp.h3c.com ([60.191.123.56]:17903 "EHLO h3cspam01-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725886AbgIRBWe (ORCPT ); Thu, 17 Sep 2020 21:22:34 -0400 Received: from DAG2EX01-BASE.srv.huawei-3com.com ([10.8.0.64]) by h3cspam01-ex.h3c.com with ESMTPS id 08I1Lb7C092671 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 18 Sep 2020 09:21:37 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) by DAG2EX01-BASE.srv.huawei-3com.com (10.8.0.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 18 Sep 2020 09:21:38 +0800 Received: from DAG2EX03-BASE.srv.huawei-3com.com ([fe80::5d18:e01c:bbbd:c074]) by DAG2EX03-BASE.srv.huawei-3com.com ([fe80::5d18:e01c:bbbd:c074%7]) with mapi id 15.01.1713.004; Fri, 18 Sep 2020 09:21:37 +0800 From: Tianxianting To: Steven Rostedt CC: "mingo@redhat.com" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable() Thread-Topic: [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable() Thread-Index: AQHWcWW/lUMuTErgSEmeCDizYMhoyqltPS+AgACT0gA= Date: Fri, 18 Sep 2020 01:21:37 +0000 Message-ID: <87803c1d960c4b17b59eb39346fdb028@h3c.com> References: <20200813112803.12256-1-tian.xianting@h3c.com> <20200917203127.091e23f2@rorschach.local.home> In-Reply-To: <20200917203127.091e23f2@rorschach.local.home> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.99.141.128] x-sender-location: DAG2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-DNSRBL: X-MAIL: h3cspam01-ex.h3c.com 08I1Lb7C092671 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steven, Thanks for your reply:) -----Original Message----- From: Steven Rostedt [mailto:rostedt@goodmis.org] Sent: Friday, September 18, 2020 8:31 AM To: tianxianting (RD) Cc: mingo@redhat.com; linux-kernel@vger.kernel.org Subject: Re: [PATCH] tracing: use __this_cpu_read() in trace_buffered_event_enable() Sorry for the late reply (been busy with Linux Plumbers, took a vacation, and then trying to catch up on all my email for the last two months!) But I just wanted to let you know that I added this to my queue. Thanks! -- Steve On Thu, 13 Aug 2020 19:28:03 +0800 Xianting Tian wrote: > 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();