From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59C22C7619A for ; Wed, 12 Apr 2023 02:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbjDLCcO convert rfc822-to-8bit (ORCPT ); Tue, 11 Apr 2023 22:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjDLCcO (ORCPT ); Tue, 11 Apr 2023 22:32:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4249144B1; Tue, 11 Apr 2023 19:32:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D637A6266D; Wed, 12 Apr 2023 02:32:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0108C4339E; Wed, 12 Apr 2023 02:32:10 +0000 (UTC) Date: Tue, 11 Apr 2023 22:32:06 -0400 From: Steven Rostedt To: "Tze-nan Wu (=?UTF-8?B?5ZCz5r6k5Y2X?=)" Cc: "linux-kernel@vger.kernel.org" , "linux-trace-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , "Cheng-Jui Wang (=?UTF-8?B?546L5q2j552/?=)" , "paulmck@kernel.org" , wsd_upstream , "Bobule Chang (=?UTF-8?B?5by15byY576p?=)" , "stable@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "mhiramat@kernel.org" , "angelogioacchino.delregno@collabora.com" , "npiggin@gmail.com" Subject: Re: [PATCH v3] ring-buffer: Prevent inconsistent operation on cpu_buffer->resize_disabled Message-ID: <20230411223206.0bc5794e@gandalf.local.home> In-Reply-To: References: <20230409024616.31099-1-Tze-nan.Wu@mediatek.com> <20230410073512.13362-1-Tze-nan.Wu@mediatek.com> <20230411124403.2a31e12d@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org On Wed, 12 Apr 2023 02:27:53 +0000 Tze-nan Wu (吳澤南) wrote: > > > @@ -5368,7 +5372,7 @@ void ring_buffer_reset_online_cpus(struct > > > trace_buffer *buffer) > > > /* Make sure all commits have finished */ > > > synchronize_rcu(); > > > > > > - for_each_online_buffer_cpu(buffer, cpu) { > > > + for_each_cpu_and(cpu, buffer->cpumask, &reset_online_cpumask) > > Maybe we should use for_each_buffer_cpu(buffer, cpu) here? > since a CPU may also came offline during synchronize_rcu(). Yeah, I guess that works too (not looking at the code at the moment though). -- Steve > > > > { > > > cpu_buffer = buffer->buffers[cpu]; > >