Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1048056ybl; Wed, 29 Jan 2020 14:21:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwBsSeuBTz9gHcrhLhBFEuikVx06OPW1KfUl9P1RHOMCm/7A8GL++jomwAmYiS1QUdl16tI X-Received: by 2002:aca:b1d5:: with SMTP id a204mr806241oif.82.1580336480119; Wed, 29 Jan 2020 14:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580336480; cv=none; d=google.com; s=arc-20160816; b=NeFRAyhrcofoURIQ6nSDA5UO6TEf7NF8+FXnNkMFxHTBO5FYRKFxyUSIa9evNezlDC P3OOZxnm+6vqHmqLDf/wUq67NQBsGhG53Ye+R30fvvQ6nLgyqyyo7+s30LsHLWO3NhcC hm+xVx4sD9czTfGP+Z9tiv0bY81hp0xXSmfra68auqJ3Uc8u9maQNf+DkG4idArNq+gZ k5ks/KMmmFv2hS3RAYDEP5RJZaz5cqfYCc1ZYLzWn3W9QjchLZrIE8UKvBrAYdjSCSeE r5EfAyN7omgF5xLxUrSTH8wsdYIEMGl2u+YbNrDkxmloefGrzKfLgcs50Bb5nhztm9le Y8qg== 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; bh=gm6baxWqlVJBYjrTuitTNaBr1MkKZDLEKcjPTz92Yuw=; b=0r6thmFp/y5h3G86SSljzuUD5a03nRDBXrLhS+0n9gxebn0WAE8PNyWIDlk0m0wgts i8e/f2dyy22+h/08kywo1hT9fvUCPNIqeWjNJeC0hp4gzwMzNGZKsfVs3kJuFyShj2ak zla5lc9ugYqc9OdWq264ZqqJelXQPd04b+F6x5OIxJxhPPnemh7AaIJo58mC4phfVJAO xdQgAlP20aFkgSu/EGSxUOrVQqDoaCn9dyDf6oNEH28OTac6uwTey0lUjlQaAv8p5cLI 8ye5NjDCEK1I+edvgJbO4VKGgHP1FvZJitxUx+YLqwvURan1OZR/hMFkZjuP25MAefwJ mqgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="L0wTNSd/"; 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 g72si1803631oib.157.2020.01.29.14.21.07; Wed, 29 Jan 2020 14:21:20 -0800 (PST) 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=@joelfernandes.org header.s=google header.b="L0wTNSd/"; 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 S1726760AbgA2WTL (ORCPT + 99 others); Wed, 29 Jan 2020 17:19:11 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:38665 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgA2WTL (ORCPT ); Wed, 29 Jan 2020 17:19:11 -0500 Received: by mail-pj1-f65.google.com with SMTP id j17so432738pjz.3 for ; Wed, 29 Jan 2020 14:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gm6baxWqlVJBYjrTuitTNaBr1MkKZDLEKcjPTz92Yuw=; b=L0wTNSd/ba+/Jir8Y8zAOCd7bzmaRvQDYfPfI8/l5zQ/mCR76l00gBEDLWTaLHWYed oJM+kdxg6sizMD60HCiFYaoJapHuqErPhDUoNTBNc3XtG4v/jLGEqonFFwajIcmS5S8H rn1JDRJEIgVmwOZqhTfq8qfszi6iq44EBMiW0= 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=gm6baxWqlVJBYjrTuitTNaBr1MkKZDLEKcjPTz92Yuw=; b=BKqptmQz1zlhbDEnUZo2Yt6bZLE+m1dBBmUKM01FpFSsCNBByC3SaZI2tnoBAtQaHu sI9X9DZmcmrvd/eBsI/JSPuikgE/a4Kjg2aZVPfGYdBXI+S7oj9rO6pYzGqQPRKlz9ri kHTPlueLzJ7Ce6xaN2u+/AL6A97iv1q4q9xCGbzwrDJ73RDwH1IN2kIYfBXUFvdnnTfr +WaKaKsmYi7IS8QLnditClNCCdonL0381nk+vICOIAeixBCYEJJLiaFOSFy9L3jKVkjH UlzFXZm1uJFEqyFfqOksm+fXclbOfrEpuLWbPy6k+7rsLgc4P3E67HMsBRfnqzCzppej zXxw== X-Gm-Message-State: APjAAAUNxQ/YlU/twU0rlam7yGjqT9SJWfU+7kccDf9YB6jd80CLYIQN 7qeM6dQ6xtmBraAQiaopiWs2jQ== X-Received: by 2002:a17:90a:3243:: with SMTP id k61mr2157855pjb.43.1580336350700; Wed, 29 Jan 2020 14:19:10 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id gx2sm3676730pjb.18.2020.01.29.14.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2020 14:19:10 -0800 (PST) Date: Wed, 29 Jan 2020 17:19:09 -0500 From: Joel Fernandes To: Amol Grover Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Madhuparna Bhowmik , "Paul E . McKenney" Subject: Re: [PATCH 2/2] events: callchain: Use RCU API to access RCU pointer Message-ID: <20200129221909.GA74354@google.com> References: <20200129160813.14263-1-frextrite@gmail.com> <20200129160813.14263-2-frextrite@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200129160813.14263-2-frextrite@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 29, 2020 at 09:38:13PM +0530, Amol Grover wrote: > callchain_cpus_entries is annotated as an RCU pointer. > Hence rcu_dereference_protected or similar RCU API is > required to dereference the pointer. > > This fixes the following sparse warning > kernel/events/callchain.c:65:17: warning: incorrect type in assignment > > Signed-off-by: Amol Grover > --- > kernel/events/callchain.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c > index f91e1f41d25d..a672d02a1b3a 100644 > --- a/kernel/events/callchain.c > +++ b/kernel/events/callchain.c > @@ -62,7 +62,8 @@ static void release_callchain_buffers(void) > { > struct callchain_cpus_entries *entries; > > - entries = callchain_cpus_entries; > + entries = rcu_dereference_protected(callchain_cpus_entries, > + lockdep_is_held(&callchain_mutex)); Reviewed-by: Joel Fernandes (Google) thanks, - Joel > RCU_INIT_POINTER(callchain_cpus_entries, NULL); > call_rcu(&entries->rcu_head, release_callchain_buffers_rcu); > } > -- > 2.24.1 >