lkml.org 
[lkml]   [2020]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3, RESEND 5/8] khugepaged: Allow to collapse a page shared across fork
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.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2020-04-14 23:36    [W:1.027 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site