Skip to content

Commit 15e9aaf

Browse files
dhowellsbrauner
authored andcommitted
netfs: Fix rolling_buffer_load_from_ra() to not clear mark bits
rolling_buffer_load_from_ra() looms large in the perf report because it loops around doing an atomic clear for each of the three mark bits per folio. However, this is both inefficient (it would be better to build a mask and atomically AND them out) and unnecessary as they shouldn't be set. Fix this by removing the loop. Fixes: ee4cdf7 ("netfs: Speed up buffered reading") Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/r/20250314164201.1993231-4-dhowells@redhat.com Acked-by: "Paulo Alcantara (Red Hat)" <pc@manguebit.com> cc: Jeff Layton <jlayton@kernel.org> cc: Steve French <sfrench@samba.org> cc: Paulo Alcantara <pc@manguebit.com> cc: netfs@lists.linux.dev cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 344b7ef commit 15e9aaf

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

fs/netfs/rolling_buffer.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,6 @@ ssize_t rolling_buffer_load_from_ra(struct rolling_buffer *roll,
146146

147147
/* Store the counter after setting the slot. */
148148
smp_store_release(&roll->next_head_slot, to);
149-
150-
for (; ix < folioq_nr_slots(fq); ix++)
151-
folioq_clear(fq, ix);
152-
153149
return size;
154150
}
155151

0 commit comments

Comments
 (0)