linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@kernel.org>,
	Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-mm@kvack.org, Andrea Arcangeli <aarcange@redhat.com>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Ebru Akagunduz <ebru.akagunduz@gmail.com>
Subject: Re: [linux-next-20160602] kernel BUG at mm/rmap.c:1253!
Date: Thu, 2 Jun 2016 15:35:12 +0200	[thread overview]
Message-ID: <af861bee-70da-a150-052c-2712511103d7@suse.cz> (raw)
In-Reply-To: <20160602131352.GQ1995@dhcp22.suse.cz>

On 06/02/2016 03:13 PM, Michal Hocko wrote:
> On Thu 02-06-16 13:59:49, Michal Hocko wrote:
>> [CCing Ebru]
>>
>> On Thu 02-06-16 13:50:46, Michal Hocko wrote:
>>> [CCing Andrea and Kirill]
>>
>> Hmm, thinking about it little bit more it might be related to "mm, thp:
>> make swapin readahead under down_read of mmap_sem". I didn't get to look
>> closer at the patch but maybe revalidate after mmap sem is dropped is
>> not sufficient.
>
> so hugepage_vma_revalidate does this:
>
> 	hstart = (vma->vm_start + ~HPAGE_PMD_MASK) & HPAGE_PMD_MASK;
> 	hend = vma->vm_end & HPAGE_PMD_MASK;
> 	if (address < hstart || address + HPAGE_PMD_SIZE > hend)
> 		return SCAN_ADDRESS_RANGE;
>
> I really do not see why we have to play with hstart and hend.

AFAIU the point of these tests is to see whether the vma is large enough 
to contain the given address within a huge page. And it kind of silently 
assumes that address is already huge-page aligned.

> But
> address + HPAGE_PMD_SIZE > hend part looks suspicious. address
> always have to vm_start <= address && address < vm_end AFAICS.

I think the check is fine after a deeper look. The code itself is also 
quite old, the recent patches just abstracted it to the new function.

> and the above allows address + HPAGE_PMD_MASK == end.
>

--
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-06-02 13:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02 11:14 Tetsuo Handa
2016-06-02 11:50 ` Michal Hocko
2016-06-02 11:59   ` Michal Hocko
2016-06-02 13:13     ` Michal Hocko
2016-06-02 13:35       ` Vlastimil Babka [this message]
2016-06-02 13:27     ` Vlastimil Babka

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=af861bee-70da-a150-052c-2712511103d7@suse.cz \
    --to=vbabka@suse.cz \
    --cc=aarcange@redhat.com \
    --cc=ebru.akagunduz@gmail.com \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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