From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 22AAF420E7D for ; Tue, 7 Jul 2026 13:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783431984; cv=none; b=uMPlRhgnsf02xoRRpAPvwrZSLrAH3r68P5OItNRO8nNMl7ZmoFf7XG6bmVLPaq/r+XubYRUOwXFNRtOH/DA1/yxH3YcSoHcaq9Qmmkd+dwXmlBisYEoib9VM+YLcPhXcDsRbb38a94Nzt8CR62iSVhTA8B8oaLDgp9agPiVxR9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783431984; c=relaxed/simple; bh=wnsVrcdRf7/I1YR9YP7b6Y8Wjp4eB1aqFD2G2PuQixI=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=SkVcbhjs/CE4GamSSS++swGh8G3PzJHiFuoe3MlVqRmDoJjyGubuiBhaZwnDcz6ZoSp7C0S1zj2i+Gq/CT27PN9uP58/YaSHFF51V41mpPQJ54j/6TpOXvfaKmxvM0cWTBKbr79inL/mCysSknn/Fzr3yhetKmLWaP7yTLT7pH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fhxD4MBA; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fhxD4MBA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 049B91F00AC4; Tue, 7 Jul 2026 13:46:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783431981; bh=QWlWY9VOXwiI5Hbahtf3CzYrc/ftArxBpnTzbJ3Ff4A=; h=Date:From:To:Cc:Subject:References; b=fhxD4MBAVnc73rVUe76UuQAkK5e07gnygWzyt8AkIk6FLW+OUfzXEsjZhjdFucMcv RunetqdpvhwVPez1MT8Sk2W1RYdqMXEO8SS9g1X/pM44b6RSPmk/i9GsEh560foX52 A7MSLHmiMcE+frXHCiqmQ9pyU6wOuWCRj+xhZ3LGUyVbjZxlszMAEkqTfFpxZtZrlR 7N2Xmnng30nQyYmmbYR1IdlZAodga5+6upy/vsMQoSiMEXbDKGwzKyH/u5ENixuXUf rFg7RbkyNe0OSb9xd7FUWb1ueX07tMZBuogritY/RXhnEUf/q+o5DxdRwi7PKNY7fh qdvM4tJBG7ELA== Received: from rostedt by gandalf with local (Exim 4.99.4) (envelope-from ) id 1wh680-00000000h3a-15dl; Tue, 07 Jul 2026 09:46:24 -0400 Message-ID: <20260707134624.094636288@kernel.org> User-Agent: quilt/0.69 Date: Tue, 07 Jul 2026 09:46:10 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , David Carlier Subject: [for-linus][PATCH 06/13] ring-buffer: Fix ring_buffer_read_page() copying only one event per page References: <20260707134604.275787924@kernel.org> 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=UTF-8 From: David Carlier Commit 8928e4a3be34 ("ring-buffer: Show persistent buffer dropped events in trace_pipe file") split the "commit" variable in ring_buffer_read_page() into "commit" (raw) and "size" (masked page size), but the inner copy loop's terminator was changed to compare rpos against "event_size" instead of "size". rpos is the cumulative read offset within the page; event_size is the length of the single event just copied. The loop thus breaks after the first event, so only one event is copied per call. This regresses the per-event memcpy path (partial reads, the active commit page, and mapped/remote buffers) used by splice/trace_pipe_raw and mmap consumers into a one-event-at-a-time read. Compare rpos against the page size as the original code did. Link: https://patch.msgid.link/20260616175538.111628-1-devnexen@gmail.com Fixes: 8928e4a3be34 ("ring-buffer: Show persistent buffer dropped events in trace_pipe file") Signed-off-by: David Carlier Signed-off-by: Steven Rostedt --- kernel/trace/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 3ec173e22eeb..4b994aea9e61 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -7183,7 +7183,7 @@ int ring_buffer_read_page(struct trace_buffer *buffer, rpos = reader->read; pos += event_size; - if (rpos >= event_size) + if (rpos >= size) break; event = rb_reader_event(cpu_buffer); -- 2.53.0