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: <0032016d-78d1-8338-96af-3077d3219f47@arm.com>
Date:   Wed, 26 Jun 2019 17:58:43 +0200
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Rik van Riel <riel@...riel.com>, peterz@...radead.org
Cc:     mingo@...hat.com, linux-kernel@...r.kernel.org, kernel-team@...com,
        morten.rasmussen@....com, tglx@...utronix.de,
        dietmar.eggemann@....com, mgorman@...hsingularity.com,
        vincent.guittot@...aro.org
Subject: Re: [PATCH 5/8] sched,cfs: use explicit cfs_rq of parent se helper

On 6/12/19 9:32 PM, Rik van Riel wrote:
> Use an explicit "cfs_rq of parent sched_entity" helper in a few
> strategic places, where cfs_rq_of(se) may no longer point at the
> right runqueue once we flatten the hierarchical cgroup runqueues.
> 
> No functional change.
> 
> Signed-off-by: Rik van Riel <riel@...riel.com>
> ---
>  kernel/sched/fair.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index dcc521d251e3..c6ede2ecc935 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -275,6 +275,15 @@ static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
>  	return grp->my_q;
>  }
>  
> +/* runqueue owned by the parent entity */
> +static inline struct cfs_rq *group_cfs_rq_of_parent(struct sched_entity *se)
> +{
> +	if (se->parent)
> +		return group_cfs_rq(se->parent);
> +
> +	return &cfs_rq_of(se)->rq->cfs;

The function name and the description is not 100% correct. For tasks
running naturally (not in a flattened taskgroup) in the root taskgroup
or for the se representing a first level taskgroup (e.g. /tg1 (with
se->depth = 0)) it returns the root cfs_rq or easier se->cfs_rq.

So you could replace

    return &cfs_rq_of(se)->rq->cfs;

with

    return se->cfs_rq;

or

    return cfs_rq_of(se);

I guess a crucial point to understand is that you do need both,
cfs_rq_of(se) to access the flattened and group_cfs_rq_of_parent(se) to
access the hierarchical world.

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ