Received: by 10.192.165.156 with SMTP id m28csp837566imm; Wed, 11 Apr 2018 08:02:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+qO81Fhs3Vsf3dDHKXDpd0I+t+iVo+s5p1FNhcua9l8nHIuWxBPpsTSxRtTdjPGEXg3wrp X-Received: by 10.98.93.20 with SMTP id r20mr4337948pfb.53.1523458931602; Wed, 11 Apr 2018 08:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523458931; cv=none; d=google.com; s=arc-20160816; b=izA3a2Zr10JQ1jv7WwCmVv7bZZ7aNYJjKZDLckEznnUm/InCX60PegnQIW2oqEefQz 8wyO7oliMegvrqmoy2woB8BjycepQvPP6hR+Ih6tRcWxBvpnGLbD1KBQkxrLRukqgywm W72LGoe8cWG9g0ZwQIeveUZplNFlEhjLfWSC5RQT0Z6OOM0MjMePP3xo2SYcYGZpkURS ZNnp+58rBc+K9/NfLY1JDtJc7WtA19MSXPtJsLLNYqAswHaB0mwvWi+mKw2hqL9quasJ n+xJfWrfZnOYOET+XfT4e3CmsKWxuTIeEbi8u5o8UV0xQB/ehShkREAdNlaXl2XeFOv1 vYmw== 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=y714aS9PQh5eMjjQDObexCbC+C8PapzIXlsmnuKv9KI=; b=SzwKE8m+9LXNN80toRCRxQw0v0xz2cPqhipYgIyQDWKSUSrN3HLPKeBnjN8Y0GHWms hPcYQZgeu9OjBtIfI27sN4u8nYPNyDZDlYnfXo5i/XpiAry0PVa+ugAClZtZsIcx10qL 7sX7Tq07A2yT2oLF5w54h9zH6BzbRKXmd/vfkYkkJVZHtPEPP0vkVrl2uZ3+Yqgt+aBJ zxMwfY9z4q4Nn9p3XMq12mCSjsW6+VENdvO7O2Sfh5wsYThwy3r4SviVdfJ7RHV6G6ef B2MUNMDdWbT77lAd5nIRrPo47P9YPALI+hw0H5ElOOE2nBBWTMHkIchs2XONwO0OPANF oYUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=EB8NZvlm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m37-v6si1255744pla.346.2018.04.11.08.01.26; Wed, 11 Apr 2018 08:02:11 -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=fail header.i=@gmail.com header.s=20161025 header.b=EB8NZvlm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753899AbeDKO4h (ORCPT + 99 others); Wed, 11 Apr 2018 10:56:37 -0400 Received: from mail-yw0-f175.google.com ([209.85.161.175]:40557 "EHLO mail-yw0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752894AbeDKO4e (ORCPT ); Wed, 11 Apr 2018 10:56:34 -0400 Received: by mail-yw0-f175.google.com with SMTP id r145so640567ywe.7; Wed, 11 Apr 2018 07:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=y714aS9PQh5eMjjQDObexCbC+C8PapzIXlsmnuKv9KI=; b=EB8NZvlmihZGO9hH1nWrEUTmK0DDPhs4pVrgb0L5COLlcPexQBCWZNbs4hO6WuVhE4 M7+YVtdktUMwWFQqarEEJnUyCWVJNAWZybOI0wzdbBLfjP7+rNmcxXCne4Wm7rTyUqW3 kKfyfIK2pFcFPtNL2sx7j5O0tHzYrXd5JVU+l9I+n/YZbc0XR4w/uoFtjlk/OOPtVmap OQMr1vnLPGaAQ08X5JBEEE+ghCeAdEQjx62/WDlLVoo91wbV5BFJVD3cRqHB94Xd1m5v uZoUChbbwFHT9AAL+0QKLxN5kGojB0NnDTknsHxUyompOjL0eDGNrN6/FK9fdj4o+NEV WYNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=y714aS9PQh5eMjjQDObexCbC+C8PapzIXlsmnuKv9KI=; b=Spm+DSGCnyPifgHnDmXhUadxKxqRpq8ftr0++UJ3vzxoh6jAju0pNqEpwe0Ip+ICoj QOBrOGIaAxdNx/FWhaWnaUQy12yYWElgsmPvK0mSBMniME2do3jp5uQDNcijFmeAADYN 9fkRPJbtPwYqWw4nKqbMogmJ1J2QZhzmqueBj04b4EaheviAbaUxYKpyJd2/t8WnJYdU 1xapGcW3YBLTuVfRXpQzgPcXE8tbqKWstVF1plkDd+DqeaayOBxLjSb9rZRIAu6Uri9M 9gfMPHRndIlPCE8pPVTQA7BufXjDMPdWCkQrgZxQ5Ls8Zo+JSdUEhXBqDfjgHNWisHcR gUxw== X-Gm-Message-State: ALQs6tB20NSNkDil/1nKGV8U81Xogzb9Iw6wy1G91E3taceZbe+u7WgR xaVHxpg1E10PzhvBNZ31CzHCTQAB X-Received: by 10.129.174.74 with SMTP id g10mr2186149ywk.257.1523458594223; Wed, 11 Apr 2018 07:56:34 -0700 (PDT) Received: from localhost ([2620:10d:c091:200::1:e6ed]) by smtp.gmail.com with ESMTPSA id 1sm477782ywt.74.2018.04.11.07.56.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 07:56:33 -0700 (PDT) Date: Wed, 11 Apr 2018 07:56:32 -0700 From: Tejun Heo To: Alexandru Moise <00moses.alexander00@gmail.com>, Joseph Qi , Bart Van Assche 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 Subject: Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release Message-ID: <20180411145632.GK793541@devbig577.frc2.facebook.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> <20180411144616.GI793541@devbig577.frc2.facebook.com> <20180411145123.GJ793541@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180411145123.GJ793541@devbig577.frc2.facebook.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, again. On Wed, Apr 11, 2018 at 07:51:23AM -0700, Tejun Heo wrote: > Oh, it wasn't Joseph's change. It was Bart's fix for a problem > reported by Joseph. Bart, a063057d7c73 ("block: Fix a race between > request queue removal and the block cgroup controller") created a > regression where a request_queue can be destroyed with blkgs still > attached. The original report is.. > > http://lkml.kernel.org/r/20180407102148.GA9729@gmail.com And looking at the change, it looks like the right thing we should have done is caching @lock on the print_blkg side and when switching locks make sure both locks are held. IOW, do the following in blk_cleanup_queue() spin_lock_irq(lock); if (q->queue_lock != &q->__queue_lock) { spin_lock(&q->__queue_lock); q->queue_lock = &q->__queue_lock; spin_unlock(&q->__queue_lock); } spin_unlock_irq(lock); Otherwise, there can be two lock holders thinking they have exclusive access to the request_queue. Thanks. -- tejun