All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <borkmann@iogearbox.net>
To: Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Michel Lespinasse <walken@google.com>,
	linux-mm <linux-mm@kvack.org>, Jared Hulbert <jaredeh@gmail.com>,
	netdev <netdev@vger.kernel.org>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	John David Anglin <dave.anglin@bell.net>,
	HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>,
	Konstantin Khlebnikov <khlebnikov@openvz.org>,
	Carsten Otte <cotte@de.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [BUG] at include/linux/page-flags.h:415 (PageTransHuge)
Date: Wed, 12 Feb 2014 13:02:54 +0100	[thread overview]
Message-ID: <52FB62EE.7070205@iogearbox.net> (raw)
In-Reply-To: <20140207185816.GA7764@order.stressinduktion.org>

Hi Vlastimil,

On 02/07/2014 07:58 PM, Hannes Frederic Sowa wrote:
> On Fri, Jan 31, 2014 at 03:40:38PM +0100, Vlastimil Babka wrote:
>> From: Vlastimil Babka <vbabka@suse.cz>
>> Date: Fri, 31 Jan 2014 11:50:21 +0100
>> Subject: [PATCH] mm: include VM_MIXEDMAP flag in the VM_SPECIAL list to avoid
>>   m(un)locking
>>
>> Daniel Borkmann reported a bug with VM_BUG_ON assertions failing where
>> munlock_vma_pages_range() thinks it's unexpectedly in the middle of a THP page.
>> This can be reproduced in tools/testing/selftests/net/ by running make and
>> then ./psock_tpacket.
>>
>> The problem is that an order=2 compound page (allocated by
>> alloc_one_pg_vec_page() is part of the munlocked VM_MIXEDMAP vma (mapped by
>> packet_mmap()) and mistaken for a THP page and assumed to be order=9.
>>
>> The checks for THP in munlock came with commit ff6a6da60b89 ("mm: accelerate
>> munlock() treatment of THP pages"), i.e. since 3.9, but did not trigger a bug.
>> It just makes munlock_vma_pages_range() skip such compound pages until the next
>> 512-pages-aligned page, when it encounters a head page. This is however not a
>> problem for vma's where mlocking has no effect anyway, but it can distort the
>> accounting.
>> Since commit 7225522bb ("mm: munlock: batch non-THP page isolation and
>> munlock+putback using pagevec") this can trigger a VM_BUG_ON in PageTransHuge()
>> check.
>>
>> This patch fixes the issue by adding VM_MIXEDMAP flag to VM_SPECIAL - a list of
>> flags that make vma's non-mlockable and non-mergeable. The reasoning is that
>> VM_MIXEDMAP vma's are similar to VM_PFNMAP, which is already on the VM_SPECIAL
>> list, and both are intended for non-LRU pages where mlocking makes no sense
>> anyway.

Thanks a lot for your efforts.

Is your patch queued up somewhere for mainline and stable?

> I also ran into this problem and wanted to ask what the status of this
> patch is? Does it need further testing? I can surely help with that. ;)
>
> Thanks,
>
>    Hannes
>

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

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Borkmann <borkmann@iogearbox.net>
To: Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Michel Lespinasse <walken@google.com>,
	linux-mm <linux-mm@kvack.org>, Jared Hulbert <jaredeh@gmail.com>,
	netdev <netdev@vger.kernel.org>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	John David Anglin <dave.anglin@bell.net>,
	HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>,
	Konstantin Khlebnikov <khlebnikov@openvz.org>,
	Carsten Otte <cotte@de.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [BUG] at include/linux/page-flags.h:415 (PageTransHuge)
Date: Wed, 12 Feb 2014 13:02:54 +0100	[thread overview]
Message-ID: <52FB62EE.7070205@iogearbox.net> (raw)
In-Reply-To: <20140207185816.GA7764@order.stressinduktion.org>

Hi Vlastimil,

On 02/07/2014 07:58 PM, Hannes Frederic Sowa wrote:
> On Fri, Jan 31, 2014 at 03:40:38PM +0100, Vlastimil Babka wrote:
>> From: Vlastimil Babka <vbabka@suse.cz>
>> Date: Fri, 31 Jan 2014 11:50:21 +0100
>> Subject: [PATCH] mm: include VM_MIXEDMAP flag in the VM_SPECIAL list to avoid
>>   m(un)locking
>>
>> Daniel Borkmann reported a bug with VM_BUG_ON assertions failing where
>> munlock_vma_pages_range() thinks it's unexpectedly in the middle of a THP page.
>> This can be reproduced in tools/testing/selftests/net/ by running make and
>> then ./psock_tpacket.
>>
>> The problem is that an order=2 compound page (allocated by
>> alloc_one_pg_vec_page() is part of the munlocked VM_MIXEDMAP vma (mapped by
>> packet_mmap()) and mistaken for a THP page and assumed to be order=9.
>>
>> The checks for THP in munlock came with commit ff6a6da60b89 ("mm: accelerate
>> munlock() treatment of THP pages"), i.e. since 3.9, but did not trigger a bug.
>> It just makes munlock_vma_pages_range() skip such compound pages until the next
>> 512-pages-aligned page, when it encounters a head page. This is however not a
>> problem for vma's where mlocking has no effect anyway, but it can distort the
>> accounting.
>> Since commit 7225522bb ("mm: munlock: batch non-THP page isolation and
>> munlock+putback using pagevec") this can trigger a VM_BUG_ON in PageTransHuge()
>> check.
>>
>> This patch fixes the issue by adding VM_MIXEDMAP flag to VM_SPECIAL - a list of
>> flags that make vma's non-mlockable and non-mergeable. The reasoning is that
>> VM_MIXEDMAP vma's are similar to VM_PFNMAP, which is already on the VM_SPECIAL
>> list, and both are intended for non-LRU pages where mlocking makes no sense
>> anyway.

Thanks a lot for your efforts.

Is your patch queued up somewhere for mainline and stable?

> I also ran into this problem and wanted to ask what the status of this
> patch is? Does it need further testing? I can surely help with that. ;)
>
> Thanks,
>
>    Hannes
>


  reply	other threads:[~2014-02-12 12:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-10 18:23 [BUG] at include/linux/page-flags.h:415 (PageTransHuge) Daniel Borkmann
2014-01-11  6:22 ` Andrew Morton
2014-01-11 13:32   ` Daniel Borkmann
2014-01-13 10:16     ` Vlastimil Babka
2014-01-13 11:39       ` Daniel Borkmann
2014-01-15 14:27         ` Vlastimil Babka
2014-01-15 14:27           ` Vlastimil Babka
2014-01-15 16:06           ` Daniel Borkmann
2014-01-15 16:06             ` Daniel Borkmann
2014-01-15 16:06             ` Daniel Borkmann
2014-01-31 14:40             ` Vlastimil Babka
2014-01-31 14:40               ` Vlastimil Babka
2014-01-31 14:40               ` Vlastimil Babka
2014-01-31 14:58               ` Thomas Hellstrom
2014-01-31 14:58                 ` Thomas Hellstrom
2014-01-31 14:58                 ` Thomas Hellstrom
2014-01-31 15:25                 ` Vlastimil Babka
2014-01-31 15:25                   ` Vlastimil Babka
2014-01-31 15:25                   ` Vlastimil Babka
2014-01-31 15:35                   ` Thomas Hellstrom
2014-01-31 15:35                     ` Thomas Hellstrom
2014-02-07 18:58               ` Hannes Frederic Sowa
2014-02-07 18:58                 ` Hannes Frederic Sowa
2014-02-12 12:02                 ` Daniel Borkmann [this message]
2014-02-12 12:02                   ` Daniel Borkmann

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=52FB62EE.7070205@iogearbox.net \
    --to=borkmann@iogearbox.net \
    --cc=akpm@linux-foundation.org \
    --cc=cotte@de.ibm.com \
    --cc=d.hatayama@jp.fujitsu.com \
    --cc=dave.anglin@bell.net \
    --cc=jaredeh@gmail.com \
    --cc=khlebnikov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=thellstrom@vmware.com \
    --cc=vbabka@suse.cz \
    --cc=walken@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.