Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp332543rwl; Tue, 11 Apr 2023 19:33:26 -0700 (PDT) X-Google-Smtp-Source: AKy350avrC6sSLV+ewav0Y8blXV5Ha+86V8heLjxLzf50NFbmOTrfYZSNaQkLfN5oXfowsdNw12C X-Received: by 2002:a17:903:2346:b0:1a1:aa28:e67a with SMTP id c6-20020a170903234600b001a1aa28e67amr6648674plh.48.1681266806453; Tue, 11 Apr 2023 19:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681266806; cv=none; d=google.com; s=arc-20160816; b=QcwmY4zA/c1KwaqE4BS2i7CdYiO6uZRvCud31ylVmJ4l+hnK2hNNXlFb1/23BBhGmN lFZAT/4Sz3n4DfUEtmuKo4d8qha07CGG97MsxZGOAZ116XepudyT1ybD6urlECAkH6rb 892ZePjPgdSiLS95Q+kiOhQ+b+HxW59rFzNhdTOyPKINIoNWPYwgOMXDscsnwox31mHM 3qsINA5+mzTiMv0reYgueF99WZ//aoim5epHX8D0i7hzOSTB7yhC1CFdkV7Pf5+6B2J9 NmeL52iw6fvT6f3T0Nqs0tq2Y7xNJONrBW5ODAlVkR6AkxgW+OKAoEA+k2QDHmPnkh2M L51A== 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=4o7+iubYjoUcwNb8zUDpfhNzVze9yKoaXXAfGuMN3mM=; b=A0d2aFliL/fOuSBYtzA0YS3QA8mSOL2nwBpqxAnARMr1OY9pMTdEoill4mRXaWUCxP yPipVqF3r0khhtivTjYe0U0rfDufjLpxfqV2GmDNkQ+zuUV8SWT37/thikfeeYZxN4f9 L40eJAb2VnXigl6WXOiNjf2XP78hYNIibJeTu71TNvS4gR1Wfbw6TrxtX9r6dyH+x/S7 E47aSSrFd07WiWe0GewuKB/S4UpeSPVCHgs1O1cLMvoRKTxzunMtxE2b1meRkUM6w89M ACBjk41j8g473WNcuxzprMfS4ZyH/4r5XmFN7xTXU1pGgF5zT1pdK1BCV0zBCQi1JuxD h/hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji6-20020a170903324600b001a645ef0fd2si5564440plb.0.2023.04.11.19.33.14; Tue, 11 Apr 2023 19:33:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229565AbjDLCcO convert rfc822-to-8bit (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-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]; > >