linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* page_alloc.c: free_pages_bulk() comment is incorrect
@ 2005-08-01 16:04 renaud.lienhart
  0 siblings, 0 replies; only message in thread
From: renaud.lienhart @ 2005-08-01 16:04 UTC (permalink / raw)
  To: linux-mm

"'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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-01 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-01 16:04 page_alloc.c: free_pages_bulk() comment is incorrect renaud.lienhart

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