> -----Original Message-----
> From: [email protected] [mailto:linux-scsi-
> [email protected]] On Behalf Of Martin Wilck
> Sent: Tuesday, April 11, 2017 7:19 AM
> To: Don Brace <[email protected]>; [email protected];
> Gerry Morong <[email protected]>; John Hall
> <[email protected]>; [email protected]; Kevin Barnett
> <[email protected]>; Mahesh Rajashekhara
> <[email protected]>; Bader Ali - Saleh
> <[email protected]>; [email protected]; Scott Teel
> <[email protected]>; Viswas G <[email protected]>; Justin
> Lindley <[email protected]>; Scott Benesh
> <[email protected]>; [email protected]
> Cc: [email protected]
> 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 <[email protected]>, 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