From: Adam Li <adamli@os.amperecomputing.com>
To: 20241125021222.356881-2-adamli@os.amperecomputing.com,
peterz@infradead.org, mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org,
Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Cc: dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
linux-kernel@vger.kernel.org, patches@amperecomputing.com,
cl@linux.com, Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Subject: Re: [PATCH 1/2] sched/fair: Fix panic if NEXT_BUDDY enabled
Date: Wed, 27 Nov 2024 15:26:16 +0800 [thread overview]
Message-ID: <a2b41bc9-72f5-40f1-ac44-d2c495fb3dd4@os.amperecomputing.com> (raw)
In-Reply-To: <70dfefef-aaa3-43be-9f8a-85adc07942fc@linux.ibm.com>
On 11/25/2024 6:16 PM, Madadi Vineeth Reddy wrote:
> On 25/11/24 07:42, Adam Li wrote:
>> Enabling NEXT_BUDDY may trigger warning and kernel panic:
>
> IIUC, this happens due to a race condition between choosing the next_buddy and
> dequeuing the task from the runqueue as soon as its lag becomes zero, thereby causing
> task_of(se) to result in a null dereference in pick_task_fair?
>
> Correct me if I am wrong.
>
pick_eevdf() may return NULL, which triggers this NULL pointer dereference
at pick_next_entity():
struct sched_entity *se = pick_eevdf(cfs_rq);
if (se->sched_delayed)
Enabling NEXT_BUDDY is more likely to trigger this panic.
I added another patch to check return value of pick_eevdf() in v2:
https://lore.kernel.org/all/20241127055610.7076-1-adamli@os.amperecomputing.com/
Thanks for review.
-adam
next prev parent reply other threads:[~2024-11-27 7:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 2:12 [PATCH 0/2] sched/fair: Fix NEXT_BUDDY panic and clean up comments Adam Li
2024-11-25 2:12 ` [PATCH 1/2] sched/fair: Fix panic if NEXT_BUDDY enabled Adam Li
2024-11-25 10:14 ` Christian Loehle
2024-11-25 10:16 ` Madadi Vineeth Reddy
2024-11-27 7:26 ` Adam Li [this message]
2024-11-25 2:12 ` [PATCH 2/2] sched/fair: Update comments regarding last and skip buddy Adam Li
2024-11-25 10:00 ` Madadi Vineeth Reddy
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=a2b41bc9-72f5-40f1-ac44-d2c495fb3dd4@os.amperecomputing.com \
--to=adamli@os.amperecomputing.com \
--cc=20241125021222.356881-2-adamli@os.amperecomputing.com \
--cc=bsegall@google.com \
--cc=cl@linux.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=patches@amperecomputing.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vineethr@linux.ibm.com \
--cc=vschneid@redhat.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
all inboxes | Powered by JetHome®