lkml.org 
[lkml]   [2006]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to map high memory for block io
Russell King wrote:
> On Fri, Jan 27, 2006 at 09:04:33PM +0100, Pierre Ossman wrote:
>
>> Russell King wrote:
>>
>>> I don't see what the problem is. A sg entry is a list of struct page
>>> pointers, an offset, and a size. As such, it can't describe a transfer
>>> which crosses a page because such a structure does not imply that one
>>> struct page follows another struct page.
>>>
>> If the pages do not strictly follow each other then there is a lot of
>> broken code in the kernel. drivers/mmc/mmci.c and drivers/block/ub.c
>> being two occurences since both assume they can access the entire entry
>> through a single mapping.
>>
>
> We don't make that assumption. What we do is:
>
> - map the current sg using kmap_atomic()
> - copy up to sg->length into or out of that mapping
> - unmap current sg
> - if we have reached the end of this sg, move on to the next
>

This it the algorithm I've been following, but...

> What this means is that we assume sg->offset + sg->length <= PAGE_SIZE
>

This doesn't seem to be true. Since when tracking this problem I added
the following:

BUG_ON((host->cur_sg->length + host->cur_sg->offset) > PAGE_SIZE);


which subsequently triggered. That was the start of my quest for how to
do highmem properly.

Rgds
Pierre


-
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: 2006-01-27 21:31    [W:3.046 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site