* kmap_atomic in 2.6.20.x
@ 2007-06-06 17:03 Raz Ben-Jehuda(caro)
2007-06-06 19:17 ` Jens Axboe
2007-06-06 20:03 ` Trond Myklebust
0 siblings, 2 replies; 4+ messages in thread
From: Raz Ben-Jehuda(caro) @ 2007-06-06 17:03 UTC (permalink / raw)
To: Linux Kernel
Hello
I am running into some problems with kmap_atomic in my driver.
My driver copies some pages coming from
user space to "kernel space kmalloc'ed memory".
I had this code running from 2.6.5 to 2.6.17 without any problems.
I have upgraded to 2.6.20.xx and this code fails to kmap_atomic.
I am running a uni processor 2 GRAM machine, 32bit.
Basically this is code does:
get_user_pages(page,...)
kmap_atomic(page,KM_USER0);
.. copy and stuff
kunmap_atomic(page,KM_USER0)
I have also tried KM_USER1 and KM_SKB_SUNRPC_DATA.
I crash in arch/i386/highmem.c line 42:
...
if (!pte_none(*(kmap_pte-idx)))
BUG();
..
To the best of my understanding ( from "see : understand the linux
kernel" page 310 ) , a different kernel component holds this window. A
fact which is quite strange in the case of KM_SKB_SUNRPC_DATA. I have
nothing that uses it.
1. Why kmap_atomic does not return NULL ?
2. Why am I failing only in high memory mappings ?
--
Raz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kmap_atomic in 2.6.20.x
2007-06-06 17:03 kmap_atomic in 2.6.20.x Raz Ben-Jehuda(caro)
@ 2007-06-06 19:17 ` Jens Axboe
2007-06-07 8:56 ` Raz Ben-Jehuda(caro)
2007-06-06 20:03 ` Trond Myklebust
1 sibling, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2007-06-06 19:17 UTC (permalink / raw)
To: Raz Ben-Jehuda(caro); +Cc: Linux Kernel
On Wed, Jun 06 2007, Raz Ben-Jehuda(caro) wrote:
> Hello
>
> I am running into some problems with kmap_atomic in my driver.
> My driver copies some pages coming from
> user space to "kernel space kmalloc'ed memory".
> I had this code running from 2.6.5 to 2.6.17 without any problems.
> I have upgraded to 2.6.20.xx and this code fails to kmap_atomic.
> I am running a uni processor 2 GRAM machine, 32bit.
>
> Basically this is code does:
>
> get_user_pages(page,...)
>
> kmap_atomic(page,KM_USER0);
> .. copy and stuff
> kunmap_atomic(page,KM_USER0)
dst = kmap_atomic(page, KM_USER0);
...
kunmap_atomic(dst, KM_USER0);
Note the subtle difference.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kmap_atomic in 2.6.20.x
2007-06-06 17:03 kmap_atomic in 2.6.20.x Raz Ben-Jehuda(caro)
2007-06-06 19:17 ` Jens Axboe
@ 2007-06-06 20:03 ` Trond Myklebust
1 sibling, 0 replies; 4+ messages in thread
From: Trond Myklebust @ 2007-06-06 20:03 UTC (permalink / raw)
To: Raz Ben-Jehuda(caro); +Cc: Linux Kernel
On Wed, 2007-06-06 at 20:03 +0300, Raz Ben-Jehuda(caro) wrote:
> If my understanding ( from "see : understand the linux
> kernel" page 310 ) , a different kernel component holds this window. A
> fact which is quite strange in the case of KM_SKB_SUNRPC_DATA. I have
> nothing that uses it.
KM_SKB_SUNRPC_DATA is verboten unless you are running in the appropriate
bh-safe socket environment. Otherwise, see Jens' comment.
Trond
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: kmap_atomic in 2.6.20.x
2007-06-06 19:17 ` Jens Axboe
@ 2007-06-07 8:56 ` Raz Ben-Jehuda(caro)
0 siblings, 0 replies; 4+ messages in thread
From: Raz Ben-Jehuda(caro) @ 2007-06-07 8:56 UTC (permalink / raw)
To: Jens Axboe; +Cc: Linux Kernel
On 6/6/07, Jens Axboe <jens.axboe@oracle.com> wrote:
> On Wed, Jun 06 2007, Raz Ben-Jehuda(caro) wrote:
> > Hello
> >
> > I am running into some problems with kmap_atomic in my driver.
> > My driver copies some pages coming from
> > user space to "kernel space kmalloc'ed memory".
> > I had this code running from 2.6.5 to 2.6.17 without any problems.
> > I have upgraded to 2.6.20.xx and this code fails to kmap_atomic.
> > I am running a uni processor 2 GRAM machine, 32bit.
> >
> > Basically this is code does:
> >
> > get_user_pages(page,...)
> >
> > kmap_atomic(page,KM_USER0);
> > .. copy and stuff
> > kunmap_atomic(page,KM_USER0)
>
> dst = kmap_atomic(page, KM_USER0);
> ...
> kunmap_atomic(dst, KM_USER0);
>
> Note the subtle difference.
>
> --
> Jens Axboe
>
>
hmm..... hammmm....haaaa
again... many many thanks Jens.
You are correct.
--
Raz
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-07 8:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-06 17:03 kmap_atomic in 2.6.20.x Raz Ben-Jehuda(caro)
2007-06-06 19:17 ` Jens Axboe
2007-06-07 8:56 ` Raz Ben-Jehuda(caro)
2007-06-06 20:03 ` Trond Myklebust
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.