Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp454884imm; Tue, 9 Oct 2018 22:00:37 -0700 (PDT) X-Google-Smtp-Source: ACcGV634BKEOvUzsff3aRchyEuUb/61lhmKgIjjdy/vJ4zLgGcDxH36062JRVdSuBU/kVi80e7Sh X-Received: by 2002:a17:902:30a3:: with SMTP id v32-v6mr31027310plb.277.1539147637761; Tue, 09 Oct 2018 22:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539147637; cv=none; d=google.com; s=arc-20160816; b=bFfAQP2z4vmWZPhcLeu08KIW+E7leKwXYwzGxYbfRFEFI4mLOWPCerwOZWcFf2BdnB lGjN81acdV96PuMBpiZzTZyYT/TlvWD6vo5Qev++upfYj43D2ErEzK+4FvWx2s2+fF1h srAfgD8KmOYaRaavlVDtctPMsJOn8J+9ki3z62MM8ep4Q0bQIhHRVAJOxTZE+ej9dugX jNsaE+yxJ00+u7EjuwtlWYlQ4gxpVPQ6MqwfjLGlaQ+e0/QIOVVQclP4dqiLViVqpYK0 a+hX6VSKK+eZKEUZdzf7nBnealhYLiVWJBOyQvo81kgifrcW/tfschvMVYNJjSwRpLN3 Bvww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Mf5xwyupM05Xh21TLsdTA4L7cMtb46NThE0pZbMCWoA=; b=qQuXMh4EgY0YcBW0f38HtFAvvzPGucVzENx0FEDWzP6wZcpwtwgxIvrAWCmMnmL2I2 ndAEyQnvrR7TQ5k4Hg/AF29PDuNDq3+XALvtZj/vetMMWmTyzU4pEcLCa3zNlHaYS53y kaLYjVIZcOlmk9UhWtofyPY+lmxVx538waN7wGdQgi4RFITZgwGZ0YUKSTUhHnKyqRUJ n+mZ7s7/MxHfc6kYxUpD2bw/KCwvxP/SpSsSNuQlbZGViN760U9CJ7TurGk1VG5Q/15G CT+yCF5tZX661xHnVNirpc5o6r9wMHipBm+O2rQPvB06jwQBKORWacyAwjCmZ1s2eoJd E2mw== 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 37-v6si21617320pgu.460.2018.10.09.22.00.22; Tue, 09 Oct 2018 22:00:37 -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 S1726689AbeJJMT1 (ORCPT + 99 others); Wed, 10 Oct 2018 08:19:27 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36297 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbeJJMT1 (ORCPT ); Wed, 10 Oct 2018 08:19:27 -0400 Received: by mail-pl1-f193.google.com with SMTP id y11-v6so1904258plt.3; Tue, 09 Oct 2018 21:59:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Mf5xwyupM05Xh21TLsdTA4L7cMtb46NThE0pZbMCWoA=; b=PLURK8bXCx3M0Mq6GfNZzo5YNnG46YDNPvq3Oo1NCQHRJcnMnRoepLGG8IS1KZJ8OQ AKuumpQn2+kInVACqind4eBHQMFZcDkRH5Lty/B6qoJEHm5YtdJfjkakS449GSt07fOL 3SO7Gk8I3Gr0P2dMF5vea9L9kQMKD61mZ3lR7uyoov/fY4ExXTslWB6CH+w8fVAPCdzo fDKzTjQEusWwy/H4h69r+5FLcbzTtUxZ2GLwCjXjvoTIv9r8EIc/d2RaxEgG6khOFCQX QLihgOlmfItbwcJK+ONUG+iPoKN7mSLJOUjq8fcheK4TgGs+La3j4AWw0gm4bfs3THl1 vjJw== X-Gm-Message-State: ABuFfojKKhECS8JTbo1DWCgzocDbxODUpkl4R6ULFhVB6NAJlyGZSbCe tLLzeCh8DcAbG88UsAprvVfWG8VjsCfcQQ== X-Received: by 2002:a17:902:2b84:: with SMTP id l4-v6mr32092199plb.265.1539147546355; Tue, 09 Oct 2018 21:59:06 -0700 (PDT) Received: from asus.site ([2601:647:4601:42b4:3842:3e31:3bb6:cf62]) by smtp.gmail.com with ESMTPSA id z25-v6sm30218344pfl.58.2018.10.09.21.59.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 21:59:05 -0700 (PDT) Subject: Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals To: "Nicholas A. Bellinger" , target-devel Cc: linux-scsi , lkml , "Martin K. Petersen" , Mike Christie , Hannes Reinecke , Christoph Hellwig , Sagi Grimberg , "Bryant G. Ly" , "Peter Zijlstra (Intel)" References: <1539141790-13557-1-git-send-email-nab@linux-iscsi.org> <1539141790-13557-3-git-send-email-nab@linux-iscsi.org> From: Bart Van Assche Message-ID: Date: Tue, 9 Oct 2018 21:58:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1539141790-13557-3-git-send-email-nab@linux-iscsi.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/9/18 8:23 PM, Nicholas A. Bellinger wrote: > diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c > index 86c0156..fc3093d2 100644 > --- a/drivers/target/target_core_transport.c > +++ b/drivers/target/target_core_transport.c > @@ -2754,7 +2754,7 @@ static void target_release_cmd_kref(struct kref *kref) > if (se_sess) { > spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); > list_del_init(&se_cmd->se_cmd_list); > - if (list_empty(&se_sess->sess_cmd_list)) > + if (se_sess->sess_tearing_down && list_empty(&se_sess->sess_cmd_list)) > wake_up(&se_sess->cmd_list_wq); > spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); > } > @@ -2907,7 +2907,7 @@ void target_wait_for_sess_cmds(struct se_session *se_sess) > > spin_lock_irq(&se_sess->sess_cmd_lock); > do { > - ret = wait_event_interruptible_lock_irq_timeout( > + ret = wait_event_lock_irq_timeout( > se_sess->cmd_list_wq, > list_empty(&se_sess->sess_cmd_list), > se_sess->sess_cmd_lock, 180 * HZ); Since this patch addresses two different issues (performance improvement + fix for a hang), I think it should be split in two patches. Thanks, Bart.