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: <xm26iohb79v5.fsf@sword-of-the-dawn.mtv.corp.google.com>
Date:	Tue, 16 Dec 2014 10:00:46 -0800
From:	bsegall@...gle.com
To:	Kirill Tkhai <ktkhai@...allels.com>
Cc:	<linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>, Kirill Tkhai <tkhai@...dex.ru>
Subject: Re: [PATCH] sched/fair: Make cfs_rq::decay_counter non-atomic

Kirill Tkhai <ktkhai@...allels.com> writes:

> We update decay_counter in update_cfs_rq_blocked_load()
> only. This function is always called with rq lock locked,
> so we can kill atomic actions.
>
> Signed-off-by: Kirill Tkhai <ktkhai@...allels.com>
> ---
>  kernel/sched/fair.c  |   11 ++++++-----
>  kernel/sched/sched.h |    2 +-
>  2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 5f3b5a7..af990c4 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -2570,7 +2570,7 @@ static __always_inline int __update_entity_runnable_avg(u64 now,
>  static inline u64 __synchronize_entity_decay(struct sched_entity *se)
>  {
>  	struct cfs_rq *cfs_rq = cfs_rq_of(se);
> -	u64 decays = atomic64_read(&cfs_rq->decay_counter);
> +	u64 decays = ACCESS_ONCE(cfs_rq->decay_counter);

This is called without rq lock held from migrate_task_rq_fair. (We could
technically change the atomic_add to atomic64_set(atomic64_read() + x),
but I don't know that that is a win) Now, we could do a
min_vruntime-style two-copy thing if this atomic usage is a hot spot on
32-bit, we just didn't bother initially.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ