From patchwork Tue Dec 8 07:37:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 7795261 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0C606BEEE1 for ; Tue, 8 Dec 2015 07:37:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D47D20524 for ; Tue, 8 Dec 2015 07:37:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 249CF204AE for ; Tue, 8 Dec 2015 07:37:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933230AbbLHHhx (ORCPT ); Tue, 8 Dec 2015 02:37:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:46132 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933201AbbLHHhr (ORCPT ); Tue, 8 Dec 2015 02:37:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1669EACA7; Tue, 8 Dec 2015 07:37:42 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: James Bottomley , Christoph Hellwig , Ewan Milne , Bart van Assche , linux-scsi@vger.kernel.org, Hannes Reinecke Subject: [PATCH 12/20] scsi_dh_alua: Allow workqueue to run synchronously Date: Tue, 8 Dec 2015 08:37:32 +0100 Message-Id: <1449560260-53407-13-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1449560260-53407-1-git-send-email-hare@suse.de> References: <1449560260-53407-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some arrays may only capable of handling one STPG at a time, so this patch implements a module option 'sync_stpg' to have STPGs submitted synchronously. Signed-off-by: Hannes Reinecke --- drivers/scsi/device_handler/scsi_dh_alua.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 6fcdcd5..525449f 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -73,6 +73,10 @@ static uint optimize_stpg; module_param(optimize_stpg, uint, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(optimize_stpg, "Allow use of a non-optimized path, rather than sending a STPG, when implicit TPGS is supported (0=No,1=Yes). Default is 0."); +static uint sync_stpg; +module_param(sync_stpg, uint, S_IRUGO); +MODULE_PARM_DESC(sync_stpg, "Issue STPG synchronously (0=No,1=Yes). Default is 0."); + static LIST_HEAD(port_group_list); static DEFINE_SPINLOCK(port_group_lock); static struct workqueue_struct *kaluad_wq; @@ -1019,9 +1023,11 @@ static struct scsi_device_handler alua_dh = { static int __init alua_init(void) { - int r; + int r, max_active = 0; - kaluad_wq = alloc_workqueue("kaluad", WQ_MEM_RECLAIM, 0); + if (sync_stpg) + max_active = 1; + kaluad_wq = alloc_workqueue("kaluad", WQ_MEM_RECLAIM, max_active); if (!kaluad_wq) { /* Temporary failure, bypass */ return SCSI_DH_DEV_TEMP_BUSY;