[lkml]   [2001]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Should page->count ever be -1?
** Reply to message from Andrea Arcangeli <> on Wed, 3 Jan 2001
22:55:05 +0100

> > from page_alloc.c (this is 2.2.18pre15). It appears that page->count is
> > already zero when this code is executed, and after it's executed, page->count
> > becomes -1 (or more accurately, 0xFFFFFFFF). Is this acceptable, or is it an
> > error condition?
> It's an error condition. Make sure you marked the page as reserved in the mmap
> callback if it's not an mmio region outside RAM.

I mark the page as reserved when I call ioremap and then unmark it after
ioremap returns, but iounmap will fail if it's still reserved (the same line of
code also checks the reserved bit):

if (!PageReserved(page) && atomic_dec_and_test(&page->count)) {

Is this what you're saying?

iounmap just calls vfree, which does all the work. However, I'm confused at
this code in vfree:

vmfree_area_pages(VMALLOC_VMADDR(tmp->addr), tmp->size);

What's the difference between vmfree_area_pages and kfree?

Timur Tabi -
Interactive Silicon -

When replying to a mailing-list message, please direct the reply to the mailing list only. Don't send another copy to me.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:52    [W:0.045 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site