Re: [RFC] [PATCH] hugetlbfs :shmget with SHM_HUGETLB only works as root

2008-01-30 Thread Ciju Rajan K
Ciju Rajan K wrote: William Lee Irwin III wrote: On Fri, Nov 30, 2007 at 12:02:32AM +0530, Ciju Rajan K wrote: I tested your patch. But that is not solving the problem. If the code change to user_shm_lock() is not a good solution, could you please suggest a method so that the normal user i

Re: [RFC] [PATCH] hugetlbfs :shmget with SHM_HUGETLB only works as root

2008-01-29 Thread Ciju Rajan K
William Lee Irwin III wrote: On Fri, Nov 30, 2007 at 12:02:32AM +0530, Ciju Rajan K wrote: I tested your patch. But that is not solving the problem. If the code change to user_shm_lock() is not a good solution, could you please suggest a method so that the normal user is able to allocate t

Re: [RFC] [PATCH] hugetlbfs :shmget with SHM_HUGETLB only works as root

2007-11-29 Thread William Lee Irwin III
On Fri, Nov 30, 2007 at 12:02:32AM +0530, Ciju Rajan K wrote: > I tested your patch. But that is not solving the problem. > If the code change to user_shm_lock() is not a good solution, could > you please suggest a method so that the normal user is able to allocate > the huge pages, if his gi

Re: [RFC] [PATCH] hugetlbfs :shmget with SHM_HUGETLB only works as root

2007-11-29 Thread Ciju Rajan K
Hi Wli, I tested your patch. But that is not solving the problem. If the code change to user_shm_lock() is not a good solution, could you please suggest a method so that the normal user is able to allocate the huge pages, if his gid is added to /proc/sys/vm/hugetlb_shm_group Thanks Ciju W

Re: [RFC] [PATCH] hugetlbfs :shmget with SHM_HUGETLB only works as root

2007-11-16 Thread Ciju Rajan K
Hi Adam, If this condition check is not included, the root user have to use the function setrlimit() to set the lock_limit of a normal user to RLIM_INFINITY. I think the /proc interface 'hugetlb_shm_group' is introduced to avoid these difficulties. Please correct me, if I am wrong. Regardin

Re: [RFC] [PATCH] hugetlbfs :shmget with SHM_HUGETLB only works as root

2007-11-14 Thread William Lee Irwin III
On Wed, Nov 14, 2007 at 09:31:41AM -0600, aglitke wrote: > ... if the user's locked limit (ulimit -l) is set to unlimited, allowed > (above) is set to 1. In that case, the second part of that if() is > bypassed, and the function grants permission. Therefore, the easy > solution is to make sure yo

Re: [RFC] [PATCH] hugetlbfs :shmget with SHM_HUGETLB only works as root

2007-11-14 Thread aglitke
Hi Ciju: I am still not exactly sure why this patch is needed. As I read user_shm_lock(): > lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur; > if (lock_limit == RLIM_INFINITY) > allowed = 1; > lock_limit >>= PAGE_SHIFT; > spin_lock(&shmlock_user_lock); > if (!allowed && > l

[RFC] [PATCH] hugetlbfs :shmget with SHM_HUGETLB only works as root

2007-11-14 Thread Ciju Rajan K
When a normal user is trying to allocate huge pages using shmget(), the user is not able to get the memory even if the gid is present in /proc/sys/vm/hugetlb_shm_group. The function user_shm_lock() is not successful. The user does not have the capability to perform a CAP_IPC_LOCK. A check is ad