lkml.org 
[lkml]   [2012]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm 2/7] mm: get unmapped area from VMA tree
On 06/21/2012 05:01 AM, Johannes Weiner wrote:

>> + /* Go left if it looks promising. */
>> + if (node_free_hole(rb_node->rb_left)>= len&&
>> + vma->vm_start - len>= lower_limit) {
>> + rb_node = rb_node->rb_left;
>> + continue;
>
> If we already are at a vma whose start has a lower address than the
> overall length, does it make sense to check for a left hole?
> I.e. shouldn't this be inside the if (vma->vm_start> len) block?

You are right, I can move this in under the
conditional.

>> + if (!found_here&& node_free_hole(rb_node->rb_left)>= len) {
>> + /* Last known hole is to the right of this subtree. */
>
> "to the left"

Actually, it is to the right. We walked left from
our parent to get here, so the holes found so far
are to the right of here.



\
 
 \ /
  Last update: 2012-06-21 22:01    [W:0.102 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site