Hi... I won't pretend I know much about it...just to share my ideas... On Thu, Sep 11, 2008 at 11:43 PM, Paulo da Silva <psdasilva@xxxxxxxxxxxx> wrote: > Suppose the following situation: > > 1. Lock a cached page > 2. Change it > 3. Set it dirty > 4. Unlock the page To the best I know, you can only lock anonymous page... > From this point, it is assumed that the kernel may write the page. > How can I prevent the page from being written, even if some "sync" > function is like, for example, filemap_write_and_wait? The "bad" idea I have is to detach it from its backing disk page..but well...that sounds nasty even to me. What do you think? > I thought of not seting it dirty, but then what happens if the kernel is > short in memory? Does it preserve the page, and so keeping the changes I > did? Hmmm.... well I think the kernel will think it's already "in sync" with its backing storage and just throw it away. Do you guys agree? > Can the uptodate or reserved flags play any role on this? How? there is a chance reserved flag could help you, but I am not 100% sure. Another idea that you might find interesting is by implementing something like PG_DONTSYNC and make related page sync operation skip that page when it sees the flag during scanning inactive pages. regards, Mulyadi. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ