> -----Original Message-----
> From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
> ow...@vger.kernel.org] On Behalf Of Martin Wilck
> Sent: Tuesday, April 11, 2017 7:19 AM
> To: Don Brace <don.br...@microsemi.com>; joseph.szczy...@hpe.com;
> Gerry Morong <gerry.mor...@microsemi.com>; John Hall
> <john.h...@microsemi.com>; j...@linux.vnet.ibm.com; Kevin Barnett
> <kevin.barn...@microsemi.com>; Mahesh Rajashekhara
> <mahesh.rajashekh...@microsemi.com>; Bader Ali - Saleh
> <bader.alisa...@microsemi.com>; h...@infradead.org; Scott Teel
> <scott.t...@microsemi.com>; Viswas G <viswa...@microsemi.com>; Justin
> Lindley <justin.lind...@microsemi.com>; Scott Benesh
> <scott.ben...@microsemi.com>; posw...@suse.com
> Cc: linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 09/12] hpsa: separate monitor events from heartbeat
> worker
> 
> > +/*
> > + * watch for controller events
> > + */
> > +static void hpsa_event_monitor_worker(struct work_struct *work)
> > +{
> > +     struct ctlr_info *h = container_of(to_delayed_work(work),
> > +     struct ctlr_info, event_monitor_work);
> > +
> > +     if (h->remove_in_progress)
> > +             return;
> > +
> > +     if (hpsa_ctlr_needs_rescan(h)) {
> > +             scsi_host_get(h->scsi_host);
> > +             hpsa_ack_ctlr_events(h);
> > +             hpsa_scan_start(h->scsi_host);
> > +             scsi_host_put(h->scsi_host);
> > +     }
> > +
> > +     if (!h->remove_in_progress)
> > +             schedule_delayed_work(&h->event_monitor_work,
> > +                                     HPSA_EVENT_MONITOR_INTERVAL)
> > ;
> > +}
> > +
> 
> The new worker thread duplicates code from hpsa_rescan_ctlr_worker. I
> find this a bit irritating. Could you maybe use just a single worker,
> and just check using time stamps whether the "big" heartbeat needs to
> be performed?
> 
> Regards
> Martin
> 
> --
> Dr. Martin Wilck <mwi...@suse.com>, Tel. +49 (0)911 74053 2107
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)

We thought about that, but we want to separate controller events
from the rescan worker.

Both can cause a rescan to occur however for multipath we have
found that we need to respond faster than the normal scheduled rescan
interval for path fail-overs.

Getting controller events only involves reading a register, but
the rescan worker can obtain an updated LUN list when there
is a PTRAID device present.

However, I did refactor the patch to move common code to
a separate function.

Would this be more acceptable?

Thanks,
Don Brace
ESC - Smart Storage
Microsemi Corporation


Reply via email to