Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: sashiko-reviews@lists.linux.dev,
	Qiliang Yuan <qiliang.yuan@linux.dev>,
	Hugh Dickins <hughd@google.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, Qiliang Yuan <odys.yuan@gmail.com>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	"Lorenzo Stoakes (Arm)" <ljs@kernel.org>
Cc: linux-mm@kvack.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] mm/shmem: drop the second folio batch from shmem_undo_range()
Date: Fri, 13 Nov 2026 10:46:31 +0100	[thread overview]
Message-ID: <a78bd75b-dc4c-4007-b855-f1e58d2a435e@kernel.org> (raw)
In-Reply-To: <sashiko-outbox-212134@kernel.org>

On 11/13/26 04:39, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found no new issues
> in this patch, but noticed 1 related pre-existing issue it does not
> introduce:
> - [Critical] mm/shmem: skipped boundary zeroing on swapin failure in
>   shmem_undo_range() [1]
> --
> 
> commit 785bd3384006f8bb06c3c8f9b1b5d455eba3d449
> Author: Qiliang Yuan <qiliang.yuan@linux.dev>
> 
> mm/shmem: drop the second folio batch from shmem_undo_range()
> 
> This commit removes the second folio_batch from shmem_undo_range() by
> passing fbatch directly to delete_from_page_cache_batch() after removing
> swap entries, and using truncate_inode_folio() when undoing a failed
> fallocate().
> 
>> diff --git a/mm/shmem.c b/mm/shmem.c
>> index 156469423a866..5bcbdd6078a73 100644
>> --- a/mm/shmem.c
>> +++ b/mm/shmem.c
>> @@ -1352,9 +1352,6 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
>>  	index = start;
>>  	while (index < end && find_lock_entries(mapping, &index, end - 1,
>>  			&fbatch, indices)) {
>> -		struct folio_batch remove;
>> -
>> -		folio_batch_init(&remove);
>>  		for (i = 0; i < folio_batch_count(&fbatch); i++) {
>>  			folio = fbatch.folios[i];
>>  
>> @@ -1366,13 +1363,14 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, uoff_t lend,
>>  				continue;
>>  			}
>>  
>> -			if (!unfalloc || !folio_test_uptodate(folio)) {
>> +			if (!unfalloc)
>>  				truncate_cleanup_folio(folio);
>> -				folio_batch_add(&remove, folio);
>> -			}
>> +			else if (!folio_test_uptodate(folio))
>> +				truncate_inode_folio(mapping, folio);
>>  		}
>> -		delete_from_page_cache_batch(mapping, &remove);
>>  		folio_batch_remove_exceptionals(&fbatch);
>> +		if (!unfalloc)
>> +			delete_from_page_cache_batch(mapping, &fbatch);
>>  		for (i = 0; i < folio_batch_count(&fbatch); i++)
>>  			folio_unlock(fbatch.folios[i]);
>>  		folio_batch_release(&fbatch);
> 
> [Severity: Critical]
> This problem wasn't introduced by this patch, but can shmem_undo_range()
> leave partial boundary ranges unzeroed when swapping in a boundary folio
> fails [1]?

Roman, why is Sashiko back with these preexisting things that keep distracting
people in unreasonable ways?

Turn that feature off for MM please. Let all preexisting stuff go to the
maintainer-accessible, where we will work through them in a controlled way.

The least we need right now is getting bombarded with more of these things.

-- 
Cheers,

David


      parent reply	other threads:[~2026-11-13  9:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  3:39 [PATCH] mm/shmem: drop the second folio batch from shmem_undo_range() Qiliang Yuan
2026-11-12  8:05 ` Baolin Wang
2026-11-12  8:33   ` David Hildenbrand (Arm)
2026-11-12  9:11     ` Qiliang Yuan
2026-11-13  3:39 ` sashiko-bot
2026-11-13  5:39   ` Baolin Wang
2026-11-13  9:46   ` David Hildenbrand (Arm) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a78bd75b-dc4c-4007-b855-f1e58d2a435e@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=lkp@intel.com \
    --cc=odys.yuan@gmail.com \
    --cc=qiliang.yuan@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox