lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+oMND+7L7S9mByY@hirez.programming.kicks-ass.net>
Date:   Mon, 13 Feb 2023 11:08:52 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     JaeJoon Jung <rgbi3307@...il.com>
Cc:     Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [kernel/sched/core.c] Review and Modified of the prio_less()
 about sched class priority.

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..

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ