lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09b49b0d-85cc-87b8-9176-0963f6c8c735@nvidia.com>
Date:   Wed, 5 Feb 2020 15:13:27 -0800
From:   John Hubbard <jhubbard@...dia.com>
To:     Jan Kara <jack@...e.cz>
CC:     Andrew Morton <akpm@...ux-foundation.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Christoph Hellwig <hch@...radead.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Dave Chinner <david@...morbit.com>,
        Ira Weiny <ira.weiny@...el.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Jonathan Corbet <corbet@....net>,
        Jérôme Glisse <jglisse@...hat.com>,
        "Kirill A . Shutemov" <kirill@...temov.name>,
        Michal Hocko <mhocko@...e.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Shuah Khan <shuah@...nel.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Matthew Wilcox <willy@...radead.org>,
        <linux-doc@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
        <linux-kselftest@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
        <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 10/12] mm/gup: /proc/vmstat: pin_user_pages (FOLL_PIN)
 reporting

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ