[PATCH v2] common/mlx5: Optimize mlx5 mempool get extmem

Stephen Hemminger stephen at networkplumber.org
Sat Oct 5 00:16:08 CEST 2024


On Wed, 1 Nov 2023 22:21:16 +0100
John Romein <romein at astron.nl> wrote:

> Dear Slava,
> 
> Thank you for looking at the patch.  With the original code, I saw that 
> the application spent literally hours in this function during program 
> start up, if tens of gigabytes of GPU memory are registered.  This was 
> due to qsort being invoked for every new added item (to keep the list 
> sorted).  So I tried to write equivalent code that sorts the list only 
> once, after all items were added.  At least for our application, this 
> works well and is /much/ faster, as the complexity decreased from n^2 
> log(n) to n log(n).  But I must admit that I have no idea /what/ is 
> being sorted, or why; I only understand this isolated piece of code (or 
> at least I think so).  So if you think there are better ways to 
> initialize the list, then I am sure you will be absolutely right.  But I 
> will not be able to implement this, as I do not understand the full 
> context of the code.
> 
> Kind Regards,  John

Looks like the problem remains but patch has been sitting around for 11 months.
Was this resolved?


More information about the dev mailing list