Re: Implement mmap for PUD

2011-09-10 Thread Masao Uebayashi
On Sat, Sep 10, 2011 at 7:24 PM, Roger Pau Monné roger@entel.upc.edu wrote: Hello, Thanks for the atop tip, now I'm able to pass the memory around, but the kernel crashes shortly after reading the value from the returned memory region: panic: kernel diagnostic assertion

Re: Implement mmap for PUD

2011-09-10 Thread Roger Pau Monné
It is called pipe(2), isn't it? Thanks for the reply, but I don't understand why pipe could be helpful in this situation, the mmap kernel call needs to return a paddr_t (a memory region), and pipe returns a pair of file descriptors, that I cannot pass to the kernel. The flow of a PUD call is

Re: Perform mmap and poll on PUD character devices

2011-09-10 Thread Roger Pau Monné
Hello, Thanks for the reply, sometimes I'm so focused in the problem that I forget the big picture. PUD is a framework present in NetBSD that allows to implement character and block devices in userspace. [1] The blktap (“block tap”) userspace toolkit provides a user-level disk I/O interface in

Re: Perform mmap and poll on PUD character devices

2011-09-10 Thread Thor Lancelot Simon
On Sat, Sep 10, 2011 at 12:05:53PM +0200, Roger Pau Monn? wrote: Hello, Thanks for the reply, sometimes I'm so focused in the problem that I forget the big picture. PUD is a framework present in NetBSD that allows to implement character and block devices in userspace. [1] The blktap

Re: Perform mmap and poll on PUD character devices

2011-09-10 Thread Mouse
I do not understahd why it is desirable to involve additional context switches to and from userspace into this data path. Instead of writing a bunch of fairly dubious page mapping code [...] in the kernel to support user-space daemons handling various virtual disk formats, why not put the

Re: netbsd-5 deadlocks when memory is low

2011-09-10 Thread Emmanuel Dreyfus
Manuel Bouyer bou...@antioche.eu.org wrote: You have mlock(2) for this. I think ntpd uses it, you can have a look here. Of course you don't want to mlock a big process ... You meant mlockall(2) It seemed to work, but after intensive testing I still see deadlocks, and a printf added in

Re: netbsd-5 deadlocks when memory is low

2011-09-10 Thread Emmanuel Dreyfus
Emmanuel Dreyfus m...@netbsd.org wrote: [using mlockall(2) to prevent userland filesystem to be swaped out] It seemed to work, but after intensive testing I still see deadlocks, and a printf added in uvm_swapout() shows that perfused still gets swaped out despite the mlockall call. Is that a