From: Peter Zijlstra <peterz@infradead.org>
To: JaeJoon Jung <rgbi3307@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [kernel/sched/core.c] Review and Modified of the prio_less() about sched class priority.
Date: Mon, 13 Feb 2023 11:08:52 +0100 [thread overview]
Message-ID: <Y+oMND+7L7S9mByY@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAHOvCC5Tde6aTtcAeHig1eoAp_9FZGTd4XtFGbmrhy-NoV7zDA@mail.gmail.com>
On Mon, Feb 13, 2023 at 10:11:04AM +0900, JaeJoon Jung wrote:
> The sched_class structure is defined to be sorted by pointer size.
> @@ -176,22 +161,18 @@ static inline int __task_prio(struct task_struct *p)
> /* real prio, less is less */
> static inline bool prio_less(struct task_struct *a, struct
> task_struct *b, bool in_fi)
> {
> + int less = a->sched_class - b->sched_class;
>
> + if (less == 0) {
> + if (a->sched_class == &dl_sched_class)
> + return !dl_time_before(a->dl.deadline, b->dl.deadline);
>
> + else if (a->sched_class == &fair_sched_class)
> + return cfs_prio_less(a, b, in_fi);
> + else
> + return false;
> + } else
> + return (less > 0) ? true : false;
> }
>
> If the prio_less() function is modified as above, the __task_prio()
> function is not required.
Yeah, except your patch is whitespace mangled..
next prev parent reply other threads:[~2023-02-13 10:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-13 1:11 JaeJoon Jung
2023-02-13 10:08 ` Peter Zijlstra [this message]
2023-02-13 23:44 ` JaeJoon Jung
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=Y+oMND+7L7S9mByY@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rgbi3307@gmail.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®