From: Matteo Croce <technoboy85@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: syzbot <syzbot+078be8bfa863cb9e0c6b@syzkaller.appspotmail.com>,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, syzkaller-bugs@googlegroups.com,
Kairui Song <ryncsn@gmail.com>,
Daan De Meyer <daan.j.demeyer@gmail.com>,
Luca Boccassi <luca.boccassi@gmail.com>
Subject: Re: [syzbot] [mm?] general protection fault in swap_reclaim_full_clusters
Date: Fri, 8 Nov 2024 23:11:46 +0100 [thread overview]
Message-ID: <CAFnufp3u9ytrCCN4vBqjn6SLGK_h+ue1tH1E_wRTw3s3ELf9ZA@mail.gmail.com> (raw)
In-Reply-To: <20241107142335.GB1172372@cmpxchg.org>
Il giorno ven 8 nov 2024 alle ore 18:35 Johannes Weiner
<hannes@cmpxchg.org> ha scritto:
> The syzbot console output indicates a virtual environment where
> swapfile is on a rotational device. In this case, clusters aren't
> actually used, and si->full_clusters is not initialized. Daan's report
> is from qemu, so likely rotational too.
>
> Make sure to only schedule the cluster reclaim work when clusters are
> actually in use.
>
> Link: https://lore.kernel.org/lkml/672ac50b.050a0220.2edce.1517.GAE@google.com/
> Link: https://github.com/systemd/systemd/issues/35044
> Fixes: 5168a68eb78f ("mm, swap: avoid over reclaim of full clusters")
> Reported-by: syzbot+078be8bfa863cb9e0c6b@syzkaller.appspotmail.com
> Reported-by: Daan De Meyer <daan.j.demeyer@gmail.com>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> ---
> mm/swapfile.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 46bd4b1a3c07..9c85bd46ab7f 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -929,7 +929,7 @@ static void swap_range_alloc(struct swap_info_struct *si, unsigned long offset,
> si->highest_bit = 0;
> del_from_avail_list(si);
>
> - if (vm_swap_full())
> + if (si->cluster_info && vm_swap_full())
> schedule_work(&si->reclaim_work);
> }
> }
> --
I've tested the patch and now the oomd test passes:
1/1 systemd:integration-tests / TEST-55-OOMD OK 63.48s
Tested-by: Matteo Croce <teknoraver@meta.com>
--
Matteo Croce
perl -e 'for($t=0;;$t++){print chr($t*($t>>8|$t>>13)&255)}' |aplay
next prev parent reply other threads:[~2024-11-08 22:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 1:23 syzbot
2024-11-07 14:23 ` Johannes Weiner
2024-11-08 22:11 ` Matteo Croce [this message]
2024-11-08 23:29 ` Hillf Danton
2024-11-08 23:51 ` syzbot
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=CAFnufp3u9ytrCCN4vBqjn6SLGK_h+ue1tH1E_wRTw3s3ELf9ZA@mail.gmail.com \
--to=technoboy85@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=daan.j.demeyer@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luca.boccassi@gmail.com \
--cc=ryncsn@gmail.com \
--cc=syzbot+078be8bfa863cb9e0c6b@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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