On Mon, Dec 13, 2021 at 03:30:41AM +0000, Matthew Wilcox wrote: > > When working on the vmcore conversion to iov_iter, I noticed we had a > lot of places that construct a single kvec on the stack, and it seems a > little wasteful. Adding an ITER_KADDR type makes the iov_iter a little > easier to use. > > I included conversion of 9p to use ITER_KADDR so you can see whether you > think it's worth doing. I'd rather go for static inline void kvec_single_range(int rw, void *buf, size_t len, struct kvec *vec, struct iov_iter *i) { kvec->iov_base = buf; kvec->iov_len = len; iov_iter_kvec(i, rw, iov, 1, len); } to parallel the import_single_range(). You get more bloat in already convoluted (to put it very mildly) macros in iov_iter.c than you save on not declaring the local struct kvec variables in the users...