A few questions about nbd
From: Kasper Dupont (kasperd_at_daimi.au.dk)
Date: 07/31/03
- Next message: Michael Quinlivan: "kernel spinlocks"
- Previous message: Mirek: "bcl patch ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 31 Jul 2003 10:48:20 +0200
I want to implement a new block device encryption. It
is more complicated than what can be implemented using
cryptoloop. First I want to do a proof of concept
implementation in user mode. For that nbd seems like
the right choice. Later I will consider a kernel
implementation.
The nbd documentation suggests that running client and
server on the same machine can cause deadlocks. Is
that completely unavoidable? Right now I use mlockall
and touch all my pages before I start doing any nbd
stuff. Is there still a possibility of deadlocks, and
how?
Looking in the source I found, that my program will
need to call the NBD_DO_IT ioctl, which will enter a
while (1) loop in the kernel. What is the proper way
to leave that loop again? To me it looks like the only
way out of the loop is this piece of code:
if (!req) {
printk(KERN_ALERT "req should never be null\n" );
goto out;
}
I can probably force that to happen, but shouldn't
there be a cleaner way? And isn't it kind of waste to
keep user space around when I really just want to
keep the process in kernel mode until I want it to
quit. It is not just a piece of memory wasted, but
also a TLB flush on context switches.
-- Kasper Dupont -- der bruger for meget tid paa usenet. For sending spam use mailto:aaarep@daimi.au.dk Their business was zero and it was shrinking.
- Next message: Michael Quinlivan: "kernel spinlocks"
- Previous message: Mirek: "bcl patch ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|