linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* free_memory_available() bug in pre-91-1
@ 1998-03-24 23:03 H.H.vanRiel
  1998-03-25 23:40 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: H.H.vanRiel @ 1998-03-24 23:03 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-mm

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> |
+-------------------------------------------+--------------------------+

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-03-26  9:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-24 23:03 free_memory_available() bug in pre-91-1 H.H.vanRiel
1998-03-25 23:40 ` Linus Torvalds
1998-03-26  9:08   ` Rik van Riel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox