Re: [PATCH v2 1/2] drm/i915: set O_LARGEFILE in __create_shmem()

2025-09-10 Thread Taotao Chen
在 2025/8/22 11:06, 陈涛涛 Taotao Chen 写道: From: Taotao Chen Without O_LARGEFILE, file->f_op->write_iter calls generic_write_check_limits(), which enforces a 2GB (MAX_NON_LFS) limit, causing -EFBIG on large writes. In shmem_pwrite(), this error is later masked as -EIO due to the error ha

[PATCH v2 1/2] drm/i915: set O_LARGEFILE in __create_shmem()

2025-08-21 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Without O_LARGEFILE, file->f_op->write_iter calls generic_write_check_limits(), which enforces a 2GB (MAX_NON_LFS) limit, causing -EFBIG on large writes. In shmem_pwrite(), this error is later masked as -EIO due to the error handling order, leading to igt failure

[PATCH v2 2/2] drm/i915: Fix incorrect error handling in shmem_pwrite()

2025-08-21 Thread 陈涛涛 Taotao Chen
From: Taotao Chen shmem_pwrite() currently checks for short writes before negative error codes, which can overwrite real errors (e.g., -EFBIG) with -EIO. Reorder the checks to return negative errors first, then handle short writes. Signed-off-by: Taotao Chen Reviewed-by: Andi Shyti --- v2

[PATCH v6 3/5] fs: change write_begin/write_end interface to take struct kiocb *

2025-07-16 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Change the address_space_operations callbacks write_begin() and write_end() to take struct kiocb * as the first argument instead of struct file *. Update all affected function prototypes, implementations, call sites, and related documentation across VFS, filesystems, and block

[PATCH v6 5/5] ext4: support uncached buffered I/O

2025-07-16 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Set FOP_DONTCACHE in ext4_file_operations to declare support for uncached buffered I/O. To handle this flag, update ext4_write_begin() and ext4_da_write_begin() to use write_begin_get_folio(), which encapsulates FGP_DONTCACHE logic based on iocb->ki_flags. Part of a ser

[PATCH v6 2/5] drm/i915: Refactor shmem_pwrite() to use kiocb and write_iter

2025-07-16 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Refactors shmem_pwrite() to replace the ->write_begin/end logic with a write_iter-based implementation using kiocb and iov_iter. While kernel_write() was considered, it caused about 50% performance regression. vfs_write() is not exported for kernel use. Therefore, file-&g

[PATCH v6 1/5] drm/i915: Use kernel_write() in shmem object create

2025-07-16 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Replace the write_begin/write_end loop in i915_gem_object_create_shmem_from_data() with call to kernel_write(). This function initializes shmem-backed GEM objects. kernel_write() simplifies the code by removing manual folio handling. Part of a series refactoring

[PATCH v6 4/5] mm/pagemap: add write_begin_get_folio() helper function

2025-07-16 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Add write_begin_get_folio() to simplify the common folio lookup logic used by filesystem ->write_begin() implementations. This helper wraps __filemap_get_folio() with common flags such as FGP_WRITEBEGIN, conditional FGP_DONTCACHE, and set folio order based on the write len

[PATCH v6 0/5] fs: refactor write_begin/write_end and add ext4 IOCB_DONTCACHE support

2025-07-16 Thread 陈涛涛 Taotao Chen
From: Taotao Chen This patch series refactors the address_space_operations write_begin() and write_end() callbacks to take const struct kiocb * as their first argument, allowing IOCB flags such as IOCB_DONTCACHE to propagate to the filesystem's buffered I/O path. Ext4 is updated to impl

Re: [PATCH v5 0/5] fs: refactor write_begin/write_end and add ext4 IOCB_DONTCACHE support

2025-07-15 Thread Taotao Chen
在 2025/7/14 17:11, Christian Brauner 写道: On Thu, 10 Jul 2025 10:14:06 +, 陈涛涛 Taotao Chen wrote: From: Taotao Chen This patch series refactors the address_space_operations write_begin() and write_end() callbacks to take const struct kiocb * as their first argument, allowing IOCB flags

[PATCH v5 3/5] fs: change write_begin/write_end interface to take struct kiocb *

2025-07-10 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Change the address_space_operations callbacks write_begin() and write_end() to take struct kiocb * as the first argument instead of struct file *. Update all affected function prototypes, implementations, call sites, and related documentation across VFS, filesystems, and block

[PATCH v5 4/5] mm/pagemap: add write_begin_get_folio() helper function

2025-07-10 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Add write_begin_get_folio() to simplify the common folio lookup logic used by filesystem ->write_begin() implementations. This helper wraps __filemap_get_folio() with common flags such as FGP_WRITEBEGIN, conditional FGP_DONTCACHE, and set folio order based on the write len

[PATCH v5 2/5] drm/i915: Refactor shmem_pwrite() to use kiocb and write_iter

2025-07-10 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Refactors shmem_pwrite() to replace the ->write_begin/end logic with a write_iter-based implementation using kiocb and iov_iter. While kernel_write() was considered, it caused about 50% performance regression. vfs_write() is not exported for kernel use. Therefore, file-&g

[PATCH v5 0/5] fs: refactor write_begin/write_end and add ext4 IOCB_DONTCACHE support

2025-07-10 Thread 陈涛涛 Taotao Chen
From: Taotao Chen This patch series refactors the address_space_operations write_begin() and write_end() callbacks to take const struct kiocb * as their first argument, allowing IOCB flags such as IOCB_DONTCACHE to propagate to the filesystem's buffered I/O path. Ext4 is updated to impl

[PATCH v5 1/5] drm/i915: Use kernel_write() in shmem object create

2025-07-10 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Replace the write_begin/write_end loop in i915_gem_object_create_shmem_from_data() with call to kernel_write(). This function initializes shmem-backed GEM objects. kernel_write() simplifies the code by removing manual folio handling. Part of a series refactoring

[PATCH v5 5/5] ext4: support uncached buffered I/O

2025-07-10 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Set FOP_DONTCACHE in ext4_file_operations to declare support for uncached buffered I/O. To handle this flag, update ext4_write_begin() and ext4_da_write_begin() to use write_begin_get_folio(), which encapsulates FGP_DONTCACHE logic based on iocb->ki_flags. Part of a ser

Re: [PATCH v4 4/5] mm/filemap: add write_begin_get_folio() helper function

2025-07-07 Thread Taotao Chen
在 2025/7/7 22:54, Matthew Wilcox 写道: On Mon, Jul 07, 2025 at 07:00:33AM +, 陈涛涛 Taotao Chen wrote: +++ b/mm/filemap.c I think this should be a static inline function. I don't think it's worth moving out of line. Of course if you have measurements that show differently, you can

[PATCH v4 5/5] ext4: support uncached buffered I/O

2025-07-07 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Set FOP_DONTCACHE in ext4_file_operations to declare support for uncached buffered I/O. To handle this flag, update ext4_write_begin() and ext4_da_write_begin() to use write_begin_get_folio(), which encapsulates FGP_DONTCACHE logic based on iocb->ki_flags. Part of a ser

[PATCH v4 4/5] mm/filemap: add write_begin_get_folio() helper function

2025-07-07 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Add write_begin_get_folio() to simplify the common folio lookup logic used by filesystem ->write_begin() implementations. This helper wraps __filemap_get_folio() with common flags such as FGP_WRITEBEGIN, conditional FGP_DONTCACHE, and set folio order based on the write len

[PATCH v4 3/5] fs: change write_begin/write_end interface to take struct kiocb *

2025-07-07 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Change the address_space_operations callbacks write_begin() and write_end() to take struct kiocb * as the first argument instead of struct file *. Update all affected function prototypes, implementations, call sites, and related documentation across VFS, filesystems, and block

[PATCH v4 0/5] fs: refactor write_begin/write_end and add ext4 IOCB_DONTCACHE support

2025-07-07 Thread 陈涛涛 Taotao Chen
From: Taotao Chen This patch series refactors the address_space_operations write_begin() and write_end() callbacks to take const struct kiocb * as their first argument, allowing IOCB flags such as IOCB_DONTCACHE to propagate to the filesystem's buffered I/O path. Ext4 is updated to impl

[PATCH v4 1/5] drm/i915: Use kernel_write() in shmem object create

2025-07-07 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Replace the write_begin/write_end loop in i915_gem_object_create_shmem_from_data() with call to kernel_write(). This function initializes shmem-backed GEM objects. kernel_write() simplifies the code by removing manual folio handling. Part of a series refactoring

[PATCH v4 2/5] drm/i915: Refactor shmem_pwrite() to use kiocb and write_iter

2025-07-07 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Refactors shmem_pwrite() to replace the ->write_begin/end logic with a write_iter-based implementation using kiocb and iov_iter. While kernel_write() was considered, it caused about 50% performance regression. vfs_write() is not exported for kernel use. Therefore, file-&g

Re: [PATCH v3 3/4] fs: change write_begin/write_end interface to take struct kiocb *

2025-07-02 Thread Taotao Chen
在 2025/6/27 23:45, Matthew Wilcox 写道: On Fri, Jun 27, 2025 at 11:03:11AM +, 陈涛涛 Taotao Chen wrote: diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 841a5b18e3df..fdc2fa1e5c41 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -532,10 +532,12 @@ int exfat_file_fsync(struct file

Re: [PATCH v3 3/4] fs: change write_begin/write_end interface to take struct kiocb *

2025-07-02 Thread Taotao Chen
在 2025/6/27 23:52, Matthew Wilcox 写道: On Fri, Jun 27, 2025 at 11:03:11AM +, 陈涛涛 Taotao Chen wrote: @@ -1399,13 +1400,10 @@ static int write_end_fn(handle_t *handle, struct inode *inode, } /* - * We need to pick up the new inode size which generic_commit_write gave us - * `file

[PATCH v3 4/4] ext4: support uncached buffered I/O

2025-06-27 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Set FOP_DONTCACHE in ext4_file_operations to declare support for uncached buffered I/O. To handle this flag, add processing for IOCB_DONTCACHE in ext4_write_begin() and ext4_da_write_begin() by passing FGP_DONTCACHE to page cache lookups. Part of a series refactoring

[PATCH v3 2/4] drm/i915: Refactor shmem_pwrite() to use kiocb and write_iter

2025-06-27 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Refactors shmem_pwrite() to replace the ->write_begin/end logic with a write_iter-based implementation using kiocb and iov_iter. While kernel_write() was considered, it caused about 50% performance regression. vfs_write() is not exported for kernel use. Therefore, file-&g

[PATCH v3 3/4] fs: change write_begin/write_end interface to take struct kiocb *

2025-06-27 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Change the address_space_operations callbacks write_begin() and write_end() to take struct kiocb * as the first argument instead of struct file *. Update all affected function prototypes, implementations, call sites, and related documentation across VFS, filesystems, and block

[PATCH v3 1/4] drm/i915: Use kernel_write() in shmem object create

2025-06-27 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Replace the write_begin/write_end loop in i915_gem_object_create_shmem_from_data() with call to kernel_write(). This function initializes shmem-backed GEM objects. kernel_write() simplifies the code by removing manual folio handling. Part of a series refactoring

[PATCH v3 0/4] fs: refactor write_begin/write_end and add ext4 IOCB_DONTCACHE support

2025-06-27 Thread 陈涛涛 Taotao Chen
From: Taotao Chen This patch series refactors the address_space_operations write_begin() and write_end() callbacks to take const struct kiocb * as their first argument, allowing IOCB flags such as IOCB_DONTCACHE to propagate to the filesystem's buffered I/O path. Ext4 is updated to impl

[PATCH v2 2/5] drm/i915: Refactor shmem_pwrite() to use kiocb and write_iter

2025-06-25 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Refactors shmem_pwrite() to replace the ->write_begin/end logic with a write_iter-based implementation using kiocb and iov_iter. While kernel_write() was considered, it caused about 50% performance regression. vfs_write() is not exported for kernel use. Therefore, file-&g

[PATCH v2 3/5] fs: change write_begin/write_end interface to take struct kiocb *

2025-06-24 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Change the address_space_operations callbacks write_begin() and write_end() to take struct kiocb * as the first argument instead of struct file *. Update all affected function prototypes, implementations, call sites, and related documentation across VFS, filesystems, and block

[PATCH v2 5/5] ext4: declare support for FOP_DONTCACHE

2025-06-24 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Set the FOP_DONTCACHE flag in ext4_file_operations to indicate that ext4 supports IOCB_DONTCACHE handling in buffered write paths. Part of a series refactoring address_space_operations write_begin and write_end callbacks to use struct kiocb for passing write context and flags

[PATCH v2 1/5] drm/i915: Use kernel_write() in shmem object create

2025-06-24 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Replace the write_begin/write_end loop in i915_gem_object_create_shmem_from_data() with call to kernel_write(). This function initializes shmem-backed GEM objects. kernel_write() simplifies the code by removing manual folio handling. Part of a series refactoring

[PATCH v2 0/5] fs: refactor write_begin/write_end and add ext4 IOCB_DONTCACHE support

2025-06-24 Thread 陈涛涛 Taotao Chen
From: Taotao Chen This patch series refactors the address_space_operations write_begin() and write_end() callbacks to take struct kiocb * as their first argument, allowing IOCB flags such as IOCB_DONTCACHE to propagate to filesystem’s buffered write path. Ext4 is updated to implement handling

[PATCH v2 4/5] ext4: handle IOCB_DONTCACHE in buffered write path

2025-06-24 Thread 陈涛涛 Taotao Chen
From: Taotao Chen Add support for the IOCB_DONTCACHE flag in ext4_write_begin() and ext4_da_write_begin(). When set in the kiocb, the FGP_DONTCACHE bit is passed to the page cache lookup, preventing written pages from being retained in the cache. Only the handling logic is implemented here; the