mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Matt Fleming <matt@codeblueprint.co.uk>
Cc: kernel test robot <xiaolong.ye@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Mike Galbraith <umgwanakikbuti@gmail.com>,
	lkp@01.org
Subject: Re: [lkp-robot] [sched/fair] fbd5188493: WARNING:inconsistent_lock_state
Date: Thu, 5 Jul 2018 16:59:02 +0200	[thread overview]
Message-ID: <42d319f5-1a3a-fb69-5ec5-d2e9836e49c9@arm.com> (raw)
In-Reply-To: <20180705132458.GA3864@codeblueprint.co.uk>

On 07/05/2018 03:24 PM, Matt Fleming wrote:
> On Thu, 05 Jul, at 11:52:21AM, Dietmar Eggemann wrote:
>>
>> Moving the code from _nohz_idle_balance to nohz_idle_balance let it disappear:
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 02be51c9dcc1..070924f07c68 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -9596,16 +9596,6 @@ static bool _nohz_idle_balance(struct rq *this_rq, unsigned int flags,
>>           */
>>          smp_mb();
>>   
>> -       /*
>> -        * Ensure this_rq's clock and load are up-to-date before we
>> -        * rebalance since it's possible that they haven't been
>> -        * updated for multiple schedule periods, i.e. many seconds.
>> -        */
>> -       raw_spin_lock_irq(&this_rq->lock);
>> -       update_rq_clock(this_rq);
>> -       cpu_load_update_idle(this_rq);
>> -       raw_spin_unlock_irq(&this_rq->lock);
>> -
>>          for_each_cpu(balance_cpu, nohz.idle_cpus_mask) {
>>                  if (balance_cpu == this_cpu || !idle_cpu(balance_cpu))
>>                          continue;
>> @@ -9701,6 +9691,16 @@ static bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle)
>>          if (!(flags & NOHZ_KICK_MASK))
>>                  return false;
>>   
>> +       /*
>> +        * Ensure this_rq's clock and load are up-to-date before we
>> +        * rebalance since it's possible that they haven't been
>> +        * updated for multiple schedule periods, i.e. many seconds.
>> +        */
>> +       raw_spin_lock_irq(&this_rq->lock);
>> +       update_rq_clock(this_rq);
>> +       cpu_load_update_idle(this_rq);
>> +       raw_spin_unlock_irq(&this_rq->lock);
>> +
>>          _nohz_idle_balance(this_rq, flags, idle);
>>   
>>          return true;
>>
> 
> Hmm.. it still looks to me like we should be saving and restoring IRQs
> since this can be called from IRQ context, no?

You mean in nohz_idle_balance()? Yes.

I just wanted to hint that since you need this cpu_load_update_idle() in 
the nohz idle balance case and not in idle balance, you could just 
update it in nohz_idle_balance() rather than in _nohz_idle_balance() 
(which is also called in nohz_newidle_balance()) avoiding this 
inconsistent lock state warning.

[...]

  parent reply	other threads:[~2018-07-05 14:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 14:24 [PATCH] sched/fair: Avoid divide by zero when rebalancing domains Matt Fleming
2018-07-05  8:02 ` [lkp-robot] [sched/fair] fbd5188493: WARNING:inconsistent_lock_state kernel test robot
2018-07-05  8:58   ` Dietmar Eggemann
2018-07-05  9:52     ` Dietmar Eggemann
2018-07-05 13:24       ` Matt Fleming
2018-07-05 14:43         ` Matt Fleming
2018-07-05 14:59         ` Dietmar Eggemann [this message]
2018-07-05 10:10 ` [PATCH] sched/fair: Avoid divide by zero when rebalancing domains Valentin Schneider
2018-07-05 13:27   ` Matt Fleming
2018-07-05 16:54     ` Valentin Schneider
2018-08-17 10:27       ` Matt Fleming
2018-08-17 12:58         ` Valentin Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42d319f5-1a3a-fb69-5ec5-d2e9836e49c9@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=umgwanakikbuti@gmail.com \
    --cc=xiaolong.ye@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®