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
886 __entry->rx_call)886 __entry->rx_call)
887 );887 );
888 888
889TRACE_EVENT(afs_send_pages,889TRACE_EVENT(afs_send_data,
890 TP_PROTO(struct afs_call *call, struct msghdr *msg,890 TP_PROTO(struct afs_call *call, struct msghdr *msg),
891 pgoff_t first, pgoff_t last, unsigned int offset),
892 891
893 TP_ARGS(call, msg, first, last, offset),892 TP_ARGS(call, msg),
894 893
895 TP_STRUCT__entry(894 TP_STRUCT__entry(
896 __field(unsigned int, call )895 __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 )
902 __field(unsigned int, flags )896 __field(unsigned int, flags )
897 __field(loff_t, offset )
898 __field(loff_t, count )
903 ),899 ),
904 900
905 TP_fast_assign(901 TP_fast_assign(
906 __entry->call = call->debug_id;902 __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;
912 __entry->flags = msg->msg_flags;903 __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);
913 ),906 ),
914 907
915 TP_printk(" c=%08x %lx-%lx-%lx b=%x o=%x f=%x",908 TP_printk(" c=%08x o=%llx n=%llx f=%x",
916 __entry->call,909 __entry->call, __entry->offset, __entry->count,
917 __entry->first, __entry->first + __entry->nr - 1, __entry->last,
918 __entry->bytes, __entry->offset,
919 __entry->flags)910 __entry->flags)
920 );911 );
921 912
922TRACE_EVENT(afs_sent_pages,913TRACE_EVENT(afs_sent_data,
923 TP_PROTO(struct afs_call *call, pgoff_t first, pgoff_t last,914 TP_PROTO(struct afs_call *call, struct msghdr *msg, int ret),
924 pgoff_t cursor, int ret),
925 915
926 TP_ARGS(call, first, last, cursor, ret),916 TP_ARGS(call, msg, ret),
927 917
928 TP_STRUCT__entry(918 TP_STRUCT__entry(
929 __field(unsigned int, call )919 __field(unsigned int, call )
930 __field(pgoff_t, first )
931 __field(pgoff_t, last )
932 __field(pgoff_t, cursor )
933 __field(int, ret )920 __field(int, ret )
921 __field(loff_t, offset )
922 __field(loff_t, count )
934 ),923 ),
935 924
936 TP_fast_assign(925 TP_fast_assign(
937 __entry->call = call->debug_id;926 __entry->call = call->debug_id;
938 __entry->first = first;
939 __entry->last = last;
940 __entry->cursor = cursor;
941 __entry->ret = ret;927 __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);
942 ),930 ),
943 931
944 TP_printk(" c=%08x %lx-%lx c=%lx r=%d",932 TP_printk(" c=%08x o=%llx n=%llx r=%x",
945 __entry->call,933 __entry->call, __entry->offset, __entry->count,
946 __entry->first, __entry->last,934 __entry->ret)
947 __entry->cursor, __entry->ret)
948 );935 );
949 936
950TRACE_EVENT(afs_dir_check_failed,937TRACE_EVENT(afs_dir_check_failed,