The patch titled Subject: mm-shmem-fallback-to-page-size-splice-if-large-folio-has-poisoned-pages-fix has been added to the -mm mm-unstable branch. Its filename is mm-shmem-fallback-to-page-size-splice-if-large-folio-has-poisoned-pages-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-shmem-fallback-to-page-size-splice-if-large-folio-has-poisoned-pages-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> Subject: mm-shmem-fallback-to-page-size-splice-if-large-folio-has-poisoned-pages-fix Date: Fri, 1 Nov 2024 09:56:29 +0800 code layout cleaup, per dhowells Link: https://lkml.kernel.org/r/32dd938c-3531-49f7-93e4-b7ff21fec569@xxxxxxxxxxxxxxxxx Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx> Suggested-by: David Howells <dhowells@xxxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Yang Shi <shy828301@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/shmem.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/mm/shmem.c~mm-shmem-fallback-to-page-size-splice-if-large-folio-has-poisoned-pages-fix +++ a/mm/shmem.c @@ -3332,12 +3332,11 @@ static ssize_t shmem_file_splice_read(st * Fallback to PAGE_SIZE splice if the large folio has hwpoisoned * pages. */ - if (likely(!fallback_page_splice)) { - size = len; - } else { + size = len; + if (unlikely(fallback_page_splice)) { size_t offset = *ppos & ~PAGE_MASK; - size = min_t(loff_t, PAGE_SIZE - offset, len); + size = umin(size, PAGE_SIZE - offset); } part = min_t(loff_t, isize - *ppos, size); _ Patches currently in -mm which might be from baolin.wang@xxxxxxxxxxxxxxxxx are mm-shmem-fix-khugepaged-activation-policy-for-shmem.patch mm-shmem-update-iocb-ki_pos-directly-to-simplify-tmpfs-read-logic.patch mm-shmem-improve-the-tmpfs-large-folio-read-performance.patch mm-shmem-fallback-to-page-size-splice-if-large-folio-has-poisoned-pages.patch mm-shmem-fallback-to-page-size-splice-if-large-folio-has-poisoned-pages-fix.patch