Skip to contentSkip to conversation

dmaengine: pl08x: be fair when re-assigning physical channel

DISCUSSION Vinod Koul 1 participant 1 message Mar 25, 2019 dmaengine

lore
Share & tools
lore

Vinod Koul

author maintainer Applied
#0 lore raw
Quoted 13 lines · Jean-Nicolas Graux

Current way we find a waiting virtual channel for the next transfer at the time one physical channel becomes free is not really fair.

More in details, in case there is more than one channel waiting at a time, by just going through the arrays of memcpy and slave channels and stopping as soon as state match waiting state, channels with high indexes can be penalized.

Whenever dma engine is substantially overloaded so that we constantly get several channels waiting, channels with highest indexes might not be served for a substantial time which in the worse case, might hang task that wait for dma transfer to complete.

Quoted 4 lines

This patch makes physical channel re-assignment more fair by storing time in jiffies when a channel is put in waiting state. Whenever a physical channel has to be re-assigned, this time is used to select channel that is waiting for the longest time.

Applied, thanks