It looks as if most code handling the dirty bits already uses the page
lock?
According to the comments: Most callers of __set_page_dirty_nobuffers hold
the page lock. The only exception seems to be zap_pte_range where we
transfer the dirty information from the pte to the page. This is now much
rarer since the dirty mmap tracking patches make the fault handler deal
with it.
Still, the page dirtying in zap_pte_range remains a potential trouble spot
for the remaining cases in which we need to dirty pages there since it is
not rate limited. There is a potential cause for creating deadlocks
because too many pages were dirtied and the file system cannot allocate
enough memory for writeout.
-