lkml.org 
[lkml]   [2016]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: kmap_atomic and preemption
Date
On Wednesday 04 May 2016 07:23 PM, Thomas Petazzoni wrote:
> Hello,
>
> On Wed, 4 May 2016 15:47:29 +0200, Peter Zijlstra wrote:
>
>> static inline void *kmap_atomic(struct page *page)
>> {
>> preempt_disable();
>> pagefault_disable();
>> if (!PageHighMem(page))
>> return page_address(page);
>>
>> return __kmap_atomic(page);
>> }
> This is essentially what has been done on ARM in commit
> 9ff0bb5ba60638a688a46e93df8c5009896672eb, showing a pretty significant
> improvement in network workloads.

ARC already has that semantically - only not inline ! I really want to avoid 2
needless LD-ADD-ST for the disabling of preemption and page fault for the low mem
pages by returning early !

static inline void *kmap_atomic(struct page *page)
{
if (!PageHighMem(page))
return page_address(page);

preempt_disable();
pagefault_disable();

return __kmap_atomic(page);

}

>
> Best regards,
>
> Thomas

\
 
 \ /
  Last update: 2016-05-04 16:21    [W:0.071 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site