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: <20230422104205.GF1214746@hirez.programming.kicks-ass.net>
Date:   Sat, 22 Apr 2023 12:42:05 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     John Stultz <jstultz@...gle.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Joel Fernandes <joelaf@...gle.com>,
        Qais Yousef <qyousef@...gle.com>,
        Ingo Molnar <mingo@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Valentin Schneider <vschneid@...hat.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>,
        Zimuzo Ezeozue <zezeozue@...gle.com>,
        Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Will Deacon <will@...nel.org>,
        Waiman Long <longman@...hat.com>,
        Boqun Feng <boqun.feng@...il.com>,
        "Paul E . McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH v3 08/14] sched: Replace rq->curr access w/ rq_curr(rq)

On Tue, Apr 11, 2023 at 04:25:05AM +0000, John Stultz wrote:
> +static inline struct task_struct *rq_curr(struct rq *rq)
> +{
> +	return rq->curr_exec;
> +}
> +
> +static inline struct task_struct *rq_curr_rcu(struct rq *rq)
> +{
> +	return rcu_dereference(rq->curr_exec);
> +}
> +
> +static inline struct task_struct *rq_curr_once(struct rq *rq)
> +{
> +	return READ_ONCE(rq->curr_exec);
> +}
> +
> +static inline void rq_set_curr(struct rq *rq, struct task_struct *task)
> +{
> +	rcu_assign_pointer(rq->curr_exec, task);
> +}
> +
> +/*
> + *  XXX jstultz: seems like rcu_assign_pointer above would also
> + *               work for this, but trying to match usage.
> + */
> +static inline void rq_set_curr_rcu_init(struct rq *rq, struct task_struct *task)
> +{
> +	RCU_INIT_POINTER(rq->curr_exec, task);
> +}

> +static inline struct task_struct *rq_selected(struct rq *rq)
> +{
> +       return rq->curr_sched;
> +}
> +
> +static inline struct task_struct *rq_selected_rcu(struct rq *rq)
> +{
> +       return rcu_dereference(rq->curr_sched);
> +}
> +
> +static inline struct task_struct *rq_selected_once(struct rq *rq)
> +{
> +       return READ_ONCE(rq->curr_sched);
> +}
> +
> +static inline void rq_set_selected(struct rq *rq, struct task_struct *t)
> +{
> +       rcu_assign_pointer(rq->curr_sched, t);
> +}

How is any of that helping? That's just making it harder to read.

Can we please just keep it rq->curr and rq->proxy and stop this wrapper
fettish.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ