From patchwork Tue Jan 23 23:48:21 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: 10181165 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 D519D6019D for ; Tue, 23 Jan 2018 23:48:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7D37287B5 for ; Tue, 23 Jan 2018 23:48:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC34C28817; Tue, 23 Jan 2018 23:48:23 +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 2A294287B5 for ; Tue, 23 Jan 2018 23:48:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbeAWXsW (ORCPT ); Tue, 23 Jan 2018 18:48:22 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:22968 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751993AbeAWXsV (ORCPT ); Tue, 23 Jan 2018 18:48:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1516751302; x=1548287302; h=from:to:cc:subject:date:message-id; bh=PLcSeM5N32w9OE6Y8WCX6YzQQVMRVxBusQwZOySK/yw=; b=oIfrGPwmT+57XDV5fCghnzjoKnEVbP5rxVKTGShGCY2/OZ10O2g9goqn tWRZp+riH5a5bl6Kn4lxzGFXIa5a2fdLIYVBMVplfnCcKOsL9LTI7gmXW BXsjWfkdO+P/nb8hzLgMyYsZTcI/CtTNWgprxD2ktxlR5PLMszeGu6Bf8 2Awmn5geFJDF4mBg2faWMrgaI0holU7AGr7hknNLnQanlihhofKDA1s6M 4EJxbhA73HifVcT4hmv4du69zGFGGAigXvX+4emMQG0bR0rWs699BdEr2 /MIiJ5qyM1idWjXg3IPddurelEw1w286ds2HfszSL+ew/Se0nQqcIetn4 g==; X-IronPort-AV: E=Sophos;i="5.46,403,1511798400"; d="scan'208";a="69640976" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 24 Jan 2018 07:48:22 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 23 Jan 2018 15:43:17 -0800 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; 23 Jan 2018 15:48:22 -0800 From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche Subject: [PATCH] Remove init_rcu_head() and destroy_rcu_head() calls Date: Tue, 23 Jan 2018 15:48:21 -0800 Message-Id: <20180123234821.25565-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.15.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to Documentation/RCU/Design/Requirements/Requirements.html calling these functions is not necessary for dynamically allocated objects: The corresponding rcu_head structures that are dynamically allocated are automatically tracked, but rcu_head structures allocated on the stack must be initialized with init_rcu_head_on_stack() and cleaned up with destroy_rcu_head_on_stack(). Similarly, statically allocated non-stack rcu_head structures must be initialized with init_rcu_head() and cleaned up with destroy_rcu_head(). Hence remove the calls to these functions from the SCSI core. Signed-off-by: Bart Van Assche --- drivers/scsi/hosts.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index a0a7e4ff255c..7279d3d2e941 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -334,8 +334,6 @@ static void scsi_host_dev_release(struct device *dev) if (shost->work_q) destroy_workqueue(shost->work_q); - destroy_rcu_head(&shost->rcu); - if (shost->shost_state == SHOST_CREATED) { /* * Free the shost_dev device name here if scsi_host_alloc() @@ -404,7 +402,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) INIT_LIST_HEAD(&shost->starved_list); init_waitqueue_head(&shost->host_wait); mutex_init(&shost->scan_mutex); - init_rcu_head(&shost->rcu); index = ida_simple_get(&host_index_ida, 0, 0, GFP_KERNEL); if (index < 0)