Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3759049imm; Mon, 18 Jun 2018 03:40:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKImJlTjGjAXmz6ajs5b/o0bHA3KkfC/C2iknYd2US3X0jaXshnBXI+aM3W+CzvGKyPcaQYY X-Received: by 2002:a65:46cb:: with SMTP id n11-v6mr10323833pgr.193.1529318400404; Mon, 18 Jun 2018 03:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529318400; cv=none; d=google.com; s=arc-20160816; b=GR9CecU7QXIaVBmUDyRNP9tNuUwgf0/ZMmPstfvKrXhjhEqyN1O07Kz4TvNI0gyUq+ SGydyRbhn8tJkmZu03frRDowOTuYUlZ+VJFmA56U07uINfE98sCAGeXaynWRv80cHbM4 qD9mAwUtedDG9z+lu43e3kR7TbnG+7oLuS9Iu5QaEg0CjeOBQmfNDfgTQXK8suNkTOtD RRPsAoN1rhF+XyLEyDpmCYy3Hnq7yOS4O6jtp87/E98t84xTHFgGjxf2sckbyBXeXf7z /aQ+NhtENwDGl2pZT05NfuMh4eh2vfGyMjxAPexOC5lIIk54vemIw6nPqZdi4bJlZpS8 Nu2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EEPZI8mq0cGS6trjivVhT46BIhq0nTMnTOqDBWhYf6k=; b=etkVEwfzdoMpgEa/WlVA6Yu13brbPtNIMVpccrEK0ghchXiHZugpehL5e4OQeM/vY9 WPjR9QXg1ztbh0wB+3AtxxRixEv9KiamUlHamybNFvX5LM+ZQQx/cg8vT9Kmwj8dnESd eWZgw1l12fGWwBsNJiOQ3wYjS4EADHqp8EEl0u80QyGgoNSMKdPmc5TIGJyZTYSgdU55 RzCAw+AASnmceBvGpNJQifHTinCra9gXiVYLAmS+/k9+MqipYzEsnnOdNkfYpKi7vVs7 4ijeDpvZNyvlXqeiFyFESGYmus47eMih/lxN2ySQpDTcRNdPEG19ki191hZ3e2FyATQy NYww== ARC-Authentication-Results: i=1; mx.google.com; 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 p14-v6si11773551pgv.255.2018.06.18.03.39.46; Mon, 18 Jun 2018 03:40:00 -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; 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 S934518AbeFRIQl (ORCPT + 99 others); Mon, 18 Jun 2018 04:16:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53084 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934284AbeFRIQi (ORCPT ); Mon, 18 Jun 2018 04:16:38 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 15FE2C77; Mon, 18 Jun 2018 08:16:37 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiang Biao , Wen Yang , Tejun Heo , Jens Axboe , Sasha Levin Subject: [PATCH 4.16 041/279] blkcg: dont hold blkcg lock when deactivating policy Date: Mon, 18 Jun 2018 10:10:26 +0200 Message-Id: <20180618080610.499261582@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiang Biao [ Upstream commit 946b81da114b8ba5c74bb01e57c0c6eca2bdc801 ] As described in the comment of blkcg_activate_policy(), *Update of each blkg is protected by both queue and blkcg locks so that holding either lock and testing blkcg_policy_enabled() is always enough for dereferencing policy data.* with queue lock held, there is no need to hold blkcg lock in blkcg_deactivate_policy(). Similar case is in blkcg_activate_policy(), which has removed holding of blkcg lock in commit 4c55f4f9ad3001ac1fefdd8d8ca7641d18558e23. Signed-off-by: Jiang Biao Signed-off-by: Wen Yang CC: Tejun Heo Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- block/blk-cgroup.c | 5 ----- 1 file changed, 5 deletions(-) --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1367,17 +1367,12 @@ void blkcg_deactivate_policy(struct requ __clear_bit(pol->plid, q->blkcg_pols); list_for_each_entry(blkg, &q->blkg_list, q_node) { - /* grab blkcg lock too while removing @pd from @blkg */ - spin_lock(&blkg->blkcg->lock); - if (blkg->pd[pol->plid]) { if (pol->pd_offline_fn) pol->pd_offline_fn(blkg->pd[pol->plid]); pol->pd_free_fn(blkg->pd[pol->plid]); blkg->pd[pol->plid] = NULL; } - - spin_unlock(&blkg->blkcg->lock); } spin_unlock_irq(q->queue_lock);