mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	io_uring/rsrc: optimise single entry advance
Iterating within the first bvec entry should be essentially free, but we use iov_iter_advance() for that, which shows up in benchmark profiles taking up to 0.5% of CPU. Replace it with a hand coded version. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
		
							parent
							
								
									edd4782696
								
							
						
					
					
						commit
						b000ae0ec2
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -1364,7 +1364,10 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
 | 
				
			||||||
		const struct bio_vec *bvec = imu->bvec;
 | 
							const struct bio_vec *bvec = imu->bvec;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (offset <= bvec->bv_len) {
 | 
							if (offset <= bvec->bv_len) {
 | 
				
			||||||
			iov_iter_advance(iter, offset);
 | 
								iter->bvec = bvec;
 | 
				
			||||||
 | 
								iter->nr_segs = bvec->bv_len;
 | 
				
			||||||
 | 
								iter->count -= offset;
 | 
				
			||||||
 | 
								iter->iov_offset = offset;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			unsigned long seg_skip;
 | 
								unsigned long seg_skip;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue