Thread (30 messages) 30 messages, 2 authors, 2023-08-21

Re: [RESEND PATCH v10 25/25] dept: Track the potential waits of PG_{locked,writeback}

From: Matthew Wilcox <willy@infradead.org>
Date: 2023-08-21 04:25:58
Also in: dri-devel, linux-ext4, linux-fsdevel, linux-ide, linux-mm, lkml

On Mon, Aug 21, 2023 at 12:46:37PM +0900, Byungchul Park wrote:
quoted hunk ↗ jump to hunk
@@ -377,44 +421,88 @@ static __always_inline int Page##uname(struct page *page)		\
 #define SETPAGEFLAG(uname, lname, policy)				\
 static __always_inline							\
 void folio_set_##lname(struct folio *folio)				\
-{ set_bit(PG_##lname, folio_flags(folio, FOLIO_##policy)); }		\
+{									\
+	set_bit(PG_##lname, folio_flags(folio, FOLIO_##policy));	\
+	dept_page_set_bit(&folio->page, PG_##lname);			\
The PG_locked and PG_writeback bits only actually exist in the folio;
the ones in struct page are just legacy and never actually used.
Perhaps we could make the APIs more folio-based and less page-based?
 static __always_inline void SetPage##uname(struct page *page)		\
-{ set_bit(PG_##lname, &policy(page, 1)->flags); }
+{									\
+	set_bit(PG_##lname, &policy(page, 1)->flags);			\
+	dept_page_set_bit(page, PG_##lname);				\
+}
I don't think we ever call this for PG_writeback or PG_locked.  If
I'm wrong, we can probably fix that ;-)
 static __always_inline void __SetPage##uname(struct page *page)		\
-{ __set_bit(PG_##lname, &policy(page, 1)->flags); }
+{									\
+	__set_bit(PG_##lname, &policy(page, 1)->flags);			\
+	dept_page_set_bit(page, PG_##lname);				\
+}
Umm.  We do call __SetPageLocked() though ... I'll fix those up to
be __set_folio_locked().
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help