On Tue, 27 Dec 2022 19:49:56 +0000 Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > On Tue, Dec 27, 2022 at 07:42:57PM +0000, SeongJae Park wrote: > > > +static inline struct page *damon_get_page(unsigned long pfn) > > > +{ > > > + struct folio *folio = damon_get_folio(pfn); > > > + > > > + return &folio->page; > > > > I think we should check if folio is NULL before dereferencing it? > > &folio->page does not dereeference folio. Ah, ok. And this is safe because ->page is at the beginning of folio, right? Kefeng, could we add a comment explaining it, for people having bad eyes like me? Thanks, SJ