Received: by 10.192.165.156 with SMTP id m28csp1119730imm; Wed, 11 Apr 2018 12:49:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx485cnuuYc3Pm5RrJYYxJEjcQlAYimt6CzyjncKUDlRxUNVn+90nTJTrS16SilwkqyHhdSSv X-Received: by 10.99.95.78 with SMTP id t75mr4434059pgb.330.1523476141043; Wed, 11 Apr 2018 12:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523476141; cv=none; d=google.com; s=arc-20160816; b=fpkcLTSIipaAHRKr0L1V1fYgNwB+o99GQzc38bJHdvKnxH0S+tt50vDtrmEgOMBXQD 9tPD8izK0bOMMpx71MhEEmZDUpCfAC9mRnb1depkxiKkK4Df7pCnlvnkT0Yx2nD50FaE xvwXRQJkGsktqm17x+m2fm97iTX2Ou0nXFsiDWopDFdgNa0wWaVsByBFXdURv3Odey7c vuuB5FzDxUPsFKt3H4zyiN5cCkMArYrFWOfNHM9YF0dV/5N0Wg/dciAvxBSIMJoE47cs IqIQocfb1LppvOCAI91LmdP5COUVEdo4/EhCM+jAlFjpFazvWEIlUo8U7U0taOc9PHg6 whzQ== 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=2dODIrZDtvEsVsMrBEwrjIV6E8WtmuB6ke3ZGt8LjqU=; b=IGkakGbrGQlaMDohBVDRIv9WaZ5518Ha1mJWI0Ej0vD6FLKx14A6yNf6+cjNuLwB4T F5XmmBwV3tT1tAC7/lmBjjgdKlCWFrKinRXABJeStpT7Y34rZkzGHXucuhS5VvC/v4ld B1J5k0qG0NxAGoej31XKPlFZvchoZn3nvxRfbaX92dI2OnujI3EzpJ2ak/sApUuACe5H 7hPjtHGF83ymYfUrVb2uO0N/CBw8sXHcWpUBVHbQMDVOVLw+ehw2XV0MTUXJxB23lskc m2Js6jARsUA16zBFzzUjCvXrBpCcj0jD+Eih3PQBlTblRUDXORWtog19HFJX2DPpkDwh ImHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y5NBLlHb; 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 a91-v6si1771409pla.524.2018.04.11.12.48.24; Wed, 11 Apr 2018 12:49:01 -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=Y5NBLlHb; 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 S1756764AbeDKTAm (ORCPT + 99 others); Wed, 11 Apr 2018 15:00:42 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37543 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756704AbeDKTAi (ORCPT ); Wed, 11 Apr 2018 15:00:38 -0400 Received: by mail-wm0-f66.google.com with SMTP id l16so1849389wmh.2; Wed, 11 Apr 2018 12:00:37 -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=2dODIrZDtvEsVsMrBEwrjIV6E8WtmuB6ke3ZGt8LjqU=; b=Y5NBLlHbHPfH0jCnGsBz7T8IwRtsDYGQRjtUftZfL/3EVxKOqiXUkOyGZpU7PGiJkJ sR7Goul3EwRR8U+xTp+acjB0VGHDnBXxD9jmlior/7opStShH3nz3egvAsidv+Y/y6cl nUpz1kGFlgl09aEVq6UaeLDrEd0sXoYrvvXA7gWEFj2YvRCfx84a8ONZH/Pm0G9JMsxB eX/gomkv3oZjKzXgGzFHHa1CeRUQlo8s/mLGqxDNqeyN44cdGu0RKLMIovbS/r4omoWY chOdVmH0Z8yTbCl0Hjzz9wkdMwk8ed3ROit8z3wnS79g99F1+QU01IsawxCg4qtBVVt7 P6/Q== 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=2dODIrZDtvEsVsMrBEwrjIV6E8WtmuB6ke3ZGt8LjqU=; b=leINsB7shvEI6DoLZZ6xAiHmNGi6wzCqy7pRmZy9Lm6n2kf6mJuDmT//rwDDHIh380 zchblUg1rVTgwLvoyCRk99ejl3PrkYRJC1lvqw0STqKfc8Yv3mPOhzp0RAEksUsqqw1/ 40lc14OLxX5ZbBXsLWtfcZkPSTTONqAnlpLoog/X8Nkn56WbbpWj7ihFHVYQdHz7BIfG TyP+GX7AZk4mB9G0I7Xt3qfIHCUAYcQ1AbUvwOwGoJceU5RJKJVosHHRkUMHfKk4xbGj Wjprw19jg9WRBj4j4hiRhYDqgEuwbUF+X6AkjUZeisSGeIeP0tcZvHAbIaGmtvhkBhmz Wjjg== X-Gm-Message-State: ALQs6tBthdZsGADT1yUgH0/9BhHzM3eWZPqjMbMBxO0coQzsipNXD2v8 zNybcBMypcvsyxCaU6qMAt4= X-Received: by 10.28.34.7 with SMTP id i7mr3225940wmi.97.1523473237028; Wed, 11 Apr 2018 12:00:37 -0700 (PDT) Received: from gmail.com (51B6C0F5.dsl.pool.telekom.hu. [81.182.192.245]) by smtp.gmail.com with ESMTPSA id p197sm1069703wme.43.2018.04.11.12.00.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 12:00:35 -0700 (PDT) Date: Wed, 11 Apr 2018 21:00:27 +0200 From: Alexandru Moise <00moses.alexander00@gmail.com> To: Bart Van Assche Cc: "tj@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "nborisov@suse.com" , "axboe@kernel.dk" , "shli@fb.com" , "gregkh@linuxfoundation.org" , "joseph.qi@linux.alibaba.com" , "arnd@arndb.de" Subject: Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release Message-ID: <20180411190027.GA21274@gmail.com> References: <20180407102148.GA9729@gmail.com> <20180409220938.GI3126663@devbig577.frc2.facebook.com> <20180411101242.GA2322@gmail.com> <20180411142019.GG793541@devbig577.frc2.facebook.com> <20180411142859.GB2322@gmail.com> <5fafe1cbf6b0111448a81005c1c16feee24a99ad.camel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5fafe1cbf6b0111448a81005c1c16feee24a99ad.camel@wdc.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 03:54:53PM +0000, Bart Van Assche wrote: > On Wed, 2018-04-11 at 16:28 +0200, Alexandru Moise wrote: > > [ 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 > > Hello Alexandru, > > What made you look at cgroups? In the above register dump I see that %rbx == NULL. > I think that means that the queue pointer argument of blk_queue_flag_set() is NULL. > The NVMe initiator driver should never pass a NULL pointer to blk_mq_quiesce_queue(). > Please ask the NVMe driver maintainers for their opinion on the linux-nvme mailing > list. > > Thanks, > > Bart. The %rbx == NULL is only a symptom of the cgroup mishandling, perhaps we could improve error handling in the NVMe driver, but I can say that about a lot of block drivers actually, perhaps I will write some patches in the future to improve the error handling. But the root cause of it is in blkcg_init_queue() when blkg_create() returns an ERR ptr, because it tries to insert into a populated index into blkcg->blkg_tree, the entry that we fail to remove at __blk_release_queue(). Thanks, ../Alex > > >