All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] convert read_kcore(), vread() to use iterators
@ 2023-03-21 20:54 Lorenzo Stoakes
  2023-03-21 20:54 ` [PATCH v4 1/4] fs/proc/kcore: avoid bounce buffer for ktext data Lorenzo Stoakes
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Lorenzo Stoakes @ 2023-03-21 20:54 UTC (permalink / raw)
  To: linux-mm, linux-kernel, linux-fsdevel, Andrew Morton
  Cc: Baoquan He, Uladzislau Rezki, Matthew Wilcox, David Hildenbrand,
	Liu Shixin, Jiri Olsa, Jens Axboe, Alexander Viro,
	Lorenzo Stoakes

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%2FOHP3oD@casper.infradead.org/
[2] https://lore.kernel.org/all/87ilk6gos2.fsf@oracle.com/T/#u

v4:
- Fixup mistake in email client which orphaned patch emails from the
  cover letter.

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/cover.1679354384.git.lstoakes@gmail.com/

v2:
- Fix ordering of vread_iter() parameters
- Fix nommu vread() -> vread_iter()
https://lore.kernel.org/all/cover.1679209395.git.lstoakes@gmail.com/

v1:
https://lore.kernel.org/all/cover.1679183626.git.lstoakes@gmail.com/


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_atomic()
  mm: vmalloc: convert vread() to vread_iter()

 fs/proc/kcore.c         |  89 ++++++---------
 include/linux/uio.h     |   2 +
 include/linux/vmalloc.h |   3 +-
 lib/iov_iter.c          |  28 +++++
 mm/nommu.c              |  10 +-
 mm/vmalloc.c            | 234 +++++++++++++++++++++++++---------------
 6 files changed, 218 insertions(+), 148 deletions(-)

--
2.39.2

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-03-22 13:43 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 20:54 [PATCH v4 0/4] convert read_kcore(), vread() to use iterators Lorenzo Stoakes
2023-03-21 20:54 ` [PATCH v4 1/4] fs/proc/kcore: avoid bounce buffer for ktext data Lorenzo Stoakes
2023-03-21 20:54 ` [PATCH v4 2/4] fs/proc/kcore: convert read_kcore() to read_kcore_iter() Lorenzo Stoakes
2023-03-22  1:15   ` Baoquan He
2023-03-22  6:17     ` Lorenzo Stoakes
2023-03-22 11:12   ` David Hildenbrand
2023-03-21 20:54 ` [PATCH v4 3/4] iov_iter: add copy_page_to_iter_atomic() Lorenzo Stoakes
2023-03-22 10:17   ` Baoquan He
2023-03-22 10:32     ` Lorenzo Stoakes
2023-03-22 11:06       ` Lorenzo Stoakes
2023-03-22 13:21         ` Baoquan He
2023-03-22 13:08       ` Baoquan He
2023-03-21 20:54 ` [PATCH v4 4/4] mm: vmalloc: convert vread() to vread_iter() Lorenzo Stoakes
2023-03-22 11:18   ` David Hildenbrand
2023-03-22 11:31     ` Lorenzo Stoakes
2023-03-22 12:55   ` Baoquan He
2023-03-22 13:43     ` Lorenzo Stoakes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.