[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
free_memory_available() bug in pre-91-1
Hi Linus,
I've just found a bug in free_memory_available() as
implemented in pre-91-1...
It reacts the same on finding _no_ free item on a list
as it reacts on _multiple_ free items on the list.
So it'll return the same value regardless of whether
there is lots of free memory or there's no free memory...
(notice the 'break;' at two places...)
do {
list--;
/* Empty list? Bad - we need more memory */
if (list->next == memory_head(list))
break;
/* One item on the list? Look further */
if (list->next->next == memory_head(list))
continue;
/* More than one item? We're ok */
break;
} while (--nr >= 0);
spin_unlock_irqrestore(&page_alloc_lock, flags);
return nr + 1;
}
Rik.
+-------------------------------------------+--------------------------+
| Linux: - LinuxHQ MM-patches page | Scouting webmaster |
| - kswapd ask-him & complain-to guy | Vries cubscout leader |
| http://www.fys.ruu.nl/~riel/ | <H.H.vanRiel@fys.ruu.nl> |
+-------------------------------------------+--------------------------+