Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754576AbbGIVeR (ORCPT ); Thu, 9 Jul 2015 17:34:17 -0400 Received: from mail-yk0-f169.google.com ([209.85.160.169]:36369 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752792AbbGIVeI (ORCPT ); Thu, 9 Jul 2015 17:34:08 -0400 Date: Thu, 9 Jul 2015 17:34:05 -0400 From: Tejun Heo To: Akinobu Mita Cc: linux-kernel@vger.kernel.org, Jens Axboe , Ming Lei Subject: Re: [PATCH v2 5/6] blk-mq: fix freeze queue race Message-ID: <20150709213405.GB18734@mtj.duckdns.org> References: <1435847397-724-1-git-send-email-akinobu.mita@gmail.com> <1435847397-724-6-git-send-email-akinobu.mita@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435847397-724-6-git-send-email-akinobu.mita@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 923 Lines: 28 On Thu, Jul 02, 2015 at 11:29:56PM +0900, Akinobu Mita wrote: > There are several race conditions while freezing queue. ... > Also, percpu_ref_reinit() and percpu_ref_kill() must not be executed > at the same time. Because both functions could call > __percpu_ref_switch_to_percpu() which adds the bias value and > initialize percpu counter. > > Fix those races by serializing with per-queue mutex. > > Signed-off-by: Akinobu Mita > Cc: Jens Axboe > Cc: Ming Lei Yeap, all of the kill/reinit/switch mode functions assume caller side synchronization. Acked-by: Tejun Heo Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/