On 9/25/23 4:43 AM, Amir Goldstein wrote: > Jens, > > Are there any IOCB flags that overlayfs (or backing_aio) need > to set or clear, besides IOCB_DIO_CALLER_COMP, that > would prevent calling completion from interrupt context? There are a few flags that may get set (like WAITQ or ALLOC_CACHE), but I think that should all work ok as-is as the former is just state in that iocb and that is persistent (and only for the read path), and ALLOC_CACHE should just be propagated. > Or is the proper way to deal with this is to defer completion > to workqueue in the common backing_aio helpers that > I am re-factoring from overlayfs? No, deferring to a workqueue would defeat the purpose of the flag, which is telling you that the caller will ensure that the end_io callback will happen from task context and need not be deferred to a workqueue. I can take a peek at how to wire it up properly for overlayfs, have some travel coming up in a few days. > IIUC, that could also help overlayfs support > IOCB_DIO_CALLER_COMP? > > Is my understanding correct? If you peek at fs.h and find the CALLER_COMP references, it'll tell you a bit about how it works. This is new with the 6.6-rc kernel, there's a series of patches from me that went in through the iomap tree that hooked that up. Those commits have an explanation as well. -- Jens Axboe