Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754400AbbGIVh7 (ORCPT ); Thu, 9 Jul 2015 17:37:59 -0400 Received: from mail-yk0-f170.google.com ([209.85.160.170]:33279 "EHLO mail-yk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753978AbbGIVhu (ORCPT ); Thu, 9 Jul 2015 17:37:50 -0400 Date: Thu, 9 Jul 2015 17:37:47 -0400 From: Tejun Heo To: Ming Lei Cc: Akinobu Mita , linux-kernel@vger.kernel.org, Jens Axboe Subject: Re: [PATCH v2 5/6] blk-mq: fix freeze queue race Message-ID: <20150709213747.GC18734@mtj.duckdns.org> References: <1435847397-724-1-git-send-email-akinobu.mita@gmail.com> <1435847397-724-6-git-send-email-akinobu.mita@gmail.com> <20150709145510.6b8e21a2@tom-T450> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150709145510.6b8e21a2@tom-T450> 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: 852 Lines: 22 On Thu, Jul 09, 2015 at 02:55:10PM +0800, Ming Lei wrote: > This patch looks fine since at least changing DEAD state of percpu ref > state should have been synchronized by caller. > > Also looks __percpu_ref_switch_to_percpu() need to check if the refcount > becomes dead after current switching, and seems something like following > is needed: Hmmm... but the caller is responsible for synchronization for these operations. If the state changes while waiting, it indicates a synchronization bug and testing it one more time is kinda weird. What if it changes right after that test? 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/