lkml.org 
[lkml]   [2013]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 8/8] KVM: PPC: Add hugepage support for IOMMU in-kernel handling
From
Date

On 10.07.2013, at 12:40, Alexander Graf wrote:

>
> On 10.07.2013, at 12:39, Benjamin Herrenschmidt wrote:
>
>> On Wed, 2013-07-10 at 12:33 +0200, Alexander Graf wrote:
>>>
>>> It's not exactly obvious that you're calling it with writing == 1 :).
>>> Can you create a new local variable "is_write" in the calling
>>> function, set that to 1 before the call to get_user_pages_fast and
>>> pass it in instead of the 1? The compiler should easily optimize all
>>> of that away, but it makes the code by far easier to read.
>>
>> Ugh ?
>>
>> Nobody else does that .... (look at futex :-)
>
> Yeah, that's fortunately code that I don't have to read :).

The "proper" alternative would be to pass an enum for read/write into the function rather than an int. But that'd be a pretty controversial, big change that I'd rather not put on Alexey. With a local variable we're nicely self-contained readable ;)


Alex



\
 
 \ /
  Last update: 2013-07-10 23:54    [W:0.820 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site