Message ID | 20231215175545.246121768@goodmis.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-1482-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9463657dys; Fri, 15 Dec 2023 09:57:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaqMKD++Ttg9CK5svGEA0MbSMvt97LFSOQ9/PFrrNLtA8GDgAJv5cYeMPG/VpDDmgmKCHG X-Received: by 2002:a17:902:bd88:b0:1d0:4706:60fc with SMTP id q8-20020a170902bd8800b001d0470660fcmr10934475pls.17.1702663054358; Fri, 15 Dec 2023 09:57:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702663054; cv=none; d=google.com; s=arc-20160816; b=Yy7TyTpZhdbuWN7DE6DUockveKaZOZWiTTWJpxwCtUyLptSitdh2P0nX9pz9ApKnpT I8WdMhZwSh3EyDPb/u4FDAGHTDJIAh83jmFsM6Z5gJGUD+x31O9ZbNOLWDel3kBi+0G5 MZByGVCEfbMYYHmOrzx1BZuURJZOeQZUFzIo+mgOiJpuRqEeEkylUBD7QlRoapOmwWbY aUfNva5qQskSxaIC9fx9DMmdSAhO99vXek2pnK9ieo4vFW4kfXhxgBXUggg2dCXjKyqn Jor1GPoWt9YhSweEHSN9eQtHcKpnbR2+pO80tr1CkYOB36ZNz7Lk1kxI1258oXUEkfqK h40w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=HheoChgm95ZdMq1inM+wVWRIUqDQP1yMkGjb7MR0Z2Q=; fh=pL1t9p0RxD5qCgSUniSa3P4+XmpksJYPzX6TE+dndao=; b=pLIRKkcTkDeKH+QZsG8zVFiu7mTdGAuLAQ/rerHekjlPAbWmAsZEXRRDBbaNUplxt9 xulrEagWoJ+J/i0G9tox1rMXrjb71nrNc41F+3fp498CmDKRCzrEenWS+zwaiNDY16er gbx2dkgHMSU5kmZIOOXNgJVHEC3kNdmFF2YnYPiM/P0LHBZm0RbnI47g+o7muwrZfLbt X7TkkRcEis8HazpFOoU2OqyCtp2kegur8dWIqN+DqPVBqFakw7t1QeSehc2c3bSeXyky ho1ibpnw+l0aEepI9imlb7kzx/cmbgXpGlwQSRaCxXphm150gSxHejC4KbLD8jAgboi3 FltA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1482-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n16-20020a170903111000b001d3177065acsi9382614plh.229.2023.12.15.09.57.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 09:57:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1482-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 20FA5283246 for <ouuuleilei@gmail.com>; Fri, 15 Dec 2023 17:57:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7261348CF2; Fri, 15 Dec 2023 17:54:57 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org 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 91E334186F; Fri, 15 Dec 2023 17:54:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68B50C433B7; Fri, 15 Dec 2023 17:54:55 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from <rostedt@goodmis.org>) id 1rECPZ-00000002wQm-1wks; Fri, 15 Dec 2023 12:55:45 -0500 Message-ID: <20231215175545.246121768@goodmis.org> User-Agent: quilt/0.67 Date: Fri, 15 Dec 2023 12:55:09 -0500 From: Steven Rostedt <rostedt@goodmis.org> To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu <mhiramat@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Andrew Morton <akpm@linux-foundation.org>, Tzvetomir Stoyanov <tz.stoyanov@gmail.com>, Vincent Donnefort <vdonnefort@google.com>, Kent Overstreet <kent.overstreet@gmail.com> Subject: [PATCH v4 07/15] ring-buffer: Do no swap cpu buffers if order is different References: <20231215175502.106587604@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785371614945798928 X-GMAIL-MSGID: 1785371614945798928 |
Series |
ring-buffer/tracing: Allow ring buffer to have bigger sub buffers
|
|
Commit Message
Steven Rostedt
Dec. 15, 2023, 5:55 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org> As all the subbuffer order (subbuffer sizes) must be the same throughout the ring buffer, check the order of the buffers that are doing a CPU buffer swap in ring_buffer_swap_cpu() to make sure they are the same. If the are not the same, then fail to do the swap, otherwise the ring buffer will think the CPU buffer has a specific subbuffer size when it does not. Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> --- kernel/trace/ring_buffer.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index dd03887a4737..695b64fbc1cb 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -5350,6 +5350,9 @@ int ring_buffer_swap_cpu(struct trace_buffer *buffer_a, if (cpu_buffer_a->nr_pages != cpu_buffer_b->nr_pages) goto out; + if (buffer_a->subbuf_order != buffer_b->subbuf_order) + goto out; + ret = -EAGAIN; if (atomic_read(&buffer_a->record_disabled))