Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2000076rdb; Tue, 20 Feb 2024 13:51:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUQVohoqYf20LpQVtL9qsFwYiug3p8P4g1/LjvBIHrgn2CehdoNjhtjx5zND4OfWTCAgeAHtkg8b9jdrpJj1zUDmcS/0U60fRB8LJmE/Q== X-Google-Smtp-Source: AGHT+IGkLilIqysSpK/7EkUTnvigMW7fHrkgkND47Eo5vPH8cAP9d3NmdYYmcB1gVGP4pbKs9Lrv X-Received: by 2002:a0c:dc82:0:b0:68f:7891:ef2e with SMTP id n2-20020a0cdc82000000b0068f7891ef2emr5866583qvk.53.1708465888135; Tue, 20 Feb 2024 13:51:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708465888; cv=pass; d=google.com; s=arc-20160816; b=tToVLP8nZ5dv1sF4JtsmffEBIjZF2dx4KjGQMggP+SX5pQ9pS0b4uzs6jc10PDdi0j /kfwrrAg6CJFhWTcPss+7BQvTNMGo7FsJvFO1+luF3RDqa78go+aF6Z+Uass0pA9tLoD QC5fymhCZe2yH0W3sqNCXZyOMOIa+ZpfXOZ2CYgDgCvR9NjSJWQHhgBOCAlwbGIfrC3F mA3SdBpl7hQ0fbCYYiGgLZDrBhCGJs7b1A1JEQGmKozZrq+mgVdb4BHtIYW/NJfHj8TV eJ7mC9qlA8fGSuZ/bo8xdRfOD1rVJrZujiEt5KIahLo5SRNZjbe1D2pc46LnE4XcO95n bvCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=//4z1gYhCbSIF3EeO8JdyAQHzEz2VIHOPrW45DOrMzM=; fh=DXqSFHFMGWs8NWhSKawAW+CcN1HWregSaTKgaWTRpeY=; b=iJAFX/YWkhQxcLEMyQ4ddp9UuNtZisg0AUfrDjJyGY2H5TJuHLUjDECy3oqlKOUbMP 2rv4TW4dqou/IvZwwnOQftsWWS/s26FOelSvVHScyndRtpwhS30T8x/WD8mZ9lKykPbU k2k4z6vp8cNIqt00YcBbWqfh5579w9CY/vvbtIBPFWJ6Tt2dL1YAPIuGk6eAIJNJi4uO 5c7iVZYdvYBSAXHueyWVoBIDtd45zGOIS8dQQ/mEvZWk4TxJcPfakysnsl5M8kI5oGH8 e3s6/kKUbPjSmZCKyNChIYn4gtP2LzC7dO3yZ4wvTvTsRssjLb8I5rz71swhsFRvzSIW K2Kg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-73739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73739-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kk6-20020a056214508600b0068cb7b24a38si5743807qvb.339.2024.02.20.13.51.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 13:51:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-73739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73739-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D83651C2235F for ; Tue, 20 Feb 2024 21:51:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E39F4152DED; Tue, 20 Feb 2024 21:51:21 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 699CE151CDD; Tue, 20 Feb 2024 21:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708465881; cv=none; b=L8hfXZbgRbQqNHCf7jrKB4yDODcgRMDlbiNzeNKPpfBMrN0wu2NwthKQPQF7rFGuui1qYPcJvLbeCDxXXKKeYoPzbPfF1yWxZDK1UfOsgHO/Q45dW4FVvfIX6dRk9eg+7rrGNbCZQKJAp7MmXIWITipZeOgrOp2N/zSNiV2dpuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708465881; c=relaxed/simple; bh=SBVugy/i+bJm3mD9Fj+7nQshn15kMHWVPHxAC6pFM8k=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZwjZW366ak39UkkXtm7Nl0o4iCWzL01bnqAqBGJl4Y4k+jHohheIIFqotJz/ngNLZXkVaYViUKYjpblBQfqbtWn+CFkDBGEkf+K5tdjYWxBcIet5FIhUh+Jrp8TRi/VyKBxIShfj6clpu6t9ApY0amXTgw9mo0icBWWyrWEgU9Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C097C433F1; Tue, 20 Feb 2024 21:51:20 +0000 (UTC) Date: Tue, 20 Feb 2024 16:53:06 -0500 From: Steven Rostedt To: Mathieu Desnoyers Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mark Rutland Subject: Re: [PATCH v3] ring-buffer: Simplify reservation with try_cmpxchg() loop Message-ID: <20240220165306.68ecbe9d@gandalf.local.home> In-Reply-To: <20240220104023.2182b5c3@gandalf.local.home> References: <20240219182032.2605d0a3@gandalf.local.home> <20240220091922.45848d9a@gandalf.local.home> <168765ff-98ea-42a1-82f7-56178bfcf7ec@efficios.com> <20240220104023.2182b5c3@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 20 Feb 2024 10:40:23 -0500 Steven Rostedt wrote: > > Try resetting the info->add_timestamp flags to add_ts_default on goto again > > within __rb_reserve_next(). > > > > I was looking at that too, but I don't know how it will make a difference. > > Note, the test that fails is in my test suite, and takes about a half hour > to get there. Running that suite takes up resources (it's my main test > suite for all changes). I'm currently testing other patches so I either > need to figure it out through inspection, or this will need to wait a while. I did a bit of debugging and it's just getting weird. It triggers when I run with the "perf" clock, which is the local_clock() (and this has CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y which does some strange paths for local_clock()). It appears that on function_graph tracing with perf clock, it fails the local_cmpxchg a lot! And for some reason, this is causing it to fail the overflow more often. Well, if it pushes the header page forward too, it will also cause that to go back and add to the counter. I tried moving the "again:" to the beginning of the function (after resetting the add_timestamp flags and length) so that it gets a new tail_page each time, but that doesn't appear to make a difference either. It looks like that retry loop in some configs causes it to fail allocation on the subbuffer over a 1000 times! Looks like this changes expectations a bit, and will need more design changes to make it work. -- Steve