Re: [RFC PATCH 3/3] ARM: vfp: Use cpu pm notifiers to save vfp state

From: Catalin Marinas
Date: Fri Feb 11 2011 - 07:56:07 EST


On 11 February 2011 12:24, Russell King - ARM Linux
<linux@xxxxxxxxxxxxxxxx> wrote:
> On Fri, Feb 11, 2011 at 12:12:25PM +0000, Catalin Marinas wrote:
>> On SMP systems, we save the VFP at every context switch to deal with the
>> thread migration (though I have a plan to make this lazily on SMP as
>> well).
>
> I'm not sure it's worth the complexity. ÂYou'd have to do an IPI to the
> old CPU to provoke it to save the context from its VFP unit. ÂYou'd have
> to do that in some kind of atomic way as the old CPU may be in the middle
> of already saving it. ÂYou're also going to have to add locking to the
> last_VFP_context[] array as other CPUs will be accessing non-local
> entries, and that means doing locking in assembly. ÂYuck.

I wasn't thinking about that, too complex indeed. But it may be easier
to detect thread migration, possibly with some hooks into generic
scheduler and only save the VFP state at that point. I haven't looked
in detail but I heard the x86 people have patches for something
similar.

--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/