Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1608300

Re: [x86/mm/gup] 2947ba054a [ 71.329069] kernel BUG at include/linux/pagemap.h:151!

Path csiph.com!goblin3!goblin1!goblin.stu.neva.ru!news.panservice.it!bofh.it!news.nic.it!robomod
From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [x86/mm/gup] 2947ba054a [ 71.329069] kernel BUG at include/linux/pagemap.h:151!
Date Fri, 24 Mar 2017 11:30:02 +0100
Message-ID <touDM-64-15@gated-at.bofh.it> (permalink)
References <tmRXP-41x-1@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=w6bnowL4846AQfBScCw7zvBSrbOjVj1SgC1Rop+/TBk=; b=JIMh1a93gXXjDMqRCWtfBZZkhxvlBP5LQXgAtE/HA1MPxbqpPuyZ2nz7d4AzzF7v/6 xXg1uwwyzeyMG77fiq4iGWd25Lo3SlTYRTC4VppUA/Hs+7jAI4LcQMbyYPyq3bfosPgR Kt4R65E1qKS+xuAGgWwXo5tAXHYfoigyVlAYTzfSmErxysJH483TRXALIuPjgsOARPBE lEpgrXuEYlBWFkn9EvKP/RzEVBe6qKir+uIFoISTSwiU3EqPLLSiI2YfE1pI0XLocanD qRmu2jtGK2dEYW3PrbeXWmQlckBV3gbHkqMP15rG/+vgc36LrmDL6pGQH48D829gjsds +plw==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=w6bnowL4846AQfBScCw7zvBSrbOjVj1SgC1Rop+/TBk=; b=EMGuK8QSCr5txf1Aez27ZdDGnZxdkfbpWlXT6vAmm+UNlOmPq4BLgrU9lDDhyWhhcP VeHNWnRbWkQbSlcLs1kjkW/0ZK6o72boUAjOSTE/JJTscJdVRpOeL7buDyGhP9lapH5j b9dBbEphd4xfWiYJxdUuIVKbj0yrzWrLNsSpdIS9Yr007AinXNWf+r+3Z8VCYqC302Eg 4nfvKtmCQTekUbR47uxfQqX2WIvGiOPkOa8OH9OIyPsl8Syt+N9IZW3E3tWEg+M42Ms0 o0CZsZkPtRCPWu20Bv0FfzGwmlc8TUEn4m0XCGpeTO5wYuvY4HzJBcHH7kkv26OsByjQ 20kw==
X-Gm-Message-State AFeK/H2EK7chv0wvDGeCOUhaYdGhdeVOnIx+ulCuvkfokjICkNhVLhy2Hw3vcuxIe9blxw==
X-Received by 10.28.13.207 with SMTP id 198mr2278953wmn.76.1490351078384; Fri, 24 Mar 2017 03:24:38 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent NeoMutt/20170306 (1.8.0)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 54
Organization linux.* mail to news gateway
X-Original-Cc "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, LKP <lkp@01.org>, Linus Torvalds <torvalds@linux-foundation.org>, "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
X-Original-Date Fri, 24 Mar 2017 13:24:36 +0300
X-Original-Message-ID <20170324102436.xltop6udkx5pg4oq@node.shutemov.name>
X-Original-References <20170319225124.xodpqjldom6ceazz@wfg-t540p.sh.intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1608300

Show key headers only | View raw


On Mon, Mar 20, 2017 at 06:51:24AM +0800, Fengguang Wu wrote:
> [   71.329069] kernel BUG at include/linux/pagemap.h:151!
> [   71.332456] invalid opcode: 0000 [#1]
> [   71.334359] CPU: 0 PID: 458 Comm: trinity-c0 Not tainted 4.11.0-rc2-00251-g2947ba0 #1
> [   71.338444] task: ffff88001f19ab00 task.stack: ffff88001f084000
> [   71.340586] RIP: 0010:gup_pud_range+0x56f/0x63d
> [   71.342886] RSP: 0018:ffff88001f087ba8 EFLAGS: 00010046
> [   71.345607] RAX: 0000000080000000 RBX: 000000000164e000 RCX: ffff88001e0badc0
> [   71.347923] RDX: dead000000000100 RSI: 0000000000000001 RDI: ffff88001e0badc0
> [   71.350249] RBP: ffff88001f087c38 R08: ffff88001f087cf8 R09: ffff88001f087c6c
> [   71.352741] R10: 0000000000000000 R11: ffff88001f19b0f0 R12: ffff88001f087c6c
> [   71.356086] R13: ffff88001e0badc0 R14: 800000001e7b7867 R15: 0000000000000000
> [   71.359328] FS:  00007f7ea7b60700(0000) GS:ffffffffae02f000(0000) knlGS:0000000000000000
> [   71.361945] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [   71.363806] CR2: 00000000013eb130 CR3: 0000000017ddb000 CR4: 00000000000006f0
> [   71.366122] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   71.368424] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 00000000000d0602
> [   71.370729] Call Trace:
> [   71.371537]  __get_user_pages_fast+0x107/0x136
> [   71.373435]  get_user_pages_fast+0x78/0x89
> [   71.375447]  get_futex_key+0xfd/0x350
> [   71.376999]  ? simple_write_end+0x83/0xbe
> [   71.378614]  futex_requeue+0x1a3/0x585
> [   71.380244]  do_futex+0x834/0x86f
> [   71.381893]  ? kvm_clock_read+0x16/0x1e
> [   71.383794]  ? paravirt_sched_clock+0x9/0xd
> [   71.385857]  ? lock_release+0x11e/0x328
> [   71.387760]  SyS_futex+0x125/0x135
> [   71.389446]  ? write_seqcount_end+0x1a/0x1f
> [   71.391499]  ? vtime_account_user+0x4b/0x50
> [   71.393404]  do_syscall_64+0x61/0x74
> [   71.394806]  entry_SYSCALL64_slow_path+0x25/0x25

Looks like a false-negative in_atomic() in page_cache_get_speculative().
We are under local_irq_save() it should be atomic enough.

Not sure why other architectures haven't seen this before. Maybe TINY_RCU
plus PREEMPT is not common enough.

And unlike other architectures which uses generic GUP_fast(), we don't
really need page_cache_get_speculative() x86. get_page() would work
perfectly fine as we don't free pages until IPI broadcast is completed.
So if you saw it in page tables it will not go away under you.

I'm not sure what is the best way to fix this.
Few options:
 - Drop the VM_BUG();
 - Bump preempt count during __get_user_pages_fast();
 - Use get_page() instead of page_cache_get_speculative() on x86.

Any opinions?

-- 
 Kirill A. Shutemov

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [x86/mm/gup] 2947ba054a [   71.329069] kernel BUG at  include/linux/pagemap.h:151! "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-03-24 11:30 +0100
  Re: [x86/mm/gup] 2947ba054a [   71.329069] kernel BUG at  include/linux/pagemap.h:151! Peter Zijlstra <peterz@infradead.org> - 2017-03-24 12:00 +0100
    Re: [x86/mm/gup] 2947ba054a [   71.329069] kernel BUG at  include/linux/pagemap.h:151! "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-03-24 13:00 +0100
      Re: [x86/mm/gup] 2947ba054a [   71.329069] kernel BUG at  include/linux/pagemap.h:151! "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-03-27 17:40 +0200

csiph-web