On Sun, Jan 10, 2010 at 2:31 PM, Joel Fernandes <agnel.joel@xxxxxxxxx> wrote: > Actually the unbounded delays is not an issue as the lookups are > usually happening as deferred work, and most of my code is in kernel > space so I'm not sure if pushing off the hashtable lookup code to > userspace is a good idea.. > > Thanks for pointing out that mmap wouldn't work in kernel space. But > out of curiosity, does this have to do with the fact thatmm is set to > NULL for a kernel thread task_struct? Why would page faults result in > an OOPs because if I vmalloc something in the kernel, isn't it already > mapped? vmalloc won't result in page faults because it's mapped immediately, yes. However that means it won't be file-backed. The file-backed mapping support in the kernel relies on page faults to identify when pages are dirtied, and the PF handler in the kernel will trigger an oops unless the faulting address is registered as a userspace transfer point. While it might be possible to shoehorn in kernel support for kernel-mode file-backed mappings, you'd have to be very careful that you're not violating existing assumptions in the VM subsystem; it'd be far easier and safer to just push it into userspace (and I can assure you you'll never manage to upstream it if it's using file-backed mappings in kernel mode :) -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ