On Mon, Aug 26, 2024 at 03:27:30PM +0000, Michael Kelley wrote: > OK, this makes sense to me. The DMA_ATTR_* symbols are currently > defined as just values that are not part of an enum or any other higher > level abstraction, and the "attrs" parameter to the dma_* functions is > just "unsigned long". Are you thinking that the separate namespace is > based only on the symbolic name (i.e., DMA_MAP_* vs DMA_ATTR_*), > with the values being disjoint? That seems straightforward to me. Yes. Although initially I'd just keep ATTR for the allocation and then maybe do a scripted run to convert it. > Changing the "attrs" parameter to an enum is a much bigger change .... I don't think an enum makes much sense as we have bits defined. A __bitwise type would be nice, but not required. > For a transition period we can have both DMA_ATTR_SKIP_CPU_SYNC > and DMA_MAP_SKIP_CPU_SYNC, and then work to change all > occurrences of the former to the latter. > > I'll have to look more closely at WEAK_ORDERING and NO_WARN. > > There are also a couple of places where DMA_ATTR_NO_KERNEL_MAPPING > is used for dma_map_* calls, but those are clearly bogus since that > attribute is never tested in the map path. Yeah, these kinds of bogus things is what I'd like to kill.. > > Note that this also in general involves changes to the block drivers > > to set that flag, which is a bit annoying, but I guess there is not > > easy way around it without paying the price for the BLK_MQ_F_BLOCKING > > overhead everywhere. > > Agreed. I assumed there was some cost to BLK_MQ_F_BLOCKING since > the default is !BLK_MQ_F_BLOCKING, but I don't really know what > that is. Do you have a short summary, just for my education? I think the biggest issue is that synchronize_srcu is pretty damn expensive, but there's also a whole bunch of places that unconditionally defer to the workqueue.