[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9501613e-e8e5-4734-aa2f-ca3a3e4ca990@redhat.com>
Date: Wed, 21 May 2025 14:57:26 -0400
From: Matthew Sakai <msakai@...hat.com>
To: Kuan-Wei Chiu <visitorckw@...il.com>
Cc: dm-devel@...ts.linux.dev, linux-kernel@...r.kernel.org,
jserv@...s.ncku.edu.tw
Subject: Re: Potential heapify performance issue in dm-vdo
On 5/21/25 11:04 AM, Kuan-Wei Chiu wrote:
> Hi Matthew,
>
> Recently noticed that the current heapify method in min_heap.h may
> degrade performance when the heap contains many compare-equal elements,
> compared to the previous version.
>
> In detail, the new heapify reduces the number of comparisons by about
> 50% when all elements are distinct. However, when all elements are
> equal, the comparison count can degrade from O(1) to O(log n).
>
> I don't have enough domain knowledge of dm-vdo, so I'd like to ask
> whether it uses heaps with many compare-equal elements. If so, I'll
> work on fixing the issue.
>
> Regards,
> Kuan-Wei
Hi Kuan-Wei,
dm-vdo uses heapify for two different operations, but in both cases we
define heap elements that can never be equal to each other. So I think
this is not an issue for dm-vdo. (We have not noticed any issues with
this in our regular testing, either.)
Matt
Powered by blists - more mailing lists