odp icon indicating copy to clipboard operation
odp copied to clipboard

[PATCH v9] Avoid possible deadloop in llq dequeue

Open easynetsec opened this issue 2 years ago • 6 comments

The cpu_pause while loop is added to handle the case that the dequeue happens when an enqueue is in progress and the llq->u.ui.head is being updated.

In some corner case, however, if the old.st.head is dequeued from llq and then enqueued into another queue before the while loop starts, then the dequeue can get stuck in the while loop until the queue is scheduled again.

Add a threshold of spin count, so we will re-check the llq head once max spin count is reached.

easynetsec avatar Jul 25 '22 09:07 easynetsec

Fixed checking failures by CI.

easynetsec avatar Jul 28 '22 00:07 easynetsec

As a side node, have you tried using the default scheduler implementation recently? It should perform better in most use cases and the code is better maintained.

MatiasElo avatar Jul 28 '22 12:07 MatiasElo

@JannePeltonen do you have more comments? if not, can we get this merged?

easynetsec avatar Aug 04 '22 03:08 easynetsec

As a side node, have you tried using the default scheduler implementation recently? It should perform better in most use cases and the code is better maintained.

By default, you mean the basic scheduler? We moved from basic to scalable at some point because the scalable scheduler gave us some performance improvement. We haven't upgraded our odp for a while. So maybe we should take a look next time we upgrade.

easynetsec avatar Aug 04 '22 03:08 easynetsec

This is otherwise ready, but needs review-by tags. Please, rebase and add review tags of Matias and Janne.

psavol avatar Aug 15 '22 12:08 psavol

This is otherwise ready, but needs review-by tags. Please, rebase and add review tags of Matias and Janne.

Tags update and rebase are done. Anything else?

easynetsec avatar Aug 16 '22 01:08 easynetsec