All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Chad Dupuis <chad.dupuis@cavium.com>
Cc: Chris Leech <cleech@redhat.com>,
	James Bottomley <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, Chad Dupuis <chad.dupuis@qlogic.com>,
	rt@linutronix.de, Lee Duncan <lduncan@suse.com>,
	QLogic-Storage-Upstream@qlogic.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Thumshirn <jth@kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PREEMPT-RT] [REEEEPOST] bnx2i + bnx2fc: convert to generic workqueue (#3)
Date: Wed, 17 May 2017 17:07:34 +0200	[thread overview]
Message-ID: <20170517150734.dkfghfgd4v4ucttf@linutronix.de> (raw)
In-Reply-To: <20170517150153.2eamcjtc4frx2cae@linutronix.de>

On 2017-05-17 17:01:53 [+0200], To Chad Dupuis wrote:
> On 2017-05-12 11:55:52 [-0400], Chad Dupuis wrote:
> > Ok, I believe I've found the issue here.  The machine that the test has 
> > performed on had many more possible CPUs than active CPUs.  We calculate 
> > which CPU to the work time on in bnx2fc_process_new_cqes() like this:
> > 
> > unsigned int cpu = wqe % num_possible_cpus();
> > 
> > Since not all CPUs are active, we were trying to schedule work on 
> > non-active CPUs which meant that the upper layers were never notified of 
> > the completion.  With this change:
> > 
> > diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c 
> > b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
> > index c2288d6..6f08e43 100644
> > --- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c
> > +++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c
> > @@ -1042,7 +1042,12 @@ static int bnx2fc_process_new_cqes(struct 
> > bnx2fc_rport *tgt)
> >                         /* Pending work request completion */
> >                         struct bnx2fc_work *work = NULL;
> >                         struct bnx2fc_percpu_s *fps = NULL;
> > -                       unsigned int cpu = wqe % num_possible_cpus();
> > +                       unsigned int cpu = wqe % num_active_cpus();
> > +
> > +                       /* Sanity check cpu to make sure it's online */
> > +                       if (!cpu_active(cpu))
> > +                               /* Default to CPU 0 */
> > +                               cpu = 0;
> >  
> >                         work = bnx2fc_alloc_work(tgt, wqe);
> >                         if (work) {
> > 
> > The issue is fixed.
> > 
> > Sebastian, can you add this change to your patch set?
> 
> Are sure that you can reliably reproduce the issue and fix it with the
> patch above? Because this patch:

oh. Okay. Now it clicked. It can fix the issue but it is still possible,
that CPU0 goes down between your check for it and schedule_work_on()
returning. Let my think of something…

Sebastian

  parent reply	other threads:[~2017-05-17 15:07 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 17:12 [REEEEPOST] bnx2i + bnx2fc: convert to generic workqueue (#3) Sebastian Andrzej Siewior
2017-04-10 17:12 ` [PATCH 1/5] scsi: bnx2i: convert to workqueue Sebastian Andrzej Siewior
2017-05-05  8:58   ` Christoph Hellwig
2017-05-05 10:32   ` Johannes Thumshirn
2017-05-09  9:30   ` Rangankar, Manish
2017-06-29 13:57   ` Johannes Thumshirn
2017-07-07 13:14     ` Sebastian Andrzej Siewior
2017-07-07 13:20       ` Chad Dupuis
2017-07-07 13:32         ` Sebastian Andrzej Siewior
2017-04-10 17:12 ` [PATCH 2/5] scsi: bnx2fc: convert per-CPU thread " Sebastian Andrzej Siewior
2017-05-05  8:58   ` Christoph Hellwig
2017-05-05 10:33   ` Johannes Thumshirn
2017-04-10 17:12 ` [PATCH 3/5] scsi: bnx2fc: clean up header definitions Sebastian Andrzej Siewior
2017-05-05  8:59   ` Christoph Hellwig
2017-05-05 10:33   ` Johannes Thumshirn
2017-04-10 17:12 ` [PATCH 4/5] scsi: bnx2fc: annoate unlock + release for sparse Sebastian Andrzej Siewior
2017-05-05  8:59   ` Christoph Hellwig
2017-05-05 10:34   ` Johannes Thumshirn
2017-04-10 17:12 ` [PATCH 5/5] scsi: bnx2fc: convert bnx2fc_l2_rcv_thread() to workqueue Sebastian Andrzej Siewior
2017-05-05  8:59   ` Christoph Hellwig
2017-05-05 10:34   ` Johannes Thumshirn
2017-04-10 18:20 ` [REEEEPOST] bnx2i + bnx2fc: convert to generic workqueue (#3) Chad Dupuis
2017-04-20 20:24   ` Sebastian Andrzej Siewior
2017-05-04 17:44 ` Sebastian Andrzej Siewior
2017-05-09  2:04   ` Martin K. Petersen
2017-05-09 14:17     ` Chad Dupuis
2017-05-09 15:18       ` James Bottomley
2017-05-12 15:55         ` Chad Dupuis
2017-05-17 15:01           ` Sebastian Andrzej Siewior
2017-05-17 15:06             ` Chad Dupuis
2017-05-17 15:07             ` Sebastian Andrzej Siewior [this message]
2017-05-17 17:18               ` [PREEMPT-RT] " Sebastian Andrzej Siewior
2017-05-09 21:15       ` Martin K. Petersen

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=20170517150734.dkfghfgd4v4ucttf@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=QLogic-Storage-Upstream@qlogic.com \
    --cc=akpm@linux-foundation.org \
    --cc=chad.dupuis@cavium.com \
    --cc=chad.dupuis@qlogic.com \
    --cc=cleech@redhat.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jth@kernel.org \
    --cc=lduncan@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=rt@linutronix.de \
    /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.