History

afs: Use ITER_XARRAY for writing

Use a single ITER_XARRAY iterator to describe the portion of a file to be transmitted to the server rather than generating a series of small ITER_BVEC iterators on the fly. This will make it easier to implement AIO in afs. In theory we could maybe use one giant ITER_BVEC, but that means potentially allocating a huge array of bio_vec structs (max 256 per page) when in fact the pagecache already has a structure listing all the relevant pages (radix_tree/xarray) that can be walked over.

David Howells committed 6 years ago

Commit bd80d8a1 parent c4508466 files · +126 −218Browse files

Showing the changes to include/trace (1 of 6 files). Show all

Unified · Split

include/trace/events/afs.h+19−32
@@ -886,65 +886,52 @@ TRACE_EVENT(afs_call_done, · 885 unmodified lines
886886 __entry->rx_call)
887887 );
888888
889−TRACE_EVENT(afs_send_pages,
890− TP_PROTO(struct afs_call *call, struct msghdr *msg,
891− pgoff_t first, pgoff_t last, unsigned int offset),
889+TRACE_EVENT(afs_send_data,
890+ TP_PROTO(struct afs_call *call, struct msghdr *msg),
892891
893− TP_ARGS(call, msg, first, last, offset),
892+ TP_ARGS(call, msg),
894893
895894 TP_STRUCT__entry(
896895 __field(unsigned int, call )
897− __field(pgoff_t, first )
898− __field(pgoff_t, last )
899− __field(unsigned int, nr )
900− __field(unsigned int, bytes )
901− __field(unsigned int, offset )
902896 __field(unsigned int, flags )
897+ __field(loff_t, offset )
898+ __field(loff_t, count )
903899 ),
904900
905901 TP_fast_assign(
906902 __entry->call = call->debug_id;
907− __entry->first = first;
908− __entry->last = last;
909− __entry->nr = msg->msg_iter.nr_segs;
910− __entry->bytes = msg->msg_iter.count;
911− __entry->offset = offset;
912903 __entry->flags = msg->msg_flags;
904+ __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
905+ __entry->count = iov_iter_count(&msg->msg_iter);
913906 ),
914907
915− TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x",
916− __entry->call,
917− __entry->first, __entry->first + __entry->nr - 1, __entry->last,
918− __entry->bytes, __entry->offset,
908+ TP_printk(" c=%08x o=%llx n=%llx f=%x",
909+ __entry->call, __entry->offset, __entry->count,
919910 __entry->flags)
920911 );
921912
922−TRACE_EVENT(afs_sent_pages,
923− TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last,
924− pgoff_t cursor, int ret),
913+TRACE_EVENT(afs_sent_data,
914+ TP_PROTO(struct afs_call *call, struct msghdr *msg, int ret),
925915
926− TP_ARGS(call, first, last, cursor, ret),
916+ TP_ARGS(call, msg, ret),
927917
928918 TP_STRUCT__entry(
929919 __field(unsigned int, call )
930− __field(pgoff_t, first )
931− __field(pgoff_t, last )
932− __field(pgoff_t, cursor )
933920 __field(int, ret )
921+ __field(loff_t, offset )
922+ __field(loff_t, count )
934923 ),
935924
936925 TP_fast_assign(
937926 __entry->call = call->debug_id;
938− __entry->first = first;
939− __entry->last = last;
940− __entry->cursor = cursor;
941927 __entry->ret = ret;
928+ __entry->offset = msg->msg_iter.xarray_start + msg->msg_iter.iov_offset;
929+ __entry->count = iov_iter_count(&msg->msg_iter);
942930 ),
943931
944− TP_printk(" c=%08x %lx-%lx c=%lx r=%d",
945− __entry->call,
946− __entry->first, __entry->last,
947− __entry->cursor, __entry->ret)
932+ TP_printk(" c=%08x o=%llx n=%llx r=%x",
933+ __entry->call, __entry->offset, __entry->count,
934+ __entry->ret)
948935 );
949936
950937 TRACE_EVENT(afs_dir_check_failed,