lkml.org 
[lkml]   [2015]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Regression: Requiring CAP_SYS_ADMIN for /proc/<pid>/pagemap causes application-level breakage
From
On Wed, Apr 29, 2015 at 12:36 PM, Kirill A. Shutemov
<kirill@shutemov.name> wrote:
>
> Emm.. I have hard time to understand how writable bit is enough to get
> soft-dirty-alike functionality.

I don't think it is.

For anonymous pages, maybe you can play tricks with comparing the page
'anon_vma' with the vma->anon_vma.

I haven't really thought that through, but does something like

static inline bool page_is_dirty_in_vma(struct page *page, struct
vm_area_struct *vma)
{
struct anon_vma *anon_vma = vma->anon_vma;

return page->mapping == (void *)anon_vma + PAGE_MAPPING_ANON;
}

end up working as a "page has been dirtied in this mapping"?

If the page came from another process and hasn't been written to, it
will have the anon_vma pointing to the originalting vma.

I may be high on some bad drugs, though. As mentioned, I didn't really
think this through.

Linus


\
 
 \ /
  Last update: 2015-04-29 23:01    [W:1.140 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site