Re: [PATCH v2 1/5] padata: make flushing work with async users

From: Daniel Jordan
Date: Wed Sep 18 2019 - 16:38:00 EST


On Thu, Sep 05, 2019 at 06:37:56PM -0400, Daniel Jordan wrote:
> On Thu, Sep 05, 2019 at 02:17:35PM +1000, Herbert Xu wrote:
> > I don't think waiting is an option. In a pathological case the
> > hardware may not return at all. We cannot and should not hold off
> > CPU hotplug for an arbitrary amount of time when the event we are
> > waiting for isn't even occuring on that CPU.
>
> Ok, I hadn't considered hardware not returning.
>
> > I don't think flushing is needed at all. All we need to do is
> > maintain consistency before and after the CPU hotplug event.
>
> I could imagine not flushing would work for replacing a pd. The old pd could
> be freed by whatever drops the last reference and the new pd could be
> installed, all without flushing.
>
> In the case of freeing an instance, though, padata needs to wait for all the
> jobs to complete so they don't use the instance's data after it's been freed.
> Holding the CPU hotplug lock isn't necessary for this, though, so I think we're
> ok to wait here.

[FYI, I'm currently on leave until mid-October and will return to this series
then.]