Re: ioremap_nocache problem?

Jeff Hartmann (jhartmann@valinux.com)
Thu, 25 Jan 2001 10:04:47 -0700


Timur Tabi wrote:

> ** Reply to message from Roman Zippel <roman@augan.com> on Thu, 25 Jan 2001
> 17:44:51 +0100
>
>
>
>> set_bit(PG_reserved, &page->flags);
>> ioremap();
>> ...
>> iounmap();
>> clear_bit(PG_reserved, &page->flags);
>
>
> The problem with this is that between the ioremap and iounmap, the page is
> reserved. What happens if that page belongs to some disk buffer or user
> process, and some other process tries to free it. Won't that cause a problem?

The page can't belong to some other process/kernel component. You own
the page if you allocated it. The kernel will only muck with memory you
allocated if its GFP_HIGHMEM, or under certain circumstances if you map
it into a user process (There are several rules here and I won't go into
them, look at the DRM mmap setup for a start if your interested.) This
is the correct ordering of the calls (I was the one who added support to
the kernel to ioremap real ram, trust me.)

-Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/