[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7fcc15f4-e548-78bc-788d-f93293a1be74@nvidia.com>
Date: Mon, 10 Feb 2020 09:07:07 -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 v5 10/12] mm/gup: /proc/vmstat: pin_user_pages (FOLL_PIN)
reporting
On 2/10/20 2:16 AM, Jan Kara wrote:
> On Thu 06-02-20 19:37:33, John Hubbard wrote:
>> @@ -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
Arggh, yes that's true. Thanks for catching that, will fix in v6.
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists