]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'vfs-6.9.rw_hint' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs
authorChristian Brauner <brauner@kernel.org>
Mon, 4 Mar 2024 17:35:21 +0000 (18:35 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 4 Mar 2024 17:35:21 +0000 (18:35 +0100)
Pull write hint fix from Christian Brauner:

UFS devices are widely used in mobile applications, e.g. in smartphones.
UFS vendors need data lifetime information to achieve good performance.
Providing data lifetime information to UFS devices can result in up to
40% lower write amplification. Hence this patch series that restores the
bi_write_hint member in struct bio. After this patch series has been
merged, patches that implement data lifetime support in the SCSI disk
(sd) driver will be sent to the Linux kernel SCSI maintainer.

The following changes are included in this patch series:

- Improvements for the F_GET_RW_HINT and F_SET_RW_HINT fcntls.
- Move enum rw_hint into a new header file.
- Support F_SET_RW_HINT for block devices to make it easy to test data
  lifetime support.
- Restore the bio.bi_write_hint member and restore support in the VFS
  layer and also in the block layer for data lifetime information.

The shell script that has been used to test the patch series combined
with the SCSI patches is available at the end of this cover letter.

* tag 'vfs-6.9.rw_hint' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs:
  block, fs: Restore the per-bio/request data lifetime fields
  fs: Propagate write hints to the struct block_device inode
  fs: Move enum rw_hint into a new header file
  fs: Split fcntl_rw_hint()
  fs: Verify write lifetime constants at compile time
  fs: Fix rw_hint validation

Signed-off-by: Christian Brauner <brauner@kernel.org>
1  2 
block/fops.c
fs/iomap/buffered-io.c

diff --cc block/fops.c
Simple merge
index ae4e2026e59e1893f660ee45f0c973ac549a0568,18e1fef53fbc5c75569634946b17aee42f38f4a5..4e8e41c8b3c0e41c97ed544bfafbef4113f4fbd5
@@@ -1687,11 -1666,11 +1687,12 @@@ static struct iomap_ioend *iomap_alloc_
        bio = bio_alloc_bioset(wpc->iomap.bdev, BIO_MAX_VECS,
                               REQ_OP_WRITE | wbc_to_write_flags(wbc),
                               GFP_NOFS, &iomap_ioend_bioset);
 -      bio->bi_iter.bi_sector = sector;
 -      bio->bi_write_hint = inode->i_write_hint;
 +      bio->bi_iter.bi_sector = iomap_sector(&wpc->iomap, pos);
 +      bio->bi_end_io = iomap_writepage_end_bio;
        wbc_init_bio(wbc, bio);
++      bio->bi_write_hint = inode->i_write_hint;
  
 -      ioend = container_of(bio, struct iomap_ioend, io_inline_bio);
 +      ioend = iomap_ioend_from_bio(bio);
        INIT_LIST_HEAD(&ioend->io_list);
        ioend->io_type = wpc->iomap.type;
        ioend->io_flags = wpc->iomap.flags;