On Sat, Apr 27, 2019 at 2:25 AM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote: > > On Fri, 26 Apr 2019 18:26:42 +0800 Yafang Shao <laoar.shao@xxxxxxxxx> wrote: > > > Recently there're some hungtasks on our server due to > > wait_on_page_writeback, and we want to know the details of this > > PG_writeback, i.e. this page is writing back to which device. > > But it is not so convenient to get the details. > > > > I think it would be better to introduce a tracepoint for diagnosing > > the writeback details. > > Fair enough, I guess. > > > --- a/include/linux/pagemap.h > > +++ b/include/linux/pagemap.h > > @@ -537,15 +537,7 @@ static inline int wait_on_page_locked_killable(struct page *page) > > > > extern void put_and_wait_on_page_locked(struct page *page); > > > > -/* > > - * Wait for a page to complete writeback > > - */ > > -static inline void wait_on_page_writeback(struct page *page) > > -{ > > - if (PageWriteback(page)) > > - wait_on_page_bit(page, PG_writeback); > > -} > > - > > +void wait_on_page_writeback(struct page *page); > > extern void end_page_writeback(struct page *page); > > void wait_for_stable_page(struct page *page); > > > > ... > > > > +/* > > + * Wait for a page to complete writeback > > + */ > > +void wait_on_page_writeback(struct page *page) > > +{ > > + if (PageWriteback(page)) { > > + trace_wait_on_page_writeback(page, page_mapping(page)); > > + wait_on_page_bit(page, PG_writeback); > > + } > > +} > > +EXPORT_SYMBOL_GPL(wait_on_page_writeback); > > But this is a stealth change to the wait_on_page_writeback() licensing. > I will get sad emails from developers of accidentally-broken > out-of-tree filesystems. > > We can discuss changing the licensing, but this isn't the way to do it! > Got it. Thanks for your explatation. Thanks Yafang