[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150916122249.GA28821@redhat.com>
Date: Wed, 16 Sep 2015 14:22:49 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Christian Borntraeger <borntraeger@...ibm.com>,
paulmck@...ux.vnet.ibm.com, Peter Zijlstra <peterz@...radead.org>,
Tejun Heo <tj@...nel.org>, Ingo Molnar <mingo@...hat.com>,
"linux-kernel@...r.kernel.org >> Linux Kernel Mailing List"
<linux-kernel@...r.kernel.org>, KVM list <kvm@...r.kernel.org>
Subject: Re: [4.2] commit d59cfc09c32 (sched, cgroup: replace
signal_struct->group_rwsem with a global percpu_rwsem) causes
regression for libvirt/kvm
On 09/16, Paolo Bonzini wrote:
>
>
> On 16/09/2015 10:57, Christian Borntraeger wrote:
> > Am 16.09.2015 um 10:32 schrieb Paolo Bonzini:
> >>
> >>
> >> On 15/09/2015 19:38, Paul E. McKenney wrote:
> >>> Excellent points!
> >>>
> >>> Other options in such situations include the following:
> >>>
> >>> o Rework so that the code uses call_rcu*() instead of *_expedited().
> >>>
> >>> o Maintain a per-task or per-CPU counter so that every so many
> >>> *_expedited() invocations instead uses the non-expedited
> >>> counterpart. (For example, synchronize_rcu instead of
> >>> synchronize_rcu_expedited().)
> >>
> >> Or just use ratelimit (untested):
> >
> > One of my tests was to always replace synchronize_sched_expedited with
> > synchronize_sched and things turned out to be even worse. Not sure if
> > it makes sense to test yopur in-the-middle approach?
>
> I don't think it applies here, since down_write/up_write is a
> synchronous API.
>
> If the revert isn't easy, I think backporting rcu_sync is the best bet.
I leave this to Paul and Tejun... at least I think this is not v4.2 material.
> The issue is that rcu_sync doesn't eliminate synchronize_sched,
Yes, but it eliminates _expedited(). This is good, but otoh this means
that (say) individual __cgroup_procs_write() can take much more time.
However, it won't block the readers and/or disturb the whole system.
And percpu_up_write() doesn't do synchronize_sched() at all.
> it only
> makes it more rare.
Yes, so we can hope that multiple __cgroup_procs_write()'s can "share"
a single synchronize_sched().
> So it's possible that it isn't eliminating the root
> cause of the problem.
We will see... Just in case, currently the usage of percpu_down_write()
is suboptimal. We do not need to do ->sync() under cgroup_mutex. But
this needs some WIP changes in rcu_sync. Plus we can do more improvements,
but this is off-topic right now.
Oleg.
--
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