Re: __get_free_pages(): is the MEM really mine?

Bernd Harries (bha@gmx.de)
Sat, 29 Sep 2001 19:15:25 +0200


Greetings from the 2001 Linux Devel meeting in Oldenburg!

Roman Zippel looked at my driver and added code to print the usage
counter for each page after a 9-order __get_free_pages().

We found that only the first (!) page has a count of 1, the others have 0!

That would cover my impression, that only the 1st page is really mine...

Roman found that strange and added this:

struct page * page = virt_to_page(card_ptr->dma_blk1[n]);
int i;
for(i = 0; i < (1 << max_order); i++, page++)
{
atomic_set(&page->count, 1);
}

And the freeing of the pages is now done page by page in the _vma_close()
function.

I will now test the version but I have only a 1-CPU box here. On an SMP Box I
could imagine that even between __get_free_pages() and the
atomic_set(&page->count, 1) someone else already uses my pages.

Could you please comment on this?

Thanks,

-- 
Bernd Harries

bha@gmx.de http://www.freeyellow.com/members/bharries bha@nikocity.de Tel. +49 421 809 7343 priv. | MSB First! harries@stn-atlas.de +49 421 457 3966 offi. | Linux-m68k bernd@linux-m68k.org 8.48'21" E 52.48'52" N | Medusa T40 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/