From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755530AbcHSUOE (ORCPT ); Fri, 19 Aug 2016 16:14:04 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36440 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753576AbcHSUOD (ORCPT ); Fri, 19 Aug 2016 16:14:03 -0400 From: Steve Muckle X-Google-Original-From: Steve Muckle Date: Fri, 19 Aug 2016 13:13:59 -0700 To: Dietmar Eggemann Cc: Steve Muckle , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J . Wysocki" , Vincent Guittot , Morten Rasmussen , Juri Lelli , Patrick Bellasi Subject: Re: [PATCH] sched: fix incorrect PELT values on SMT Message-ID: <20160819201359.GF11114@graphite.smuckle.net> References: <1471571741-19504-1-git-send-email-smuckle@linaro.org> <02391a39-b785-6056-49c4-c0ff34b3b780@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <02391a39-b785-6056-49c4-c0ff34b3b780@arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 19, 2016 at 04:00:57PM +0100, Dietmar Eggemann wrote: > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 61d485421bed..95d34b337152 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -2731,7 +2731,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa, > > sa->last_update_time = now; > > > > scale_freq = arch_scale_freq_capacity(NULL, cpu); > > - scale_cpu = arch_scale_cpu_capacity(NULL, cpu); > > + scale_cpu = arch_scale_cpu_capacity(cpu_rq(cpu)->sd, cpu); > > Wouldn't you have to subscribe to this rcu pointer rq->sd w/ something > like 'rcu_dereference(cpu_rq(cpu)->sd)'? > > IMHO, __update_load_avg() is called outside existing RCU read-side > critical sections as well so there would be a pair of > rcu_read_lock()/rcu_read_unlock() required in this case. Thanks Dietmar for the review. Yeah I didn't consider that this was protected with rcu. It looks like I'm abandoning this approach anyway though and doing something limited just to schedutil. thanks, Steve