From: Jan Kara <jack@suse.cz>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Jan Kara <jack@suse.cz>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Bug in page_cache_tree_delete?
Date: Tue, 8 Nov 2016 14:51:32 +0100 [thread overview]
Message-ID: <20161108135132.GS32353@quack2.suse.cz> (raw)
In-Reply-To: <20161108130307.GA14032@node>
On Tue 08-11-16 16:03:07, Kirill A. Shutemov wrote:
> On Tue, Nov 08, 2016 at 11:35:41AM +0100, Jan Kara wrote:
> > Hi Kirill,
> >
> > I've noticed that your commit 83929372f629 (filemap: prepare find and
> > delete operations for huge pages) added to page_cache_tree_delete():
> >
> > int i, nr = PageHuge(page) ? 1 : hpage_nr_pages(page);
> >
> > Isn't the logic computing 'nr' inverted? I'd expect that if page is
> > !PageHuge, we want to delete just one page... OTOH I'm surprised this would
> > not blow up anywhere if it was really wrong so maybe I just miss something.
>
> No, that's not bug.
>
> PageHuge() detects hugetlb pages (we probably should rename the helper)
> which represented by one entry on radix-tree per huge page.
Ah, right. Thanks for explanation! Maybe that line would deserve a comment?
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2016-11-08 13:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 10:35 Jan Kara
2016-11-08 13:03 ` Kirill A. Shutemov
2016-11-08 13:51 ` Jan Kara [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161108135132.GS32353@quack2.suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=kirill@shutemov.name \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox