Re: [PATCH v4 10/12] mm/gup: /proc/vmstat: pin_user_pages (FOLL_PIN) reporting
From: John Hubbard
Date: Wed Feb 05 2020 - 18:13:33 EST
On 2/5/20 1:37 AM, Jan Kara wrote:
> ...
>
>> @@ -104,6 +106,9 @@ static __maybe_unused struct page *try_grab_compound_head(struct page *page,
>> if (hpage_pincount_available(page))
>> hpage_pincount_add(page, refs);
>>
>> + mod_node_page_state(page_pgdat(page), NR_FOLL_PIN_ACQUIRED,
>> + orig_refs);
>> +
>> return page;
>> }
>>
>
> It seems to me you miss mod_node_page_state() in put_compound_head(), don't
> you?
Yes, that was definitely missing. I've added this for the next version:
diff --git a/mm/gup.c b/mm/gup.c
index 7c543849181b..ae503c51bc7f 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2268,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);
@@ -2283,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);
}
#ifdef CONFIG_ARCH_HAS_HUGEPD
>
> Otherwise I like the new stat names better :).
>
> Honza
>
Glad to hear that! :)
thanks,
--
John Hubbard
NVIDIA