Skip to contentSkip to conversation

make rangeset_report_ranges() report all ranges

PATCH In review Jan Beulich 2 participants 3 messages Jul 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make rangeset_report_ranges() report all ranges

find_range() returns NULL when s is below the lowest range, so we have to use first_range() here (which is as good performance wise).

xen/common/rangeset.c +1 -1
@@ -289,7 +289,7 @@ int rangeset_report_ranges(
 
     read_lock(&r->lock);
 
-    for ( x = find_range(r, s); x && (x->s <= e) && !rc; x = next_range(r, x) )
+    for ( x = first_range(r); x && (x->s <= e) && !rc; x = next_range(r, x) )
         if ( x->e >= s )
             rc = cb(max(x->s, s), min(x->e, e), ctxt);
 

make rangeset_report_ranges() report all ranges

find_range() returns NULL when s is below the lowest range, so we have to use first_range() here (which is as good performance wise).

xen/common/rangeset.c +1 -1
@@ -289,7 +289,7 @@ int rangeset_report_ranges(
 
     read_lock(&r->lock);
 
-    for ( x = find_range(r, s); x && (x->s <= e) && !rc; x = next_range(r, x) )
+    for ( x = first_range(r); x && (x->s <= e) && !rc; x = next_range(r, x) )
         if ( x->e >= s )
             rc = cb(max(x->s, s), min(x->e, e), ctxt);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jan Beulich

find_range() returns NULL when s is below the lowest range, so we have to use first_range() here (which is as good performance wise).

The bug here was that the first range would be omitted under certain conditions? Saying which here would be interesting.

Quoted 1 line
Quoted 15 lines
xen/common/rangeset.c +1 -1
@@ -289,7 +289,7 @@ int rangeset_report_ranges(
 
     read_lock(&r->lock);
 
-    for ( x = find_range(r, s); x && (x->s <= e) && !rc; x = next_range(r, x) )
+    for ( x = first_range(r); x && (x->s <= e) && !rc; x = next_range(r, x) )
         if ( x->e >= s )
             rc = cb(max(x->s, s), min(x->e, e), ctxt);
 
#2 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 15.07.15 at 15:43, <[email protected]> wrote:
Quoted 2 lines · Jan Beulich

find_range() returns NULL when s is below the lowest range, so we have to use first_range() here (which is as good performance wise).

The bug here was that the first range would be omitted under certain conditions? Saying which here would be interesting.

Not just omitted - the function would have reported nothing at all in that case. No current user appears to be affected though, but I have a new user now in the still pending MSI-X patch series that was harmed.

Jan