lkml.org 
[lkml]   [2020]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCHv3, RESEND 5/8] khugepaged: Allow to collapse a page shared across fork
From
Date
On 2020-04-14 14:35, Kirill A. Shutemov wrote:
> On Mon, Apr 13, 2020 at 01:48:22PM -0700, John Hubbard wrote:
>
> [Thanks for all your suggestions and corrections]
>
>>> + if (IS_ENABLED(CONFIG_DEBUG_VM) && expected_refcount > refcount) {
>>> + pr_err("expected_refcount: %d, refcount: %d\n",
>>> + expected_refcount, refcount);
>>> + dump_page(page, "Unexpected refcount");
>>
>>
>> I see two issues with the pr_err() and the dump_page() call:
>>
>> 1. You probably want to rate limit this, otherwise you'll have a big
>> problem if lots of pages are pinned!
>
> Nope. Only if kernel is buggy. See below.
>
>> 2. Actually, I don't think you'd want to print anything at all here, even with
>> rate limiting, because doing so presumes that "unexpected" means "wrong". And I
>> think this patch doesn't expect to have GUP pins (or pin_user_pages() pins, ha),
>> but that doesn't mean that they're wrong to have.
>
> See condition. We only do it if refcount is *below* expected refcount. It
> should never happen. Pinned page would have refcount above expected.
>

Yes, you are right. I misread the condition. This actually is just right. :)

thanks,
--
John Hubbard
NVIDIA

\
 
 \ /
  Last update: 2020-04-15 04:45    [W:2.062 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site