lkml.org 
[lkml]   [2020]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] mm/hugetlb: Fix calculation of adjust_range_if_pmd_sharing_possible
From
Date
On 7/30/20 1:16 PM, Peter Xu wrote:
> This is found by code observation only.
>
> Firstly, the worst case scenario should assume the whole range was covered by
> pmd sharing. The old algorithm might not work as expected for ranges
> like (1g-2m, 1g+2m), where the adjusted range should be (0, 1g+2m) but the
> expected range should be (0, 2g).
>
> Since at it, remove the loop since it should not be required. With that, the
> new code should be faster too when the invalidating range is huge.

Thanks Peter!

That is certainly much simpler than the loop in current code. You say there
are instances where old code 'might not work' for ranges like (1g-2m, 1g+2m).
Not sure I understand what you mean by adjusted and expected ranges in the
message. Both are possible 'adjusted' ranges depending on vma size.

Just trying to figure out if there is an actual problem in the existing code
that needs to be fixed in stable. I think the existing code is correct, just
inefficient.
--
Mike Kravetz

\
 
 \ /
  Last update: 2020-07-30 23:50    [W:0.061 / U:1.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site