linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "H.H.vanRiel" <H.H.vanRiel@fys.ruu.nl>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-mm <linux-mm@kvack.org>
Subject: free_memory_available() bug in pre-91-1
Date: Wed, 25 Mar 1998 00:03:09 +0100 (MET)	[thread overview]
Message-ID: <Pine.LNX.3.91.980324235724.469A-100000@mirkwood.dummy.home> (raw)

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

             reply	other threads:[~1998-03-25  1:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-24 23:03 H.H.vanRiel [this message]
1998-03-25 23:40 ` Linus Torvalds
1998-03-26  9:08   ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.3.91.980324235724.469A-100000@mirkwood.dummy.home \
    --to=h.h.vanriel@fys.ruu.nl \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox