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.
Showing the changes to include/trace (1 of 6 files). Show all
Unified · Split
| @@ -886,65 +886,52 @@ TRACE_EVENT(afs_call_done, · 885 unmodified lines | ||
| 886 | 886 | __entry->rx_call) |
| 887 | 887 | ); |
| 888 | 888 | |
| 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), | |
| 892 | 891 | |
| 893 | − TP_ARGS(call, msg, first, last, offset), | |
| 892 | + TP_ARGS(call, msg), | |
| 894 | 893 | |
| 895 | 894 | TP_STRUCT__entry( |
| 896 | 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 | 896 | __field(unsigned int, flags ) |
| 897 | + __field(loff_t, offset ) | |
| 898 | + __field(loff_t, count ) | |
| 903 | 899 | ), |
| 904 | 900 | |
| 905 | 901 | TP_fast_assign( |
| 906 | 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 | 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", | |
| 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, | |
| 919 | 910 | __entry->flags) |
| 920 | 911 | ); |
| 921 | 912 | |
| 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), | |
| 925 | 915 | |
| 926 | − TP_ARGS(call, first, last, cursor, ret), | |
| 916 | + TP_ARGS(call, msg, ret), | |
| 927 | 917 | |
| 928 | 918 | TP_STRUCT__entry( |
| 929 | 919 | __field(unsigned int, call ) |
| 930 | − __field(pgoff_t, first ) | |
| 931 | − __field(pgoff_t, last ) | |
| 932 | − __field(pgoff_t, cursor ) | |
| 933 | 920 | __field(int, ret ) |
| 921 | + __field(loff_t, offset ) | |
| 922 | + __field(loff_t, count ) | |
| 934 | 923 | ), |
| 935 | 924 | |
| 936 | 925 | TP_fast_assign( |
| 937 | 926 | __entry->call = call->debug_id; |
| 938 | − __entry->first = first; | |
| 939 | − __entry->last = last; | |
| 940 | − __entry->cursor = cursor; | |
| 941 | 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", | |
| 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) | |
| 948 | 935 | ); |
| 949 | 936 | |
| 950 | 937 | TRACE_EVENT(afs_dir_check_failed, |