[PATCH OLK-6.6] Revert "tmpfs: fault in smaller chunks if large folio allocation not allowed"

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IC5K6D -------------------------------- This reverts commit 7944c724e4b6bbc86dc7b8ce1f370584fc01fc1e. Use the upstream community solution to fix the problem: ede039b6e20f ("tmpfs: don't enable large folios if not supported") Fixes: ede039b6e20f ("tmpfs: don't enable large folios if not supported") Fixes: 7944c724e4b6 ("tmpfs: fault in smaller chunks if large folio allocation not allowed") Signed-off-by: Tong Tiangen <tongtiangen@huawei.com> --- include/linux/fs.h | 2 -- mm/filemap.c | 7 +------ mm/shmem.c | 5 ----- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 493c13cf7cd6..5e7aeb5ff463 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -373,8 +373,6 @@ enum rw_hint { #define IOCB_DIO_CALLER_COMP (1 << 22) /* kiocb is a read or write operation submitted by fs/aio.c. */ #define IOCB_AIO_RW (1 << 23) -/* fault int small chunks(PAGE_SIZE) from userspace */ -#define IOCB_NO_LARGE_CHUNK (1 << 24) /* for use in trace events */ #define TRACE_IOCB_STRINGS \ diff --git a/mm/filemap.c b/mm/filemap.c index 63b8ef7f31b1..905ebca8670e 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -4050,14 +4050,9 @@ ssize_t generic_perform_write(struct kiocb *iocb, struct iov_iter *i) loff_t pos = iocb->ki_pos; struct address_space *mapping = file->f_mapping; const struct address_space_operations *a_ops = mapping->a_ops; + size_t chunk = mapping_max_folio_size(mapping); long status = 0; ssize_t written = 0; - size_t chunk; - - if (iocb->ki_flags & IOCB_NO_LARGE_CHUNK) - chunk = PAGE_SIZE; - else - chunk = mapping_max_folio_size(mapping); do { struct page *page; diff --git a/mm/shmem.c b/mm/shmem.c index 6fdc7144ca91..aa50cd285ee9 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3269,7 +3269,6 @@ static ssize_t shmem_file_write_iter(struct kiocb *iocb, struct iov_iter *from) { struct file *file = iocb->ki_filp; struct inode *inode = file->f_mapping->host; - pgoff_t index = iocb->ki_pos >> PAGE_SHIFT; ssize_t ret; inode_lock(inode); @@ -3282,10 +3281,6 @@ static ssize_t shmem_file_write_iter(struct kiocb *iocb, struct iov_iter *from) ret = file_update_time(file); if (ret) goto unlock; - - if (!shmem_allowable_huge_orders(inode, NULL, index, 0, false)) - iocb->ki_flags |= IOCB_NO_LARGE_CHUNK; - ret = generic_perform_write(iocb, from); unlock: inode_unlock(inode); -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/16143 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/QWR... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/16143 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/QWR...
participants (2)
-
patchwork bot
-
Tong Tiangen