On Tue, Jan 11, 2022 at 12:20:13PM -0800, Minchan Kim wrote: < snip > > > > slow path with __gup_longterm_unlocked and set_dirty_pages > > > for them). > > > > > > This approach would solve other cases where map userspace > > > pages into kernel space and then write. Since the write > > > didn't go through with the process's page table, we will > > > lose the dirty bit in the page table of the process and > > > it turns out same problem. That's why I'd like to approach > > > this. > > > > > > If it doesn't work, the other option to fix this specific > > > case is can't we make pages dirty in advance in DIO read-case? > > > > > > When I look at DIO code, it's already doing in async case. > > > Could't we do the same thing for the other cases? > > > I guess the worst case we will see would be more page > > > writeback since the page becomes dirty unnecessary. > > > > Marking pages dirty after pinning them is a pre-existing area of > > problems. See the long-running LWN articles about get_user_pages() [1]. > > Oh, Do you mean marking page dirty in DIO path is already problems? ^ marking page dirty too late in DIO path Typo fix.