On Mon, May 22, 2017 at 04:43:57PM -0700, Qing Huang wrote:I think there are two parts here. First part is that we don't need to set the dirty bit if it's already set. Second part is whether we use set_page_dirty or set_page_dirty_lock to set dirty bits.
On 5/19/2017 6:05 AM, Christoph Hellwig wrote:I suspect copy & paste. Or maybe I don't actually understand the
On Thu, May 18, 2017 at 04:33:53PM -0700, Qing Huang wrote:It seems that set_page_dirty_lock has been used here for more than 10 years.
This change will optimize kernel memory deregistration operations.As far as I can tell this code doesn't even need set_page_dirty_lock
__ib_umem_release() used to call set_page_dirty_lock() against every
writable page in its memory region. Its purpose is to keep data
synced between CPU and DMA device when swapping happens after mem
deregistration ops. Now we choose not to set page dirty bit if it's
already set by kernel prior to calling __ib_umem_release(). This
reduces memory deregistration time by half or even more when we ran
application simulation test program.
and could just use set_page_dirty
Don't know the original purpose. Maybe it was used to prevent races between
setting dirty bits and swapping out pages?
explanation of set_page_dirty vs set_page_dirty_lock enough. But
I'd rather not hack around the problem.
--