linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Jan Kara <jack@suse.cz>
Cc: "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 16:03:07 +0300	[thread overview]
Message-ID: <20161108130307.GA14032@node> (raw)
In-Reply-To: <20161108103541.GN32353@quack2.suse.cz>

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.

-- 
 Kirill A. Shutemov

--
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>

  reply	other threads:[~2016-11-08 13:03 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 [this message]
2016-11-08 13:51   ` Jan Kara

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=20161108130307.GA14032@node \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=kirill.shutemov@linux.intel.com \
    --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