On Mon, Sep 2, 2024 at 1:38 AM Kinga Stefaniuk <kinga.stefaniuk@xxxxxxxxx> wrote: > > In mdadm commit 49b69533e8 ("mdmonitor: check if udev has finished > events processing") mdmonitor has been learnt to wait for udev to finish > processing, and later in commit 9935cf0f64f3 ("Mdmonitor: Improve udev > event handling") pooling for MD events on /proc/mdstat file has been > deprecated because relying on udev events is more reliable and less bug > prone (we are not competing with udev). > > After those changes we are still observing missing mdmonitor events in > some scenarios, especially SpareEvent is likely to be missed. With this > patch MD will be able to generate more change uevents and wakeup > mdmonitor more frequently to give it possibility to notice events. > MD has md_new_events() functionality to trigger events and with this > patch this function is extended to generate udev CHANGE uevents. It > cannot be done directly because this function is called on interrupts > context, so appropriate workqueue is created. Uevents are less time > critical, it is safe to use workqueue. It is limited to CHANGE event as > there is no need to generate other uevents for now. > With this change, mdmonitor events are less likely to be missed. Our > internal tests suite confirms that, mdmonitor reliability is (again) > improved. > Start using irq methods on all_mddevs_lock, because it can be reached > by interrupt context. > > Signed-off-by: Mateusz Grzonka <mateusz.grzonka@xxxxxxxxx> > Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@xxxxxxxxx> I am seeing new failures from mdadm tests, for example, test 01replace. Please run these tests and fix the issues. Thanks, Song