Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp575237pxv; Thu, 24 Jun 2021 14:42:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1zcskwImVk8MyaaZvm7R1ypEqM7dzQ4gVluMqRHm88i2rMDapXtitAIgUk+Pu7fN8+NsS X-Received: by 2002:a17:906:26c7:: with SMTP id u7mr7290220ejc.211.1624570954530; Thu, 24 Jun 2021 14:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624570954; cv=none; d=google.com; s=arc-20160816; b=ga7cBobRyAxFG1CC0B0xBQWDjDKv24NYzw5i4XYD98ez/10zWIA0rV9B5MIpg1O1WB CgvJtyTi8E2FCDxWv+b2NUj/tDvSOWimzBNJzX2bMj40EohYRaclYJcSX8L+N3BJsfGN UtveLFtvp3XoVx/Dv7Id108Yx/TNENiw5X1QrnmRqAOSZ/JupcwGu5HiMzehAxld90fK iMVPn/YvMbQ3TRw8upVgQZp+pX+dfEHnA0GYSopkmdetc8sC+ZypcmKR2NrL+nO88Sz4 U01OXYVQfJKY+fEKD2KDMJTf6UzYEuAha4UeWF9x+tdlxzZWfhTxTPUkF+Gza+fPJoxG W9AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=0/BkiWgOrAmyYQwwZhdxkEK/lh1OI4DqTDav5EdL+go=; b=wLjGJfGNTQgT7Cu/kTWXxAdjBsdkcjT27r0LCaw3FsgSW/YUcbIelo3NpCy5uf/18i 4Dey3uYok/cKb1tSdtmioWMiAYxKvcAftPQ/ldICrFZHrC4p7oCM/hg5sLepbxZVSO6J 5Q20PBRH5RBqzt7U9fvYjyci8fCVsZQVoV544kVPRX4q98tLOzzzur+O/6PZheTSg7b0 ZFTHDX7MjC8jYTNxTcOCaFoVsUfDLkPFB9eX7fJxdIFsNn3LdxcIfJJ5c7QnF+QZVufg EkYuF/7kngEFREL2iM54DMJhMQrCyXaMQgPzpgY7Fv4NUWqWy6WtB46kWcKCY5xR+G17 BLEA== 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 og23si4130631ejc.553.2021.06.24.14.42.10; Thu, 24 Jun 2021 14:42:34 -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 S232693AbhFXVl0 (ORCPT + 99 others); Thu, 24 Jun 2021 17:41:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:54004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232029AbhFXVlZ (ORCPT ); Thu, 24 Jun 2021 17:41:25 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EDB6C613A9; Thu, 24 Jun 2021 21:39:03 +0000 (UTC) Date: Thu, 24 Jun 2021 17:39:02 -0400 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: Phil Auld , Sebastian Andrzej Siewior , Kate Carcia , Jonathan Corbet , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexandre Chartre , Clark Willaims , John Kacur , Juri Lelli , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V5 12/14] trace: Protect tr->tracing_cpumask with get/put_online_cpus Message-ID: <20210624173902.57f4f34f@oasis.local.home> In-Reply-To: <38d2ef13b33c42fcf424a6213a27c8b5246548e0.1624372313.git.bristot@redhat.com> References: <38d2ef13b33c42fcf424a6213a27c8b5246548e0.1624372313.git.bristot@redhat.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Jun 2021 16:42:30 +0200 Daniel Bristot de Oliveira wrote: > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index 52fc9438b7b4..c14f33db147e 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -5053,7 +5053,13 @@ int tracing_set_cpumask(struct trace_array *tr, > arch_spin_unlock(&tr->max_lock); > local_irq_enable(); > > + /* > + * tracing_cpumask is read by tracers that support CPU > + * hotplug. > + */ > + get_online_cpus(); > cpumask_copy(tr->tracing_cpumask, tracing_cpumask_new); > + put_online_cpus(); > > return 0; Hmm, the tracing_cpumask is only touched in he work function, with the necessary locks. How is get_online_cpus() protecting it here? That is, tracing_cpumask isn't touched in the path of bringing up or taking down a CPU, and shouldn't be an issue here. Should I just drop this patch? -- Steve