Skip to content

Commit 01b1e3c

Browse files
mdrothardbiesheuvel
authored andcommitted
efi/unaccepted: Fix off-by-one when checking for overlapping ranges
When a task needs to accept memory it will scan the accepting_list to see if any ranges already being processed by other tasks overlap with its range. Due to an off-by-one in the range comparisons, a task might falsely determine that an overlapping range is being accepted, leading to an unnecessary delay before it begins processing the range. Fix the off-by-one in the range comparison to prevent this and slightly improve performance. Fixes: 50e782a ("efi/unaccepted: Fix soft lockups caused by parallel memory acceptance") Link: https://lore.kernel.org/linux-mm/[email protected]/T/#me2eceb9906fcae5fe958b3fe88e41f920f8335b6 Reviewed-by: Kirill A. Shutemov <[email protected]> Signed-off-by: Michael Roth <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 2cc14f5 commit 01b1e3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/unaccepted_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void accept_memory(phys_addr_t start, phys_addr_t end)
101101
* overlap on physical address level.
102102
*/
103103
list_for_each_entry(entry, &accepting_list, list) {
104-
if (entry->end < range.start)
104+
if (entry->end <= range.start)
105105
continue;
106106
if (entry->start >= range.end)
107107
continue;

0 commit comments

Comments
 (0)