Subject: Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure

From: Avi Kivity <[email-masked]>
Date: Thu, 04 Jun 2009 22:04:09 +0300

Gregory Haskins wrote:
> Oh, I don't doubt that (in fact, I was pretty sure that was the case
> based on some of the optimizations I could see in studying the c_t_u()
> path).  I just didn't realize there were other ways to do it if its a
> non "current" task. ;)
>
> I guess the enigma for me right now is what cost does switch_mm have? 
> (Thats not a slam against the suggested approach...I really do not know
> and am curious).
>   

switch_mm() is probably very cheap (reloads cr3), but it does dirty the 
current cpu's tlb.  When the kernel needs to flush a process' tlb, it 
will have to IPI that cpu in addition to all others.  This takes place, 
for example, after munmap() or after a page is swapped out (though 
significant batching is done there).

It's still plenty cheaper in my estimation.

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.