Thread (20 messages) 20 messages, 4 authors, 2020-02-10

Re: [PATCH v5 10/12] mm/gup: /proc/vmstat: pin_user_pages (FOLL_PIN) reporting

From: Jan Kara <jack@suse.cz>
Date: 2020-02-10 10:16:37
Also in: linux-doc, linux-fsdevel, linux-kselftest, linux-mm, lkml

On Thu 06-02-20 19:37:33, John Hubbard wrote:
quoted hunk ↗ jump to hunk
@@ -2258,6 +2268,8 @@ static int record_subpages(struct page *page, unsigned long addr,
 
 static void put_compound_head(struct page *page, int refs, unsigned int flags)
 {
+	int orig_refs = refs;
+
 	if (flags & FOLL_PIN) {
 		if (hpage_pincount_available(page))
 			hpage_pincount_sub(page, refs);
@@ -2273,6 +2285,8 @@ static void put_compound_head(struct page *page, int refs, unsigned int flags)
 	if (refs > 1)
 		page_ref_sub(page, refs - 1);
 	put_page(page);
+
+	mod_node_page_state(page_pgdat(page), NR_FOLL_PIN_RELEASED, orig_refs);
 }
Still not quite happy about this :) Now you update NR_FOLL_PIN_RELEASED
even if 'flags' don't have FOLL_PIN set. You need to have the
mod_node_page_state() inside the "if (flags & FOLL_PIN)" branch above...

									Honza
-- 
Jan Kara [off-list ref]
SUSE Labs, CR
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help