From: Michal Hocko <mhocko@suse.com>
To: Andrew Morton <akpm@linux-foundation.org>, gaoxu <gaoxu2@hihonor.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
yipengxiang <yipengxiang@hihonor.com>
Subject: Re: 回复: [PATCH] mm,oom_reaper: avoid run queue_oom_reaper if task is not oom
Date: Fri, 24 Nov 2023 10:30:44 +0100 [thread overview]
Message-ID: <ZWBtRGCXbz49UeXa@tiehlicka> (raw)
In-Reply-To: <242025e9a8c84f6b96ba3f180ea01be9@hihonor.com>
On Fri 24-11-23 03:15:46, gaoxu wrote:
[...]
> >> [3701:11_see]Unable to handle kernel NULL pointer dereference at
> >> virtual address 0000000000000328 [3701:11_see]user pgtable: 4k pages,
> >> 39-bit VAs, pgdp=00000000821de000 [3701:11_see][0000000000000328]
> >> pgd=0000000000000000,
> >> p4d=0000000000000000,pud=0000000000000000
> >> [3701:11_see]tracing off
> >> [3701:11_see]Internal error: Oops: 96000005 [#1] PREEMPT SMP
> >> [3701:11_see]Call trace:
> >> [3701:11_see] queue_oom_reaper+0x30/0x170
> >
> > Could you resolve this offset into the code line please?
> Due to the additional code we added for log purposes, the line numbers may not correspond to the original Linux code.
>
> static void queue_oom_reaper(struct task_struct *tsk)
> {
> /* mm is already queued? */
> if (test_and_set_bit(MMF_OOM_REAP_QUEUED, &tsk->signal->oom_mm->flags)) //a null pointer exception occurred
> return;
Did you manage to narrow it down to which of the dereference this
corresponds to? Is it tsk->signal == NULL or signal->oom_mm == NULL.
The faulting address doesn't match neither with my configs.
[...]
> >> --- a/mm/oom_kill.c
> >> +++ b/mm/oom_kill.c
> >> @@ -984,7 +984,7 @@ static void __oom_kill_process(struct task_struct *victim, const char *message)
> >> }
> >> rcu_read_unlock();
> >>
> >> - if (can_oom_reap)
> >> + if (can_oom_reap && tsk_is_oom_victim(victim))
> >> queue_oom_reaper(victim);
> >
> > I do not understand. We always do send SIGKILL and call mark_oom_victim(victim); on victim task when reaching out here. How can tsk_is_oom_victim can ever be false?
> This is a low-probability issue, as it only occurred once during the monkey testing.
> I haven't been able to find the root cause either.
OK, was there any non-standard code running during this test?
In any case I do not see how this patch could be correct. If, for some
reason we managed to release the signal structure or something else then
we need to understand whether this is a locking or reference counting
issue. I do not really see how this would be possible. But this check
right here doesn't really make sense.
Andrew please drop the patch from your tree.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2023-11-24 9:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 12:46 gaoxu
2023-11-22 21:47 ` Andrew Morton
2023-11-24 2:52 ` 回复: " gaoxu
2023-11-24 9:33 ` Michal Hocko
2023-11-23 8:51 ` Michal Hocko
2023-11-24 3:15 ` 回复: " gaoxu
2023-11-24 9:30 ` Michal Hocko [this message]
2023-11-25 6:46 ` 回复: " gaoxu
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=ZWBtRGCXbz49UeXa@tiehlicka \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=gaoxu2@hihonor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=surenb@google.com \
--cc=yipengxiang@hihonor.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