Received: by 10.223.185.116 with SMTP id b49csp4090068wrg; Tue, 6 Mar 2018 09:37:09 -0800 (PST) X-Google-Smtp-Source: AG47ELu9KcbjjEbWEewp4mOCZ2lyvsC6J4VoPtqSZB2b8D33wxCgzz98zcA1Z8jayRjbtazXWw8h X-Received: by 2002:a17:902:aa03:: with SMTP id be3-v6mr15962935plb.211.1520357829625; Tue, 06 Mar 2018 09:37:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520357829; cv=none; d=google.com; s=arc-20160816; b=wTzjIyNdYGxde+y4AbIrrl5HShCccNyLd9yPSOzmVMZIgkaRi1o03LA7QluNyNkPDC ytB8xaoTbSnEhse8D0g2/5smwg3fVETASfNGnKSSWU4k36NxWr+IBYSitRg0Kk2f5qdE r+/3iCBo5d6Dq+dB/fjmCMLlzdZCmzfvKqE82fQS82qXCi2jkwfAE5wduf7s7NFsjggd PT9CMK5f//aYgrgEjVK9V6FcSK4cPwcCM8U9BAuSIS9mKGPAhFXyTBFDFDwQU842ykIk LEEMwQwM2Ea8Uos/Bp53VL3BKnpanu1Hbq60VDfO04udyL5wKHmYVVatHBikHUfVKq1r trcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=AnhtS6EV7vGwicWnJ1Jq18HmGBzG/qLrYzc0e+f+bP8=; b=fclNOSyfBavuN5WrIkHswk6V74RwE2xdDcpJNRvplUwknMy7y1E8r0Lr7NP2UBFt9o 9fefPmyQpOCoeQm0mtkyQ/IDd3xLUs9mIbBiQzNvpdXgyTwpnJ9sMVO6KU19luDNmUXx Oc8qEWDmV6p7Rfxr7uBJw9ApaSyiuFKQH8AkmauyBub8ouD0P64fgXuYzANZhOVcUcXT fnW4ymSO//HHk2GlToj5micQQYwXqwvWraymJ2ne8p85MpzHkKEjMg09Zt6mY5QijfOT 1FXtnAU4atAct6XOoFwv7/uAETJnmSYf2JhwRcOOeEpZXrzNa+PguYyZe3VK4keDZwNf Vq0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hkfv96eJ; 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 26si12208124pfl.261.2018.03.06.09.36.54; Tue, 06 Mar 2018 09:37:09 -0800 (PST) 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=hkfv96eJ; 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 S933015AbeCFRfQ (ORCPT + 99 others); Tue, 6 Mar 2018 12:35:16 -0500 Received: from mail-yb0-f194.google.com ([209.85.213.194]:33331 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932448AbeCFRfP (ORCPT ); Tue, 6 Mar 2018 12:35:15 -0500 Received: by mail-yb0-f194.google.com with SMTP id i5-v6so3406175yba.0 for ; Tue, 06 Mar 2018 09:35:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=AnhtS6EV7vGwicWnJ1Jq18HmGBzG/qLrYzc0e+f+bP8=; b=hkfv96eJtN3FLcRdIR9RK91bs7PDoQJxGMAPLoR+Ad3cAWQHoVEqA4M2p6dt7Cn4Qd MpbHjOMEHEsN0O4kMflzA7A/EUKGl1R6EVvwevDTW+xVz6HVM+u/5cVdMuKy0JFIJYES oMobAd7VutvstFIxjLqw5cAFeYjvfndyrHCJ0FXHHLSyV5UVnj5mFl9OUzMJLNvjlqSt 6YHU8ize72VIbmrh8+tzgmevK4/UBICaQTguYcsoJ3ecYaH6eyzknVH7Q0uiDVE7RMsG emFZYKtqzm3TwM4CXpQm8GozT7e+Plj8XrhRGALMuzLN3+4rImQSJHJquL0YEB8fVTS9 0KCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=AnhtS6EV7vGwicWnJ1Jq18HmGBzG/qLrYzc0e+f+bP8=; b=Fa2lajkaQcrnwjZ5EbzbxRqoemWf72QRoLb31VKMkEL+pVS2TDlz3s+pwJ0fBMhH20 U/rIAv/fzCDARyCrO9mTZi5rd7bhCkyiQ0ODEbSkVrI8oXxWIG/bt1raKbRX6PTNTrvD /ep+gM6g10ss3gPeWR7tUnkEibNRj5Rn6PxoLz214BbPqEfG280gtZT51HJfJ/8vCBqQ Dw/bF/Mu3x3WvNuTcFD+vOF9ZFirkoWWx9BAPHKEOSX48vAGtubGE9Qx1cLR9yyPCqjy O+jGqR5UpcvtBhUtI1vha/bNRlD78wGN80A8BrX25zjq2xSbiFLDo3neAALJdyG6F4Vz Z3XA== X-Gm-Message-State: AElRT7GndSN/2soObGu0rloSPXBer7KpDt/M3QY80t5wLc9PBEy2XxQr WCNKrEFSGD30rEaFB1KhCzE= X-Received: by 2002:a25:8588:: with SMTP id x8-v6mr11594987ybk.454.1520357714485; Tue, 06 Mar 2018 09:35:14 -0800 (PST) Received: from localhost ([2620:10d:c091:180::1:af9]) by smtp.gmail.com with ESMTPSA id h8sm5962896ywm.87.2018.03.06.09.35.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 09:35:13 -0800 (PST) From: Tejun Heo To: torvalds@linux-foundation.org, jannh@google.com, paulmck@linux.vnet.ibm.com, bcrl@kvack.org, viro@zeniv.linux.org.uk, kent.overstreet@gmail.com Cc: security@kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Tejun Heo , Bart Van Assche , Jens Axboe Subject: [PATCH 5/7] block: Remove superflous rcu_read_[un]lock_sched() in blk_queue_enter() Date: Tue, 6 Mar 2018 09:33:14 -0800 Message-Id: <20180306173316.3088458-5-tj@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180306173316.3088458-1-tj@kernel.org> References: <20180306172657.3060270-1-tj@kernel.org> <20180306173316.3088458-1-tj@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3a0a529971ec ("block, scsi: Make SCSI quiesce and resume work reliably") added rcu_read_[un]lock_sched() to blk_queue_enter() along with other changes but it doesn't seem to be doing anything. blk_queue_enter() is called with @q - the pointer to the target request_queue, so the caller obviously has to guarantee that @q can be dereferenced, and inside the RCU-sched protected area, there's nothing which needs further protection. Let's remove the superflous rcu_read_[un]lock_sched(). Signed-off-by: Tejun Heo Cc: Bart Van Assche Cc: Jens Axboe Cc: Linus Torvalds --- Hello, Bart. This came up while auditing percpu_ref users for problematic RCU usages. I couldn't understand what the RCU protection was doing. It'd be great if you can take a look and tell me whether I missed something. Thanks. block/blk-core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 6d82c4f..e3b4d1849 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -827,7 +827,6 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) bool success = false; int ret; - rcu_read_lock_sched(); if (percpu_ref_tryget_live(&q->q_usage_counter)) { /* * The code that sets the PREEMPT_ONLY flag is @@ -840,7 +839,6 @@ 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(); if (success) return 0; -- 2.9.5