lkml.org 
[lkml]   [2020]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*()
From
Date
On 11/7/20 1:04 AM, John Hubbard wrote:
> On 11/7/20 12:24 AM, Souptick Joarder wrote:
>> In 2019, we introduced pin_user_pages*() and now we are converting
>> get_user_pages*() to the new API as appropriate. [1] & [2] could
>> be referred for more information. This is case 5 as per document [1].
>
> It turns out that Case 5 can be implemented via a better pattern, as long
> as we're just dealing with a page at a time, briefly:
>
> lock_page()
> write to page's data
> unlock_page()
>
> ...which neatly synchronizes with writeback and other fs activities.

Ahem, I left out a key step: set_page_dirty()!

lock_page()
write to page's data
set_page_dirty()
unlock_page()


thanks,
--
John Hubbard
NVIDIA

\
 
 \ /
  Last update: 2020-11-07 20:18    [W:0.051 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site