Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1464386ybt; Mon, 15 Jun 2020 00:30:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLiGElC2Xv5HAI281ykY7NFArXJtJld5uII1qrY7g5MCHReQYLQIrVJ1AvGkfHZSwqA7nu X-Received: by 2002:a05:6402:3069:: with SMTP id bs9mr21960009edb.194.1592206230375; Mon, 15 Jun 2020 00:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592206230; cv=none; d=google.com; s=arc-20160816; b=Z53tBM28O4zwSrL1zG8W8z/zRnKaVLvndQlFMsgXvqYX21PMaj+I3kv2dFi9bWdXf+ 4Msme0dnDrJEuFO9ZYYGDH4KAPs1h+XrfzEvTcfBYT+1vvWXUA6lnTXEuwSeJi/1gWhi BEW2vb8Iy6vQ5d8r7ctikezmIX2Z4X0f+oH4wAJfggutd4ZXV8LFxrL2uw/A3ZHeowF3 mN4PXLERf7x3Bn5F67TFVdail8jXbxacGMR1RTAzPS9sNaGaUTqaWdZRGxYhWmiP0iIq mfK8+ywwKENx3VeGIUs2FjWkTppotHUKa8fTEgldJLFkL/INrlRdJ76lW1CU9x7dxKV8 TAGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=9ToGcomrsNJ5IsfmhCaE8bj4p8OLeJAdAKZdbE/NfmE=; b=dtdxDfiVIIoGEg7KgOMHeHH0Ory8xeL6reDj4HKGjzbP6T9x+EjEO1hx58IuzRaWRN 5FlJX/xTKy35nmyQLVuayVvdlTNYuQm0EhyGw+kXNLKIqQ+ktrkjiVq1KDrmivhIItuO cl1cvdsz6bbdvSa/Ip9QCVvI7V5+fbafixvAUfcnUIzJBDIQomRgVnofKCw8faCAuzHi qDBDtVdfq9bw0jKjJjO2OoisT9wrQrIt9YaHjzJ0+kl4eJ2z6+mAYqwx6SU2fw765U3R imVhr4vQnXTB9GaIPtEurQJP7TGy3wrkUwFf5YY3ELWPXD7AdHEIhIw5vZgWfCSnIBAv puqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=axkMGOdv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si7781458edj.441.2020.06.15.00.30.07; Mon, 15 Jun 2020 00:30:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@atishpatra.org header.s=google header.b=axkMGOdv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728526AbgFOH21 (ORCPT + 99 others); Mon, 15 Jun 2020 03:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728399AbgFOH2Z (ORCPT ); Mon, 15 Jun 2020 03:28:25 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C916C061A0E for ; Mon, 15 Jun 2020 00:28:24 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id g10so13505588wmh.4 for ; Mon, 15 Jun 2020 00:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atishpatra.org; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=9ToGcomrsNJ5IsfmhCaE8bj4p8OLeJAdAKZdbE/NfmE=; b=axkMGOdv9xLipRtu44iTU38CgJZWN3aUB1wusgLSnk2LzS4fkQWhlzyqCR3D23JqE+ wsp9mE7nsz0zDlxmsm8gh5Dg63hg4kIhHDI3RJhwcUqyUruLhbtuj8M8WMxU1djpyGCd c184Q1pfdDkEui78I9h8YHkgfEsr4KdzG05EU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=9ToGcomrsNJ5IsfmhCaE8bj4p8OLeJAdAKZdbE/NfmE=; b=uluA1tNVInlMDO052Liipt+MR0TJbTKkm7if5eh60YwHz9QaWkeIKipWhUDszOl1h/ WXyO0x9wJZZzXSMpRQZPNsJqkZkbFpU4sFGB314MX+m5/b8Zn8QoPZCiuau2YlWZB09t LG8S5UEJ7H+kD247veL7jS5I/Ranh/UD/B+Pnc9DaMymQCaHDPMcsQN4w6oxblA+BHzo 6MvzT2BJZMlr6SE7+DiecPyOUUX2CzUg4B4qQ6DRK/z7Biecf+kDHoHKbZAoB0Dm+Pm7 IcTva1lnOtv0Q0E+PXJebODHAkC9K4ErBog3vmdqzzhURsYomKBu8xWzS/KR3yARwC74 QLBQ== X-Gm-Message-State: AOAM530XWXJYveVMPsFks1Vdir5rNaPwOnbloue2QO+VS5NBBR8S0x5T TqxHd6ILKgR2gjrlBikHeTibVTuTjSvzjZXnZ3Ye X-Received: by 2002:a1c:f608:: with SMTP id w8mr11354791wmc.78.1592206102980; Mon, 15 Jun 2020 00:28:22 -0700 (PDT) MIME-Version: 1.0 From: Atish Patra Date: Mon, 15 Jun 2020 00:28:11 -0700 Message-ID: Subject: mm lock issue while booting Linux on 5.8-rc1 for RISC-V To: linux-riscv , "linux-kernel@vger.kernel.org List" Cc: Palmer Dabbelt , Bjorn Topel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I encountered the following issue while booting 5.8-rc1 on Qemu for RV64. I added additional dump_stack and observed that it's happening in bpf free path. It happens always if CONFIG_DEBUG_VM is enabled. VM_BUG_ON_MM is compiled away without that. ------------------------------------------------------------------------ forked to background, child pid 113 [ 10.328850] CPU: 3 PID: 51 Comm: kworker/3:1 Not tainted 5.8.0-rc1-dirty #732 [ 10.331739] Workqueue: events bpf_prog_free_deferred [ 10.334133] Call Trace: [ 10.338039] [] walk_stackframe+0x0/0xa4 [ 10.339988] [] show_stack+0x2e/0x3a [ 10.340902] [] dump_stack+0x72/0x8c [ 10.341451] [] mmap_assert_locked.part.13+0x14/0x1c [ 10.342131] [] walk_page_range_novma+0x0/0x4e [ 10.342973] [] set_direct_map_invalid_noflush+0x66/0x6e [ 10.343917] [] __vunmap+0xe8/0x212 [ 10.344680] [] __vfree+0x22/0x6e [ 10.345270] [] vfree+0x34/0x56 [ 10.345834] [] __bpf_prog_free+0x2c/0x36 [ 10.346529] [] bpf_prog_free_deferred+0x74/0x8a [ 10.347394] [] process_one_work+0x13a/0x272 [ 10.348239] [] worker_thread+0x50/0x2e4 [ 10.348900] [] kthread+0xfc/0x10a [ 10.349470] [] ret_from_exception+0x0/0xc [ 10.354405] mm ffffffe001018600 mmap 0000000000000000 seqnum 0 task_size 0 [ 10.354405] get_unmapped_area 0000000000000000 [ 10.354405] mmap_base 0 mmap_legacy_base 0 highest_vm_end 0 [ 10.354405] pgd ffffffe001074000 mm_users 2 mm_count 1 pgtables_bytes 8192 map_count 0 [ 10.354405] hiwater_rss 0 hiwater_vm 0 total_vm 0 locked_vm 0 [ 10.354405] pinned_vm 0 data_vm 0 exec_vm 0 stack_vm 0 [ 10.354405] start_code ffffffe000200000 end_code ffffffe00084acc2 start_data 0 end_data ffffffe00106dfe4 [ 10.354405] start_brk 0 brk ffffffe0010bd6d0 start_stack 0 [ 10.354405] arg_start 0 arg_end 0 env_start 0 env_end 0 [ 10.354405] binfmt 0000000000000000 flags 0 core_state 0000000000000000 [ 10.354405] ioctx_table 0000000000000000 [ 10.354405] exe_file 0000000000000000 [ 10.354405] tlb_flush_pending 0 [ 10.354405] def_flags: 0x0() [ 10.369325] ------------[ cut here ]------------ [ 10.370763] kernel BUG at include/linux/mmap_lock.h:81! [ 10.375235] Kernel BUG [#1] [ 10.377198] Modules linked in: [ 10.378931] CPU: 3 PID: 51 Comm: kworker/3:1 Not tainted 5.8.0-rc1-dirty #732 [ 10.380179] Workqueue: events bpf_prog_free_deferred [ 10.381270] epc: ffffffe0002db4d4 ra : ffffffe0002db4d4 sp : ffffffe3eaea7c70 [ 10.382561] gp : ffffffe00106d950 tp : ffffffe3ef752f80 t0 : ffffffe0010836e8 [ 10.383996] t1 : 0000000000000064 t2 : 0000000000000000 s0 : ffffffe3eaea7c90 [ 10.385119] s1 : ffffffe001018600 a0 : 0000000000000289 a1 : 0000000000000020 [ 10.386099] a2 : 0000000000000005 a3 : 0000000000000000 a4 : ffffffe001012758 [ 10.387294] a5 : 0000000000000000 a6 : 0000000000000102 a7 : 0000000000000006 [ 10.388265] s2 : ffffffe3f00674c0 s3 : ffffffe00106e108 s4 : ffffffe00106e100 [ 10.389250] s5 : ffffffe00106e908 s6 : 0000000000000000 s7 : 6db6db6db6db6db7 [ 10.390272] s8 : 0000000000000001 s9 : ffffffe00021a4f8 s10: ffffffffffffffff [ 10.391293] s11: ffffffe3f0066600 t3 : 000000000001a7a8 t4 : 000000000001a7a8 [ 10.392314] t5 : 0000000000000000 t6 : ffffffe00107b76b [ 10.393096] status: 0000000000000120 badaddr: 0000000000000000 cause: 0000000000000003 [ 10.397755] ---[ end trace 861659596ac28841 ]--- --------------------------------------------------------------------------------------------------- I haven't had the chance to bisect to figure out which commit caused the issue. Just wanted to check if it is a known issue already. Regards, Atish