From patchwork Mon Mar 19 18:01:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10293703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C709660386 for ; Mon, 19 Mar 2018 18:01:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B731D29473 for ; Mon, 19 Mar 2018 18:01:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB460294C7; Mon, 19 Mar 2018 18:01:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E73F2949C for ; Mon, 19 Mar 2018 18:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965664AbeCSSBF (ORCPT ); Mon, 19 Mar 2018 14:01:05 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:51908 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934863AbeCSSBC (ORCPT ); Mon, 19 Mar 2018 14:01:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1521482462; x=1553018462; h=from:to:cc:subject:date:message-id; bh=30XDP9CNuQbCmhVqMq9yQKMlABvbe/RG+tCodxS0zCY=; b=Enl8EfuGpzxpmZ5lo1P+jICHoVc1g6cG0NhMtWhbvXmxXe1zXN6wioRJ C9rP7ZlLkvl47WzCZ3afQzk15V00Ykjw2hpn0ECe2Ophk7qWiyh9bkPGc mnhCVsmhXpG9T2WP5n9/GydzeN40b1qzUn/GmVX8klLqa+jhK4WnlCu0s cAauDaW4WIOb0k+nxjoApeV2EEEg+tb6EwmFXDtjQqkNYGJFhF9J8yBGY 99mdkNX/Rce6RqZMcxfEiM79zrN76qqsxVdX2AarXvAL3ZlMVnOOeGAm0 thmNU+5zMaLFxhJ7zsRT+vztymglUHNms7uFCgPsAId7Zrfq95ys56pZX w==; X-IronPort-AV: E=Sophos;i="5.48,331,1517846400"; d="scan'208";a="74580558" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 20 Mar 2018 02:01:01 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 19 Mar 2018 10:54:26 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip02.wdc.com with ESMTP; 19 Mar 2018 11:01:02 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Hannes Reinecke , Ming Lei , Johannes Thumshirn , Tejun Heo , Oleksandr Natalenko , Martin Steigerwald , stable@vger.kernel.org Subject: [PATCH] block: Change a rcu_read_{lock, unlock}_sched() pair into rcu_read_{lock, unlock}() Date: Mon, 19 Mar 2018 11:01:00 -0700 Message-Id: <20180319180100.7012-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since neither the RCU-protected code in blk_queue_enter() nor blk_queue_usage_counter_release() sleeps, regular RCU protection is sufficient. Note: scsi_device_quiesce() does not have to be modified since it already uses synchronize_rcu(). Reported-by: Tejun Heo Fixes: 3a0a529971ec ("block, scsi: Make SCSI quiesce and resume work reliably") Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Ming Lei Cc: Christoph Hellwig Cc: Johannes Thumshirn Cc: Tejun Heo Cc: Oleksandr Natalenko Cc: Martin Steigerwald Cc: stable@vger.kernel.org # v4.15 Acked-by: Tejun Heo --- block/blk-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 5e88c579e896..a0f675f84f86 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -917,7 +917,7 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) bool success = false; int ret; - rcu_read_lock_sched(); + rcu_read_lock(); if (percpu_ref_tryget_live(&q->q_usage_counter)) { /* * The code that sets the PREEMPT_ONLY flag is @@ -930,7 +930,7 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) percpu_ref_put(&q->q_usage_counter); } } - rcu_read_unlock_sched(); + rcu_read_unlock(); if (success) return 0;