2011/9/13 Sergio López <sl...@sinrega.org>: > Hi, > > Does somebody know the reasoning behind the function "poke_pages" in > ext2fs:truncate.c? I suppose it's there to work around some kind of > memory object paging error in GNU Mach, but I'm not sure about it's > real purpose, or if it's still needed nowadays. >
Answering to myself, poke_pages is there to force an emancipation of delayed copy objects (CoW) before truncating node contents. I think this should be dealt in m_o_lock_request when flushing pages. Until then, I think an easy optimization like annotating if an object has been mmap'ed sometime in its lifetime to decide if poking pages is really needed could be really useful. Knowing it's just a workaround, a patch like this would be accepted or is better to aim directly for the costly (but better) solution?