lkml.org 
[lkml]   [2004]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix incorrect kunmap_atomic in pktcdvd
Peter Osterlund <petero2@telia.com> wrote:
>> Why was the interface made different from kmap()/kunmap() in the first
>> place? Wouldn't it have made more sense to let kunmap_atomic() take a
>> page pointer as the first parameter?

On Sun, Oct 24, 2004 at 04:18:27AM -0700, Andrew Morton wrote:
> No, kmap-atomic() maps a single page into the CPU's address space by making
> a pte point at the page. To unmap that page we need to get at the pte, not
> at the page. If kmap_atomic() were to take a pageframe address we'd need
> to search the whole fixmap space for the corresponding page - a reverse
> lookup.

I don't recall anything truly ancient, but fixmap indices should be
enough to recover the virtual address and pte. I think the virtual
address is primarily for checking purposes. The same kind of check
could be done by checking the pfn derived from the page structure
against the contents of the pte at the fixmap index, but I suspect
more damage would ensue from changing the calling convention than
aligning it with common expectations.


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

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.131 / U:0.436 seconds]
©2003-2014 Jasper Spaans. Advertise on this site