Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1874749imm; Thu, 11 Oct 2018 00:58:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV637vZqlxznSmaFSDb3yE4UDLqrMcmv1xQlvNV30dwpe6J4d2SOmQeZmv8RBewr9b63GBi4b X-Received: by 2002:a17:902:ac8e:: with SMTP id h14-v6mr519269plr.300.1539244708272; Thu, 11 Oct 2018 00:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539244708; cv=none; d=google.com; s=arc-20160816; b=P1WY1sYYRs8tbDyrpD32RSjKKWeMqQQXZ50tfmVr+E7xU4WmwyseIV97vLoApGg84K uE8qpkqkIf9pYAnJzt8ypu8GjhtG239+tw5jkspnWjGgwMckErJxZAxi9jsHhUedWoVg eH8VYZwv91noQ5a9kvXb3Yu+D3R8rDmIVpJjXEe2HQj+ozYv3nAmxlmeiu/8ZisQHKRP iBOLasYHXqwUF8AeUAeDhaRudD8RCVlLvcjT8p8h2i9Ik+mR0WrfZ0RDTS/825kmDZ4l 88Zj5WNmQGZ7Fco35/QEVDdhrhv7iS70FwFlJe5JRInHPS1ZFC8S78piEc2mCNMUyUQF ndCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eUq5KoeUf2ZhuPmYIlzMPQE+tvsftW4aCqlZygN6TFU=; b=eQDICFRVDbKPaaChSqGmOnKKvitWKogguYYKVEf4zsvUPahU9ucviKiLQl9Y3JgUyt 2/Bw7cVboZCuOWC0hvRpE9BhXvcYDS6X/f/FAFlmropX4byZQlm7zYjYUtIEKSCl+Rtc sDxaAlrA6NwMPVqDJY4e5P75gPnDQwV2/N3fUnXiet/LYCmvkpD2/WMDrs7sxubydi6x KSISHwO9md7difH5SiXg1yg0Zp/nheVCHjh2aeVvcuaL3EtVa35ELv7EZbPYIpyu/oy+ NvznVFvvEsBIp1F0ATS0voE8QmJhyg8ot+6s+7lcwnEFFfHBXEsE0m4oPYd+8vKCMWvg Tf+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=STj6+kh7; 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 t62-v6si29684035pfj.53.2018.10.11.00.58.12; Thu, 11 Oct 2018 00:58:28 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=STj6+kh7; 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 S1728164AbeJKPW2 (ORCPT + 99 others); Thu, 11 Oct 2018 11:22:28 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46698 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727860AbeJKPW1 (ORCPT ); Thu, 11 Oct 2018 11:22:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=eUq5KoeUf2ZhuPmYIlzMPQE+tvsftW4aCqlZygN6TFU=; b=STj6+kh7xbvBsWrDKBgPoYbLz uZW8uDp/3yXYx87QKVKJWjDZ9nZFVRpyK1aWYXXUS2FOQ+gEgz1s7IMTOnQb2U2rk5tBQxkNMs/bi U/QO+5KKXNqdnffbLyt9RMGH6zgYrClQb/R5GxDm7eq199T3BNwFGhpqk5TBAzbEuZDMpcJQ9f70P nMj4EsJY1XPCnQwRBPkH0i0m4ZZZgN8eisYJ2annUuCKnRhkTOX6SOgBf9YoyVS80k6KiBWbhWexg Oid95yU5kZoGMGkpHU283/C1DplOpDOVAMuVI7CVuSEmZur1zbED8cpcWL6cD8iHk8j1yOOfqPtps HOSzjYjag==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gAVp5-0001wZ-9Z; Thu, 11 Oct 2018 07:55:55 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 10CB82028047E; Thu, 11 Oct 2018 09:55:52 +0200 (CEST) Date: Thu, 11 Oct 2018 09:55:52 +0200 From: Peter Zijlstra To: "Nicholas A. Bellinger" Cc: target-devel , linux-scsi , lkml , "Martin K. Petersen" , Mike Christie , Hannes Reinecke , Christoph Hellwig , Sagi Grimberg , "Bryant G. Ly" , Bart Van Assche Subject: Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals Message-ID: <20181011075552.GA2162@hirez.programming.kicks-ass.net> References: <1539141790-13557-1-git-send-email-nab@linux-iscsi.org> <1539141790-13557-3-git-send-email-nab@linux-iscsi.org> <20181010084335.GN5728@hirez.programming.kicks-ass.net> <1539236412.6150.18.camel@haakon3.daterainc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1539236412.6150.18.camel@haakon3.daterainc.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 10, 2018 at 10:40:12PM -0700, Nicholas A. Bellinger wrote: > Hey Peter & Co, > > On Wed, 2018-10-10 at 10:43 +0200, Peter Zijlstra wrote: > > On Wed, Oct 10, 2018 at 03:23:10AM +0000, Nicholas A. Bellinger wrote: > > > From: Nicholas Bellinger > > > > > > With the addition of commit 00d909a107 in v4.19-rc, it incorrectly assumes no > > > signals will be pending for task_struct executing the normal session shutdown > > > and I/O quiesce code-path. > > > > > > For example, iscsi-target and iser-target issue SIGINT to all kthreads as > > > part of session shutdown. This has been the behaviour since day one. > > > > Not knowing much context here; but does it make sense for those > > kthreads to handle signals, ever? Most kthreads should be fine with > > ignore_signals(). > > > > iscsi-target + ib-isert uses SIGINT amongst dedicated rx/tx connection > kthreads to signal connection shutdown, requiring in-flight se_cmd I/O > descriptors to be quiesced before making forward progress to release > se_session. > > By the point wait_event_lock_irq_timeout() is called in the example > here, one of the two rx/tx connection kthreads has been stopped, and the > other kthread is still processing shutdown. So while historically the > pending SIGINTs where not cleared (or ignored) during shutdown at this > point, there is no reason why they could not be ignored for iscsi-target > + ib-isert. > > That said, pre commit 00d909a107 code always used wait_for_completion() > and ignored pending signals. As-is target_wait_for_sess_cmds() is > called directly from fabric driver code and in one case also from > user-space via configfs_write_file(), so AFAICT it does need > TASK_UNINTERRUPTIBLE. > Fair enough, thanks for the background. I'm always a bit wary when kthreads need to deal with signals, but this seems OK.