Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1777839imm; Wed, 10 Oct 2018 22:50:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV610iRFT+lgp3fbXqeJsTiNGA7DIR7MciG4IO5SpdFbIZXNykDeInDIfCjMVCBvp/DUIehsa X-Received: by 2002:a17:902:34a:: with SMTP id 68-v6mr174160pld.39.1539237025057; Wed, 10 Oct 2018 22:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539237025; cv=none; d=google.com; s=arc-20160816; b=RTx8G75SA5AtMgR5GfNc+PEdfJ1LpyXv2WpTngW3VY5vvbSNqPOUam/EY4D/alNpAV 9Hu+eIj0q6WpcHcDiv7N7GOME7s1fslCGNO/rw5PWuyD4NzddS9Q4t7Kb4ONK1WpLnDX ELfOxDabDEolC45Ke1zuJPzCE7Xhlpf72Mo8J9IcmM620pukGv1Ic5OZcSQim0+fsL9+ IDDyTu/LeNRGiYlKeig9afDPm8hda4jneXV1JGgvkFBUgvpBQjlBgEXZ1Cqk8chlnM1a W2fqazJPEAtOenjtpuqeqZKid7jna1pfIZRFF22LksJxv0m9QaTk/BREjsjlea2QjZm2 BoQw== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=cYzYuEVXjAdeuAgTg7vlLgaiXcroBVDW6/BF9YGQVDQ=; b=zo6Dr9lnOHJC8lXkDxAoSEBp/l7QOdejmeLhNTmGQb9iQxUPdQiLJDkW8NQHUEpna1 J2tLfdkxLgCHjKJZ+6K8n8sL5UIG/ezBgHzHoTsXL7fGwZJSrSqLUzwIiOGa0r85v3XX Ox6DGE0nzvoonZRaCDc8IlApgBKLoGP2n9oxuAaH/fhis2ERSitXuqFica0li4cooZ9T pLbAk1HU2FJLWm3+g/4pUZM4fc0hj/MDC3zYsV3uLBiyuznBc3Su4nYHGmtCRNlKtGoI FYU/HBodjc9nT/CCy1Ek1D/GiNygGhE2DsB0xLt21QPcVGzfHOwu/Ba+tj7HGL05OEjG s5Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linux-iscsi.org header.s=default.private header.b=pFVLe1tK; 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 r1-v6si27167402plo.165.2018.10.10.22.50.10; Wed, 10 Oct 2018 22:50:25 -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=@linux-iscsi.org header.s=default.private header.b=pFVLe1tK; 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 S1727982AbeJKNGA (ORCPT + 99 others); Thu, 11 Oct 2018 09:06:00 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:58724 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbeJKNF7 (ORCPT ); Thu, 11 Oct 2018 09:05:59 -0400 Received: from [192.168.1.66] (75-37-194-224.lightspeed.lsatca.sbcglobal.net [75.37.194.224]) (using SSLv3 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: nab) by linux-iscsi.org (Postfix) with ESMTPSA id D7DD940ABD; Thu, 11 Oct 2018 05:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=linux-iscsi.org; s=default.private; t=1539236429; bh=9Ca8iCQuBJcdzHHW1K6h19VK9Ql027I iPhDZFTqkiEY=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Mime-Version:Content-Transfer-Encoding; b=pFVLe1tKDN6UWM7eAUFR8SQlIwMYs4I8Scy/wvH6hhdblbIYe4IOtDSAtn4kzgI6O 6UDI63ho8WvVmE2sd4lAOHw5Q3Qkv89Ijpd2ME+bkRtZsl9WdZnFUnNpmqsKEhi76AW jqmktQ6c9qIs+0KA6BSYk2nXXxOlc80Y9fAEsgA= Message-ID: <1539236412.6150.18.camel@haakon3.daterainc.com> Subject: Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals From: "Nicholas A. Bellinger" To: Peter Zijlstra Cc: target-devel , linux-scsi , lkml , "Martin K. Petersen" , Mike Christie , Hannes Reinecke , Christoph Hellwig , Sagi Grimberg , "Bryant G. Ly" , Bart Van Assche Date: Wed, 10 Oct 2018 22:40:12 -0700 In-Reply-To: <20181010084335.GN5728@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> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.