[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tracking shared dirty pages in a mmap file



Hi Kandan..

> I want to track pages of a mmap file that has been written to,
> using a segv handler.
>
> What I want to know is whether the modifications to the mmap file
> will be guaranteed to be unaffected by the interruption of the signal
> handler, i.e. would the resultant changes in the mmap file be as if
> the mmap file had write access set.

I think yes, it would be unaffected. AFAIK, what you hook here is user 
space handler, while the fault handler in kernel space itself is still 
working as usual

But...what I don't understand is, why do you make the relevant pages in  
read/write mode while you mmap the file in read only mode? If I 
understand correctly about mmap internal, this will fail the write 
operation. 

From mprotect manual:
"
ERRORS
..................
       EACCES The memory cannot be given the specified access.  This can  
happen,  for example, if you mmap(2) a file to which you have read-              
only access, then ask mprotect to mark it PROT_WRITE."

I hope i explain it correctly. CMIIW, guys.

regards,

Mulyadi



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/