linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: renaud.lienhart@free.fr
To: linux-mm@kvack.org
Subject: page_alloc.c: free_pages_bulk() comment is incorrect
Date: Mon, 01 Aug 2005 18:04:59 +0200	[thread overview]
Message-ID: <1122912299.42ee482bdfadf@imp5-q.free.fr> (raw)

"'count' is the number of pages to free, or 0 for all on the list."

However, when looking carefully at the loop of this function, we can
see that it exits immediately if count == 0, thus defeating the purpose
of freeing the entire list.
If I am wrong, please correct me.

Anyway, this behaviour seems mostly harmless as no user calls it
with an explicit "0". Or perhaps the callers assumed the current behaviour
and ignored the comment.

So we have two solutions:
- Fix free_pages_bulk() to adopt the "0 frees all" behaviour.
- Remove the confusing comment and pray that nobody used this feature
  (and by "nobody" I mean the only 3 callers).

I am not familiar enough with the mm subsystem, but I will be glad to
provide a patch to fix it once I know the correct fix.

Thanks and excuse my poor english,

        Renaud
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2005-08-01 16:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1122912299.42ee482bdfadf@imp5-q.free.fr \
    --to=renaud.lienhart@free.fr \
    --cc=linux-mm@kvack.org \
    /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