On 8/23/21 12:36 PM, Hao Xu wrote: > running task_work may not be a big bottleneck now, but it's never worse > to make it move forward a little bit. > I'm trying to construct tests to prove it is better in some cases where > it should be theoretically. > Currently only prove it is not worse by running fio tests(sometimes a > little bit better). So just put it here for comments and suggestion. I think this is interesting, particularly for areas where we have a mix of task_work uses because obviously it won't really matter if the task_work being run is homogeneous. That said, would be nice to have some numbers associated with it. We have a few classes of types of task_work: 1) Work completes really fast, we want to just do those first 2) Work is pretty fast, like async buffered read copy 3) Work is more expensive, might require a full retry of the operation Might make sense to make this classification explicit. Problem is, with any kind of scheduling like that, you risk introducing latency bubbles because the prio1 list grows really fast, for example. -- Jens Axboe