I am implementing a kernel module to handle power-off event. Our HW setup will emit an IRQ when power cut-off happens, and device can run 200ms more after that. During this time I have to close all rw-opened Fd to avoid file corruption. I am thinking of two options:
- Perform closing all Fds from within the interrupt context itself. It will mask all other interrupts and handle the event until device is off. It may cause freezing issue.
- Use Softirqs and do closing in the bottom half.
What would be the best way to implement this? thanks all.