Implications of PG_locked and reference count in page structures....

From: Michael Heinz (mheinz@infiniconsys.com)
Date: Wed Aug 15 2001 - 10:39:49 EST


I'm in the process of porting a driver to Linux. The author of the
driver conveniently broke it into os-dependent and independent sections.

One of the things in the "OS" dependent section is a routine to lock a
section of memory presumably to be used for DMA.

So, what I want to do is this: given a pointer to a previously
kmalloc'ed block, and the length of that block, I want to (a) identify
each page associated with the block and (b) lock each page. It appears
that I can lock the page either by incrementing it's reference count, or
by setting the PG_locked flag for the page.

Which method is preferred? Is there another method I should be using
instead?

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



This archive was generated by hypermail 2b29 : Wed Aug 15 2001 - 21:00:58 EST