[ofa-general] ib_umem_get lock_limiting...

2007-08-16 Thread Arthur Jones
hi all, in ib_umem_get() in drivers/infiniband/core/umem.c in the kernel.org driver at around line 115, we: locked = npages + current-mm-locked_vm; lock_limit = current-signal-rlim[RLIMIT_MEMLOCK].rlim_cur PAGE_SHIFT; if ((locked lock_limit)

Re: [ofa-general] ib_umem_get lock_limiting...

2007-08-16 Thread Roland Dreier
the calculation looks ok, but it looks to me like the should be an || in the test, esp since earlier in the routine, we do an: if (!can_do_mlock()) return ERR_PTR(-EPERM); so, maybe the !capable(CAP_IPC_LOCK) should not be there at all? No, I think the

Re: [ofa-general] ib_umem_get lock_limiting...

2007-08-16 Thread Arthur Jones
hi roland, thanks, i get it now, it also helped when i saw this in the memlock manpage: Limits and permissions In Linux 2.6.8 and earlier, a process must be privileged (CAP_IPC_LOCK) in order to lock memory and the RLIMIT_MEMLOCK soft resource limit defines a limit on