From: Peter Zijlstra <peterz@infradead.org>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: target-devel <target-devel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Mike Christie <mchristi@redhat.com>,
Hannes Reinecke <hare@suse.com>, Christoph Hellwig <hch@lst.de>,
Sagi Grimberg <sagi@grimberg.me>,
"Bryant G. Ly" <bryantly@linux.vnet.ibm.com>,
Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals
Date: Thu, 11 Oct 2018 09:55:52 +0200 [thread overview]
Message-ID: <20181011075552.GA2162@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1539236412.6150.18.camel@haakon3.daterainc.com>
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 <nab@linux-iscsi.org>
> > >
> > > 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.
WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: target-devel <target-devel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Mike Christie <mchristi@redhat.com>,
Hannes Reinecke <hare@suse.com>, Christoph Hellwig <hch@lst.de>,
Sagi Grimberg <sagi@grimberg.me>,
"Bryant G. Ly" <bryantly@linux.vnet.ibm.com>,
Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals
Date: Thu, 11 Oct 2018 07:55:52 +0000 [thread overview]
Message-ID: <20181011075552.GA2162@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1539236412.6150.18.camel@haakon3.daterainc.com>
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 <nab@linux-iscsi.org>
> > >
> > > 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.
next prev parent reply other threads:[~2018-10-11 7:55 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 3:23 [PATCH 0/2] target: Fix v4.19-rc active I/O shutdown deadlock Nicholas A. Bellinger
2018-10-10 3:23 ` [PATCH 1/2] sched/wait: Add wait_event_lock_irq_timeout for TASK_UNINTERRUPTIBLE usage Nicholas A. Bellinger
2018-10-10 3:59 ` Ly, Bryant
2018-10-10 3:59 ` Ly, Bryant
2018-10-10 8:31 ` Peter Zijlstra
2018-10-10 8:31 ` Peter Zijlstra
2018-10-12 2:18 ` Bart Van Assche
2018-10-12 2:18 ` Bart Van Assche
2018-10-10 3:23 ` [PATCH 2/2] target: Fix target_wait_for_sess_cmds breakage with active signals Nicholas A. Bellinger
2018-10-10 4:01 ` Ly, Bryant
2018-10-10 4:58 ` Bart Van Assche
2018-10-10 4:58 ` Bart Van Assche
2018-10-10 8:43 ` Peter Zijlstra
2018-10-10 8:43 ` Peter Zijlstra
2018-10-11 5:40 ` Nicholas A. Bellinger
2018-10-11 5:40 ` Nicholas A. Bellinger
2018-10-11 7:55 ` Peter Zijlstra [this message]
2018-10-11 7:55 ` Peter Zijlstra
2018-10-10 16:58 ` Mike Christie
2018-10-10 16:58 ` Mike Christie
2018-10-11 5:56 ` Nicholas A. Bellinger
2018-10-11 5:56 ` Nicholas A. Bellinger
2018-10-11 5:56 ` Nicholas A. Bellinger
2018-10-11 13:05 ` Ly, Bryant
2018-10-16 4:13 ` Martin K. Petersen
2018-10-16 4:13 ` Martin K. Petersen
2018-10-16 4:13 ` Martin K. Petersen
2018-10-16 14:37 ` Ly, Bryant
2018-10-16 14:37 ` Ly, Bryant
2018-10-10 4:20 ` [PATCH 0/2] target: Fix v4.19-rc active I/O shutdown deadlock Nicholas A. Bellinger
2018-10-10 4:20 ` Nicholas A. Bellinger
2018-10-10 4:20 ` Nicholas A. Bellinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181011075552.GA2162@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bryantly@linux.vnet.ibm.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mchristi@redhat.com \
--cc=nab@linux-iscsi.org \
--cc=sagi@grimberg.me \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.