convert read_kcore(), vread() to use iterators
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v8 Latest4 patches 16 repliesIn review 1 of 4 applied
- v74 patches 7 repliesSuperseded 3 of 4 applied
- v64 patches 2 repliesSuperseded
Earlier versions · 6
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v5 | 4 patches | 0 replies | Superseded | |
| v4 | 4 patches | 12 replies | Superseded | |
| v3 posting 2/2 | 4 patches | 0 replies | Superseded | |
| v3 posting 1/2 | 0 of 4 patches | 0 replies | Superseded | |
| v2 | 4 patches | 28 replies | Superseded | |
| v1 | 4 patches | 6 replies | Superseded |
Changes in v8 from the cover letter
- Make zero_iter() static.
Patches in v8 1 of 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | fs/proc/kcore: avoid bounce buffer for ktext datafs/ | +5 | 15 replies | |
| 2/4 | fs/proc/kcore: convert read_kcore() to read_kcore_iter()fs/ | +18 | 0 replies | |
| 3/4 | iov_iter: add copy_page_to_iter_nofault()include/ lib/ | +50 | 0 replies | |
| 4/4 | mm: vmalloc: convert vread() to vread_iter()fs/ include/ mm/ +1 more | +176 | 0 replies | Applied |
Reviews trailers per patch
2 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | David Hildenbrand | Baoquan He |
|---|---|---|
| Series | R-b | |
| 1/4 | R-b | |
| 2/4 | R-b | |
| 3/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v8 0/4] convert read_kcore(), vread() to use iterators
While reviewing Baoquan's recent changes to permit vread() access to vm_map_ram regions of vmalloc allocations, Willy pointed out [1] that it would be nice to refactor vread() as a whole, since its only user is read_kcore() and the existing form of vread() necessitates the use of a bounce buffer.
This patch series does exactly that, as well as adjusting how we read the kernel text section to avoid the use of a bounce buffer in this case as well.
This has been tested against the test case which motivated Baoquan's changes in the first place [2] which continues to function correctly, as do the vmalloc self tests.
[1] https://lore.kernel.org/all/Y8WfDSRkc%[email protected]/
[2] https://lore.kernel.org/all/[email protected]/T/#u
v8:
- Make zero_iter() static.
v7:
- Keep trying to fault in memory until the vmalloc read operation completes.
https://lore.kernel.org/all/[email protected]/
v6:
- Correct copy_page_to_iter_nofault() to handle -EFAULT case correctly.
https://lore.kernel.org/all/[email protected]/
v5:
- Do not rename fpos to ppos in read_kcore_iter() to avoid churn.
- Fix incorrect commit messages after prior revisions altered the approach.
- Replace copy_page_to_iter_atomic() with copy_page_to_iter_nofault() and adjust it to be able to handle compound pages. This uses copy_to_user_nofault() which ensures page faults are disabled during copy which kmap_local_page() was not doing.
- Only try to fault in pages if we are unable to copy in the first place and try only once to avoid any risk of spinning.
- Do not zero memory in aligned_vread_iter() if we couldn't copy it.
- Fix mistake in zeroing missing or unpopulated blocks in vmap_ram_vread_iter().
https://lore.kernel.org/linux-mm/[email protected]/
v4:
- Fixup mistake in email client which orphaned patch emails from the cover letter.
https://lore.kernel.org/all/[email protected]
v3:
- Revert introduction of mutex/rwsem in vmalloc
- Introduce copy_page_to_iter_atomic() iovec function
- Update vread_iter() and descendent functions to use only this
- Fault in user pages before calling vread_iter()
- Use const char* in vread_iter() and descendent functions
- Updated commit messages based on feedback
- Extend vread functions to always check how many bytes we could copy. If at any stage we are unable to copy/zero, abort and return the number of bytes we did copy.
https://lore.kernel.org/all/[email protected]/
v2:
- Fix ordering of vread_iter() parameters
- Fix nommu vread() -> vread_iter()
https://lore.kernel.org/all/[email protected]/
v1:
https://lore.kernel.org/all/[email protected]/
Lorenzo Stoakes (4):
fs/proc/kcore: avoid bounce buffer for ktext data fs/proc/kcore: convert read_kcore() to read_kcore_iter()
iov_iter: add copy_page_to_iter_nofault()
mm: vmalloc: convert vread() to vread_iter()
fs/proc/kcore.c | 85 +++++++-------- include/linux/uio.h | 2 + include/linux/vmalloc.h | 3 +- lib/iov_iter.c | 48 +++++++++ mm/nommu.c | 10 +- mm/vmalloc.c | 234 +++++++++++++++++++++++++--------------- 6 files changed, 243 insertions(+), 139 deletions(-)
--
2.39.2