Received: by 10.192.165.156 with SMTP id m28csp804772imm; Wed, 11 Apr 2018 07:32:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx49rxReJWKz/vD9YNu6+BiPfqxcuiNO6feLgczaxcxd8eY/QqfMkiUt8qU3DZgeyA37z9Wr0 X-Received: by 10.99.111.3 with SMTP id k3mr3705325pgc.135.1523457153373; Wed, 11 Apr 2018 07:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523457153; cv=none; d=google.com; s=arc-20160816; b=DPhNIVIoVrVk6dzkfcTh/E1bcEOeP9wFRwYvHFmqHt5tXI/UVFyHB0SnXAemGnrkI+ jZtPeHTP/KgbZHI21nRwcmHPUP2+L6ixpNfUniYHodDb1Td++vcTeaQzFdQsaZZ8xIhW scqjNYof//wb1/MYffJNc+HKIXDzKiQecqPKWD/QsZxNTrAReLlAjP2tVPl82XwhNX8+ mWBCcWxBNk2LcWtV7wF3Lx950HzOgO/X6MAtdhC1ORXY4jwQYnhcNErLbvTmmAnt+uC3 dJ1e6+BBHB2IgfYNiupLQA31ogbWBb9whixg8/DkQa2ndhIEeEJBIixV9UQIxX+axbOl pFTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=KB5hHa162fY3xCX1XEFf7ZV0Hlf45VySxWrE7tBPhUo=; b=FgtWpLK3iC+MmdbguIPYy3DYCrQ3bIKbytR4UeIbgeLGDRdSEIqHJWNdjTZDPmdGDv xSJzcv88rXTbleUpNVxt4HizW3DEvV6SNNBbnPE5vpo9FeKS7X7no4sRW2IxeIRog46E Nl4Jcs1UAkWVG36GrzR0y/uEbw+9nAKhnca+miigZh+/uNQPNm5e1Sb3SYvLQQxjHU7q lQFBAa/GhiMjvRSm688c6r/cpQ2xlxHzEEGwy4KvsZsY9w+oQExeekdM8BvaTAYs/Pom T/yU8pWlCBWrpykxD0ymS84VgHWCXwPUbqJcLuG0SjeU5cT2t5sEBzoU9WFgFujbXK1m 0Thg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OXAaRxNq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si825067pgn.704.2018.04.11.07.31.55; Wed, 11 Apr 2018 07:32:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OXAaRxNq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348AbeDKO3G (ORCPT + 99 others); Wed, 11 Apr 2018 10:29:06 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:43908 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbeDKO3E (ORCPT ); Wed, 11 Apr 2018 10:29:04 -0400 Received: by mail-wr0-f196.google.com with SMTP id y7so1984058wrh.10; Wed, 11 Apr 2018 07:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KB5hHa162fY3xCX1XEFf7ZV0Hlf45VySxWrE7tBPhUo=; b=OXAaRxNq4XOecNAo3x6m/iPRXDTRMUtO6cEOUSYhwY+ahaB+nRJdNup1nE6cWVRx/c E/fsTXjK9YlBkkLmhfAobkBtn53doKWup1cIvZNvAeWWnpp5dS8bkJEwo0GTcEwAiqzE fny+0TUUChceHNCBw6axTgi8vOOt0wlSohA5HmGijqAXiTJVcyfSlxN2a5RT3Xx0Dekl NCQhoBdqn/hXeycy70fvtzkGAu1rmsnkYBXbGcI/zhbL+qBL/LTtNi39FA4jj+VIXRxO OUF71Nw3gb1cWjP81SDu9s2VVC+AMzDgp+MCDozfSsEfMbu0IS/eD5Cs7R61s9hVfXXA oJ+g== 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=KB5hHa162fY3xCX1XEFf7ZV0Hlf45VySxWrE7tBPhUo=; b=Y+qwJ7KpFPHY8bl53WHva7wdpxevg3hkNWf9F9dXyhow8RoR3gdggl9VxhljUZdlea 0zwdD6J4f9WQ52lQqLlRfuUJWy2y8ieOAgRFVkljP8VBWoHX5F13AdUH4JCf05AdABVF xDzSHfy2APjhMYzuElzmKfqpoY2gF3uRKWQujKXjEp0thbjnRGkTHABP4u48EV32pgtV R8tJmTJNzpfF/7L0vVuAMxAUBvace83XinxptZK7VBFThgvrLqNW6FkgzUyXoaKZbAxa 0o3k5Lc7N0sQs/QcDSS08Uh5iGBMZ3ImLsuUz2FC0xpqHGNx2Vjz9EzdUcbB3MOOv8rq XThQ== X-Gm-Message-State: ALQs6tDNmHX4Qm0dwwCbTcrz10VlQMUElLUphEmp3hFpK4aG9jb4jJmT MC9FEN/yySaGxr9KsOslS4Q= X-Received: by 10.223.135.111 with SMTP id 44mr3363459wrz.117.1523456943130; Wed, 11 Apr 2018 07:29:03 -0700 (PDT) Received: from gmail.com (51B6C0F5.dsl.pool.telekom.hu. [81.182.192.245]) by smtp.gmail.com with ESMTPSA id q14sm898218wre.10.2018.04.11.07.29.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 07:29:02 -0700 (PDT) Date: Wed, 11 Apr 2018 16:28:59 +0200 From: Alexandru Moise <00moses.alexander00@gmail.com> To: Tejun Heo Cc: axboe@kernel.dk, shli@fb.com, nborisov@suse.com, arnd@arndb.de, gregkh@linuxfoundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Joseph Qi Subject: Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release Message-ID: <20180411142859.GB2322@gmail.com> References: <20180407102148.GA9729@gmail.com> <20180409220938.GI3126663@devbig577.frc2.facebook.com> <20180411101242.GA2322@gmail.com> <20180411142019.GG793541@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180411142019.GG793541@devbig577.frc2.facebook.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 11, 2018 at 07:20:19AM -0700, Tejun Heo wrote: > Hello, > > On Wed, Apr 11, 2018 at 12:12:56PM +0200, Alexandru Moise wrote: > > > But we already do this through calling blkcg_exit_queue() from > > > __blk_release_queue(). What's missing? > > > > Hi, > > > > It might be the jetlag but I can't see how you end up calling > > blkcg_exit_queue() from __blk_release_queue(). > > > > As I see it the only way to reach blkcg_exit_queue() is from > > blk_cleanup_queue(), which I don't see anywhere in __blk_release_queue(). > > > > I suspect that I'm just fixing a corner case though and > > the general case is what you describe or similar. > > Ah, that changed recently. Can you please check out the current > upstream git master? > > Thanks. > Just did, without my patch I see this crash: [ 0.759999] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 4.16.0-ARCH+ #81 [7/1949] [ 0.759999] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/204 [ 0.759999] RIP: 0010:pi_init+0x23f/0x2f0 [ 0.759999] RSP: 0000:ffffc90000197d90 EFLAGS: 00010246 [ 0.759999] RAX: 0000000000000000 RBX: 0000000000000020 RCX: 0000000000000038 [ 0.759999] RDX: 0000000000000001 RSI: 0000000000000001 RDI: 0000000000000000 [ 0.759999] RBP: ffffc90000197e18 R08: 00000000ffffffff R09: 00000000ffffffff [ 0.759999] R10: ffffea0000eda600 R11: ffff88003b69f164 R12: ffffffff82e2d740 [ 0.759999] R13: 00000000ffffffff R14: 0000000000000000 R15: 0000000000000000 [ 0.759999] FS: 0000000000000000(0000) GS:ffff88003e500000(0000) knlGS:0000000000000000 [ 0.759999] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.759999] CR2: 0000000000000008 CR3: 0000000002209001 CR4: 00000000000606e0 [ 0.759999] Call Trace: [ 0.759999] pf_init+0x1db/0x3be [ 0.759999] ? pcd_init+0x4e8/0x4e8 [ 0.759999] do_one_initcall+0x9e/0x1b0 [ 0.759999] ? do_early_param+0x97/0x97 [ 0.759999] kernel_init_freeable+0x259/0x2fd [ 0.759999] ? rest_init+0xd0/0xd0 [ 0.759999] ? syscall_slow_exit_work+0x1c/0x160 [ 0.759999] kernel_init+0xe/0x100 [ 0.759999] ret_from_fork+0x3a/0x50 [ 0.759999] Code: 75 6a 49 8b 06 48 8b 40 78 48 85 c0 74 08 4c 89 f7 e8 46 76 51 00 83 c3 01 3b 5d a8 7d 0d 49 [ 0.759999] RIP: pi_init+0x23f/0x2f0 RSP: ffffc90000197d90 [ 0.759999] CR2: 0000000000000008 [ 0.759999] ---[ end trace 12004f267bb8bf7d ]--- [ 0.766666] BUG: unable to handle kernel NULL pointer dereference at 00000000000001b4 [ 0.763350] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 [ 0.763350] [ 0.766666] PGD 0 P4D 0 [ 0.766666] Oops: 0000 [#2] PREEMPT SMP [ 0.766666] CPU: 0 PID: 6 Comm: kworker/u12:0 Tainted: G D 4.16.0-ARCH+ #81 [ 0.766666] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/20$ [ 0.766666] Workqueue: nvme-reset-wq nvme_reset_work [ 0.766666] RIP: 0010:blk_queue_flag_set+0xf/0x40 [ 0.766666] RSP: 0000:ffffc900001bfcb0 EFLAGS: 00010246 [ 0.766666] RAX: ffff88003b698000 RBX: 0000000000000000 RCX: 0000000000000000 [ 0.766666] RDX: ffff88003b698000 RSI: fffffffffffffff4 RDI: 000000000000001c [ 0.766666] RBP: ffffc900001bfcc0 R08: 0000000000000000 R09: 0000000000000000 [ 0.766666] R10: ffffea0000eaa980 R11: ffffffff814e0970 R12: 000000000000001c [ 0.766666] R13: 0000000000000000 R14: 0000000000000000 R15: ffff88003aad8010 [ 0.766666] FS: 0000000000000000(0000) GS:ffff88003e400000(0000) knlGS:0000000000000000 [ 0.766666] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.766666] CR2: 00000000000001b4 CR3: 0000000002209001 CR4: 00000000000606f0 [ 0.766666] Call Trace: [ 0.766666] blk_mq_quiesce_queue+0x23/0x80 [ 0.766666] nvme_dev_disable+0x34f/0x480 [ 0.766666] ? nvme_irq+0x50/0x50 [ 0.766666] ? dev_warn+0x64/0x80 [ 0.766666] nvme_reset_work+0x13de/0x1570 [ 0.766666] ? __switch_to_asm+0x34/0x70 [ 0.766666] ? __switch_to_asm+0x40/0x70 [ 0.766666] ? _raw_spin_unlock_irq+0x15/0x30 [ 0.766666] ? finish_task_switch+0x156/0x210 [ 0.766666] process_one_work+0x20c/0x3d0 [ 0.766666] worker_thread+0x216/0x400 [ 0.766666] kthread+0x125/0x130 [ 0.766666] ? process_one_work+0x3d0/0x3d0 [ 0.766666] ? __kthread_bind_mask+0x60/0x60 [ 0.766666] ret_from_fork+0x3a/0x50 With the patch the crash goes away, Thanks, ../Alex > -- > tejun