[ofa-general] ib_umem_get lock_limiting...

Arthur Jones arthur.jones at qlogic.com
Thu Aug 16 14:16:09 PDT 2007


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 how much memory the process may lock.

       Since Linux 2.6.9, no limits are placed on the amount of memory that  a
       privileged  process can lock and the RLIMIT_MEMLOCK soft resource limit
       instead defines a limit on how much memory an unprivileged process  may
       lock.

arthur

On Thu, Aug 16, 2007 at 01:33:04PM -0700, Roland Dreier wrote:
>  > 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 code is correct.  CAP_IPC_LOCK basically means we are
> root and should ignore resource limits.  You can compare against the
> code in sys_mlock() to see that it has exactly the same logic.



More information about the general mailing list