> -----Original Message----- > From: linux-scsi-owner@xxxxxxxxxxxxxxx [mailto:linux-scsi- > owner@xxxxxxxxxxxxxxx] On Behalf Of Martin Wilck > Sent: Tuesday, April 11, 2017 7:19 AM > To: Don Brace <don.brace@xxxxxxxxxxxxx>; joseph.szczypek@xxxxxxx; > Gerry Morong <gerry.morong@xxxxxxxxxxxxx>; John Hall > <John.Hall@xxxxxxxxxxxxx>; jejb@xxxxxxxxxxxxxxxxxx; Kevin Barnett > <kevin.barnett@xxxxxxxxxxxxx>; Mahesh Rajashekhara > <mahesh.rajashekhara@xxxxxxxxxxxxx>; Bader Ali - Saleh > <bader.alisaleh@xxxxxxxxxxxxx>; hch@xxxxxxxxxxxxx; Scott Teel > <scott.teel@xxxxxxxxxxxxx>; Viswas G <viswas.g@xxxxxxxxxxxxx>; Justin > Lindley <justin.lindley@xxxxxxxxxxxxx>; Scott Benesh > <scott.benesh@xxxxxxxxxxxxx>; POSWALD@xxxxxxxx > Cc: linux-scsi@xxxxxxxxxxxxxxx > 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 <mwilck@xxxxxxxx>, 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