[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xm26v9w8jwgl.fsf@bsegall-linux.svl.corp.google.com>
Date: Thu, 11 Jul 2019 10:46:18 -0700
From: bsegall@...gle.com
To: Peter Zijlstra <peterz@...radead.org>
Cc: Dave Chiluk <chiluk+linux@...eed.com>,
Pqhil Auld <pauld@...hat.com>, Peter Oskolkov <posk@...k.io>,
Ingo Molnar <mingo@...hat.com>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, Brendan Gregg <bgregg@...flix.com>,
Kyle Anderson <kwa@...p.com>,
Gabriel Munos <gmunoz@...flix.com>,
John Hammond <jhammond@...eed.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org,
Paul Turner <pjt@...gle.com>
Subject: Re: [PATCH v5 1/1] sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices
Peter Zijlstra <peterz@...radead.org> writes:
> FWIW, good to see progress, still waiting for you guys to agree :-)
>
> On Mon, Jul 01, 2019 at 01:15:44PM -0700, bsegall@...gle.com wrote:
>
>> - Taking up-to-every rq->lock is bad and expensive and 5ms may be too
>> short a delay for this. I haven't tried microbenchmarks on the cost of
>> this vs min_cfs_rq_runtime = 0 vs baseline.
>
> Yes, that's tricky, SGI/HPE have definite ideas about that.
>
>> @@ -4781,12 +4790,41 @@ static __always_inline void return_cfs_rq_runtime(struct cfs_rq *cfs_rq)
>> */
>> static void do_sched_cfs_slack_timer(struct cfs_bandwidth *cfs_b)
>> {
>> - u64 runtime = 0, slice = sched_cfs_bandwidth_slice();
>> + u64 runtime = 0;
>> unsigned long flags;
>> u64 expires;
>> + struct cfs_rq *cfs_rq, *temp;
>> + LIST_HEAD(temp_head);
>> +
>> + local_irq_save(flags);
>> +
>> + raw_spin_lock(&cfs_b->lock);
>> + cfs_b->slack_started = false;
>> + list_splice_init(&cfs_b->slack_cfs_rq, &temp_head);
>> + raw_spin_unlock(&cfs_b->lock);
>> +
>> +
>> + /* Gather all left over runtime from all rqs */
>> + list_for_each_entry_safe(cfs_rq, temp, &temp_head, slack_list) {
>> + struct rq *rq = rq_of(cfs_rq);
>> + struct rq_flags rf;
>> +
>> + rq_lock(rq, &rf);
>> +
>> + raw_spin_lock(&cfs_b->lock);
>> + list_del_init(&cfs_rq->slack_list);
>> + if (!cfs_rq->nr_running && cfs_rq->runtime_remaining > 0 &&
>> + cfs_rq->runtime_expires == cfs_b->runtime_expires) {
>> + cfs_b->runtime += cfs_rq->runtime_remaining;
>> + cfs_rq->runtime_remaining = 0;
>> + }
>> + raw_spin_unlock(&cfs_b->lock);
>> +
>> + rq_unlock(rq, &rf);
>> + }
>
> But worse still, you take possibly every rq->lock without ever
> re-enabling IRQs.
>
Yeah, I'm not sure why I did that, it isn't correctness.
Powered by blists - more mailing lists