Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp396872rdb; Tue, 5 Dec 2023 08:17:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXNqsIKqA52Hmkl8uzCaA4jWPtOJGf3pZ+7y7L2m08apuLiEp9YuKUh5843qgs+C4iBVxu X-Received: by 2002:a92:908:0:b0:35d:5f66:377f with SMTP id y8-20020a920908000000b0035d5f66377fmr7142088ilg.50.1701793077478; Tue, 05 Dec 2023 08:17:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701793077; cv=none; d=google.com; s=arc-20160816; b=tia5QI0WGxeTVGCnmTOT0ENIHqctz6a+T9GvIfiqdPdZB7X5PQPEYtLLCJB8ElGF1u IFt/n8PgrRi+tFZdAmsmz6cO0aFQvY1C7ZN2PpYJQL/NG0Ndjaji61MoW0UPi8S1C0Xb 0gTz43+Oy0p6/C3DoU5eSIuFMuFmFIu230XkNDUzPprQM0jiXWcOR6JgzxSg5gPcXjyW 6kS823CukvYAJTeqvihB2mnYK6z1bAtiFpSGBl6JeSL/wFz+ILc214sk9Eqj/WvmErBy CidPhcog5Z/zh/VX/l5KHpLiklFckS8FyeLghMhjVKRxyjhVwRIfv8druyoA1Vk+ATpT S6wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=fQzhIqn6N20Rb9xIg/ZWOpbjV4kaWzviVQteSO4jyfU=; fh=A8IXS4Fz+BVVPKm4WVuzSIltevRDQjLcS16bjPKmIkk=; b=P6q87YklU5xOlV52LyQywLtWzBpdandhqXOuoXJ/3IPMjCsYNzYx5ncPNnJhWUZGf9 Z9I9WYXUU6imW+1N+Q8Day6YRSllLgZ7nxK2GB/q+LSrDz00tYRIfMfctKo7SXghuNQO J+PkxG60+SFqbpD38IRRp3ahG4ommKYwwqADpUbAGwgstTZfQ7/ENpVMANeuxl8vg0ER YoUeW51AusP6XpGjVO3DpHTQKpUKAan0jVEWnzhVn5JSWQa0l0zQuc1OtClh5A8yGdUy n6bM+xEz5uykmLW3gOMT7SFfxFMncl8fvVMF25G8hhphsa+twMVgR8MxcJ0C+jkdu/Sn rsRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=H2K8ACgR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u2-20020a632342000000b005c5e2165e37si9757374pgm.125.2023.12.05.08.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 08:17:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=H2K8ACgR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 434DE8087253; Tue, 5 Dec 2023 08:16:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231887AbjLEQQO (ORCPT + 99 others); Tue, 5 Dec 2023 11:16:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231833AbjLEQQN (ORCPT ); Tue, 5 Dec 2023 11:16:13 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6410C3 for ; Tue, 5 Dec 2023 08:16:16 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a1a496a73ceso576378666b.2 for ; Tue, 05 Dec 2023 08:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1701792975; x=1702397775; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fQzhIqn6N20Rb9xIg/ZWOpbjV4kaWzviVQteSO4jyfU=; b=H2K8ACgRrRkoEP8aeAMagyOG8JafMmIoK+lpyiVhabAwp8i084b4goARvY83R/H4wm Vue2ty0wYiKV6pBPUwPYyVwlhWM7EJcJuaS/sc4vtbv4T2gyZPsMC82LQ1KAd3niqgy/ e9wZlGOQcMB7i0S6kCwcHhuA+si5mCnNlf0X8dnO1ULqKy1pDC/KnKXL/Kg0qEaT1iRd 5wVgaBSCkGxK1mAskfiwCFsUM17nteO37h4QKmifHic47BgF2ABprlfJdtHRg4u9yGK2 0WWuzPq2pXFCq/Q0qgDksiHiuk0q+FZRwWIzlZcLfNa2QJZa4dbklqpf2S59TIDlYRjc So1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701792975; x=1702397775; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fQzhIqn6N20Rb9xIg/ZWOpbjV4kaWzviVQteSO4jyfU=; b=NcNaxM/On/Z3kmw8TSXro6QToS+JLSSc8m+FqsVdm+CJTGY+eexz+O0+n9C/A+bM7r hdGODTl25TdHC7Z1oI6tGO+FLmNx7R+Ym1UnNJ6K7L4/Y8/FBw7DIQLeCDW6goOW+pzt pTFo+JqppIwasj5PBzHjF3fObppp03MG3730/lOd5Gqon3z2AkKwK6JM3rdii9+/6cKx /5CqZsySvhLRDQsZoH8wOEjPELuSHlQymy3w0G59AXkPuK7nwAghMPHa5LNpITH6RYSX r00iuzbOalAfzQBGPnguqvSnAtT1q4AT/eCn0VOB+N8HNe8OG1aM2afXm/Aj6+T6XzoE mBZw== X-Gm-Message-State: AOJu0YxtejAJbaLBSAwmJwag/ONpw44hM9NOn8kn3c5Gaak+5vNGnX32 VP9XL4d5M99OgKObz/l0Y+6joA== X-Received: by 2002:a17:906:f0c4:b0:a00:772c:c879 with SMTP id dk4-20020a170906f0c400b00a00772cc879mr653564ejb.38.1701792975219; Tue, 05 Dec 2023 08:16:15 -0800 (PST) Received: from [10.100.51.161] ([193.86.92.180]) by smtp.gmail.com with ESMTPSA id qc14-20020a170906d8ae00b009a9fbeb15f2sm6895238ejb.62.2023.12.05.08.16.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Dec 2023 08:16:14 -0800 (PST) Message-ID: <490c77e9-e3d4-4499-8471-128804fb2e7a@suse.com> Date: Tue, 5 Dec 2023 17:16:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] tracing: Simplify and fix "buffered event" synchronization To: Steven Rostedt Cc: mhiramat@kernel.org, mathieu.desnoyers@efficios.com, zhengyejian1@huawei.com, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231127151248.7232-1-petr.pavlu@suse.com> <20231127151248.7232-2-petr.pavlu@suse.com> <20231127124130.1041ffd4@gandalf.local.home> <77037ca1-8116-4bc6-b286-67059db0848e@suse.com> <20231128102748.23328618@gandalf.local.home> <20231129095826.1aec6381@gandalf.local.home> <20231201094639.03a1913c@gandalf.local.home> Content-Language: en-US From: Petr Pavlu In-Reply-To: <20231201094639.03a1913c@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 05 Dec 2023 08:16:28 -0800 (PST) On 12/1/23 15:46, Steven Rostedt wrote: > On Fri, 1 Dec 2023 15:17:35 +0100 > Petr Pavlu wrote: > >> Ok, keeping the current approach, my plan for v2 is to prepare the >> following patches: >> >> [...] >> * Fix the potential race between trace_buffered_event_enable() and >> trace_event_buffer_lock_reserve() where the latter might already see >> a valid trace_buffered_event pointer but not all initialization yet. >> >> I think this might be actually best to address by using the same >> maintenance exclusion as is implemented in >> trace_buffered_event_disable(). It would make both maintenance >> operations consistent but for the cost of making the enable operation >> somewhat slower. > > I wouldn't do them the same just to make them consistent. I think the > smp_wmb() is sufficient. Don't you think? Looking at this again, I think it is actually a non-issue. Function trace_buffered_event_enable() only writes the header part of ring_buffer_event but that is never written nor read by the actual users which obtain the buffer from trace_event_buffer_lock_reserve(). No change is then needed, it is left out in v2 of the series. -- Petr