Skip to content

btrfs: convert kmaps to core page calls

[email protected] linux-fsdevel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 21 repliesIn review
  2. v14 patches 13 repliesSuperseded

Changes in v2 from the cover letter

Rework commit messages because they were very weak
Change 'fs/btrfs: X' to 'btrfs: x'
https://lore.kernel.org/lkml/[email protected]/
Per Andrew
Split out changes to highmem.h
The addition memcpy, memmove, and memset page functions The change from kmap_atomic to kmap_local_page The addition of BUG_ON
The conversion of memzero_page to zero_user in iov_iter
Change BUG_ON to VM_BUG_ON
While we are refactoring adjust the line length down per Chaitany

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8mm/highmem: Lift memcpy_[to|from]_page to coreinclude/linux/highmem.h lib/iov_iter.c+18 -142 replies
2/8mm/highmem: Convert memcpy_[to|from]_page() to kmap_local_page()include/linux/highmem.h+4 -42 replies
3/8mm/highmem: Introduce memcpy_page(), memmove_page(), and memset_page()include/linux/highmem.h+33 -02 replies
4/8mm/highmem: Add VM_BUG_ON() to mem*_page() callsinclude/linux/highmem.h+5 -010 replies
5/8iov_iter: Remove memzero_page() in favor of zero_user()lib/iov_iter.c+3 -91 reply
6/8btrfs: use memcpy_[to|from]_page() and kmap_local_page()fs/btrfs/compression.c fs/btrfs/lzo.c fs/btrfs/reflink.c +3 more+11 -231 reply
7/8btrfs: use copy_highpage() instead of 2 kmaps()fs/btrfs/raid56.c+1 -91 reply
8/8btrfs: convert to zero_user()fs/btrfs/compression.c fs/btrfs/extent_io.c fs/btrfs/inode.c +3 more+18 -581 reply

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchChaitanya KulkarniChristoph Hellwig
1/8R-b R-b
2/8R-b R-b
3/8R-b R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH V2 0/8] btrfs: convert kmaps to core page calls

From: Ira Weiny <[email protected]>

Changes from V1:
Rework commit messages because they were very weak
Change 'fs/btrfs: X' to 'btrfs: x'
https://lore.kernel.org/lkml/[email protected]/
Per Andrew
Split out changes to highmem.h
The addition memcpy, memmove, and memset page functions The change from kmap_atomic to kmap_local_page The addition of BUG_ON
The conversion of memzero_page to zero_user in iov_iter
Change BUG_ON to VM_BUG_ON
While we are refactoring adjust the line length down per Chaitany

There are many places where kmap/<operation>/kunmap patterns occur. We lift a couple of these patterns to the core common functions and use them as well as existing core functions in the btrfs file system. At the same time we convert those core functions to use kmap_local_page() which is more efficient in those calls.

Per the conversation on V1 it looks like Andrew would like this to go through the btrfs tree. I think that is fine. The other users of memcpy_[to|from]_page are probably not ready and I believe could be taken in an early rc after David submits.

Is that ok with you David?

Thanks,
Ira

Ira Weiny (8):
mm/highmem: Lift memcpy_[to|from]_page to core
mm/highmem: Convert memcpy_[to|from]_page() to kmap_local_page() mm/highmem: Introduce memcpy_page(), memmove_page(), and memset_page() mm/highmem: Add VM_BUG_ON() to mem*_page() calls
iov_iter: Remove memzero_page() in favor of zero_user()
btrfs: use memcpy_[to|from]_page() and kmap_local_page()
btrfs: use copy_highpage() instead of 2 kmaps()
btrfs: convert to zero_user()

 fs/btrfs/compression.c  | 11 +++-----
 fs/btrfs/extent_io.c    | 22 +++-------------
 fs/btrfs/inode.c        | 33 ++++++++----------------
 fs/btrfs/lzo.c          |  4 +--
 fs/btrfs/raid56.c       | 10 +-------
 fs/btrfs/reflink.c      | 12 ++-------
 fs/btrfs/send.c         |  7 ++----
 fs/btrfs/zlib.c         | 10 +++-----
 fs/btrfs/zstd.c         | 11 +++-----
 include/linux/highmem.h | 56 +++++++++++++++++++++++++++++++++++++++++
 lib/iov_iter.c          | 26 +++----------------
 11 files changed, 89 insertions(+), 113 deletions(-)
Signature · 1 line
2.28.0.rc0.12.gb6a658bd00c9