[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A2812E3.6090108@novell.com>
Date: Thu, 04 Jun 2009 14:30:59 -0400
From: Gregory Haskins <ghaskins@...ell.com>
To: Avi Kivity <avi@...hat.com>
CC: "Michael S. Tsirkin" <mst@...hat.com>,
linux-kernel@...r.kernel.org, agraf@...e.de, pmullaney@...ell.com,
pmorreale@...ell.com, anthony@...emonkey.ws, rusty@...tcorp.com.au,
netdev@...r.kernel.org, kvm@...r.kernel.org,
bhutchings@...arflare.com, andi@...stfloor.org, gregkh@...e.de,
herber@...dor.apana.org.au, chrisw@...s-sol.org,
shemminger@...tta.com
Subject: Re: [RFC PATCH v2 03/19] vbus: add connection-client helper infrastructure
Avi Kivity wrote:
> Gregory Haskins wrote:
>
>
>>> BTW, why did you decide to use get_user_pages?
>>> Would switch_mm + copy_to_user work as well
>>> avoiding page walk if all pages are present?
>>>
>>
>> Well, basic c_t_u() won't work because its likely not "current" if you
>> are updating the ring from some other task, but I think you have already
>> figured that out based on the switch_mm suggestion. The simple truth is
>> I was not familiar with switch_mm at the time I wrote this (nor am I
>> now). If this is a superior method that allows you to acquire
>> c_t_u(some_other_ctx) like behavior, I see no problem in changing. I
>> will look into this, and thanks for the suggestion!
>>
>
> copy_to_user() is significantly faster than get_user_pages() + kmap()
> + memcmp() (or their variants).
>
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).
As an aside, note that we seem to be reviewing v2, where v3 is really
the last set I pushed. I think this patch is more or less the same
across both iterations, but FYI that I would recommend looking at v3
instead.
-Greg
Download attachment "signature.asc" of type "application/pgp-signature" (267 bytes)
Powered by blists - more mailing lists