mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm/vmscan: remove redundant folio_test_swapbacked()
@ 2025-08-11 18:18 Jialin Wang
  2025-08-11 18:36 ` Jialin Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Jialin Wang @ 2025-08-11 18:18 UTC (permalink / raw)
  Cc: Jialin Wang, linux-kernel

When !folio_is_file_lru(folio) is false, it implies that
!folio_test_swapbacked(folio) must be true. Therefore, the additional
check for !folio_test_swapbacked(folio) is redundant and can be safely
removed.

This cleanup simplifies the code without changing any functionality.

Signed-off-by: Jialin Wang <wjl.linux@gmail.com>
---
 mm/vmscan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 7de11524a936..9d4745ad5e23 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -985,8 +985,7 @@ static void folio_check_dirty_writeback(struct folio *folio,
 	 * They could be mistakenly treated as file lru. So further anon
 	 * test is needed.
 	 */
-	if (!folio_is_file_lru(folio) ||
-	    (folio_test_anon(folio) && !folio_test_swapbacked(folio))) {
+	if (!folio_is_file_lru(folio) || folio_test_anon(folio)) {
 		*dirty = false;
 		*writeback = false;
 		return;
-- 
2.50.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/vmscan: remove redundant folio_test_swapbacked()
  2025-08-11 18:18 [PATCH] mm/vmscan: remove redundant folio_test_swapbacked() Jialin Wang
@ 2025-08-11 18:36 ` Jialin Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Jialin Wang @ 2025-08-11 18:36 UTC (permalink / raw)
  Cc: linux-kernel

On Tue, Aug 12, 2025 at 2:18 AM Jialin Wang <wjl.linux@gmail.com> wrote:
>
> When !folio_is_file_lru(folio) is false, it implies that
> !folio_test_swapbacked(folio) must be true. Therefore, the additional
> check for !folio_test_swapbacked(folio) is redundant and can be safely
> removed.
>
> This cleanup simplifies the code without changing any functionality.
>
> Signed-off-by: Jialin Wang <wjl.linux@gmail.com>
> ---
>  mm/vmscan.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 7de11524a936..9d4745ad5e23 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -985,8 +985,7 @@ static void folio_check_dirty_writeback(struct folio *folio,
>          * They could be mistakenly treated as file lru. So further anon
>          * test is needed.
>          */
> -       if (!folio_is_file_lru(folio) ||
> -           (folio_test_anon(folio) && !folio_test_swapbacked(folio))) {
> +       if (!folio_is_file_lru(folio) || folio_test_anon(folio)) {
>                 *dirty = false;
>                 *writeback = false;
>                 return;
> --
> 2.50.0
>

My apologies for sending this patch to the wrong mailing list and
missing proper cc's. Please disregard this patch as I've now
resent it correctly.

  https://lore.kernel.org/linux-mm/20250811182500.42670-1-wjl.linux@gmail.com/

Thank you for your understanding, and sorry for the noise.

Best regards,
Jialin Wang

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-11 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-11 18:18 [PATCH] mm/vmscan: remove redundant folio_test_swapbacked() Jialin Wang
2025-08-11 18:36 ` Jialin Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®