linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Ravikiran G Thirumalai <kiran@scalex86.org>,
	wli@movementarian.org, Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	shai@scalex86.org, Mel Gorman <mel@csn.ul.ie>
Subject: Re: [patch] mm: Fix SHM_HUGETLB to work with users in hugetlb_shm_group
Date: Thu, 5 Feb 2009 09:06:17 -0800	[thread overview]
Message-ID: <20090205170617.GB7490@us.ibm.com> (raw)
In-Reply-To: <20090205104735.ECDA.KOSAKI.MOTOHIRO@jp.fujitsu.com>

On 05.02.2009 [11:03:09 +0900], KOSAKI Motohiro wrote:
> (cc to Mel and Nishanth)
> 
> I think this requirement is reasonable. but I also hope Mel or Nishanth
> review this.
> 
> 
> <<intentionally full quote>>
> 
> > On Wed, Feb 04, 2009 at 05:11:21PM -0500, wli@movementarian.org wrote:
> > >On Wed, Feb 04, 2009 at 02:04:28PM -0800, Ravikiran G Thirumalai wrote:
> > >> ...
> > >> As I see it we have the following options to fix this inconsistency:
> > >> 1. Do not depend on RLIMIT_MEMLOCK for hugetlb shm mappings.  If a user
> > >>    has CAP_IPC_LOCK or if user belongs to /proc/sys/vm/hugetlb_shm_group,
> > >>    he should be able to use shm memory according to shmmax and shmall OR
> > >> 2. Update the hugetlbpage documentation to mention the resource limit based
> > >>    limitation, and remove the useless /proc/sys/vm/hugetlb_shm_group sysctl
> > >> Which one is better?  I am leaning towards 1. and have a patch ready for 1.
> > >> but I might be missing some historical reason for using RLIMIT_MEMLOCK with
> > >> SHM_HUGETLB.
> > >
> > >We should do (1) because the hugetlb_shm_group and CAP_IPC_LOCK bits
> > >should both continue to work as they did prior to RLIMIT_MEMLOCK -based
> > >management of hugetlb. Please make sure the new RLIMIT_MEMLOCK -based
> > >management still enables hugetlb shm when hugetlb_shm_group and
> > >CAP_IPC_LOCK don't apply.
> > >
> > 
> > OK, here's the patch.
> > 
> > Thanks,
> > Kiran
> > 
> > 
> > Fix hugetlb subsystem so that non root users belonging to hugetlb_shm_group
> > can actually allocate hugetlb backed shm.
> > 
> > Currently non root users cannot even map one large page using SHM_HUGETLB
> > when they belong to the gid in /proc/sys/vm/hugetlb_shm_group.
> > This is because allocation size is verified against RLIMIT_MEMLOCK resource
> > limit even if the user belongs to hugetlb_shm_group.
> > 
> > This patch
> > 1. Fixes hugetlb subsystem so that users with CAP_IPC_LOCK and users
> >    belonging to hugetlb_shm_group don't need to be restricted with
> >    RLIMIT_MEMLOCK resource limits
> > 2. If a user has sufficient memlock limit he can still allocate the hugetlb
> >    shm segment.
> > 
> > Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>

Seems reasonable.

Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>

Thanks,
Nish

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-02-05 17:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 22:04 Cannot use SHM_HUGETLB as a regular user Ravikiran G Thirumalai
2009-02-04 22:11 ` wli
2009-02-05  0:41   ` [patch] mm: Fix SHM_HUGETLB to work with users in hugetlb_shm_group Ravikiran G Thirumalai
2009-02-05  2:03     ` KOSAKI Motohiro
2009-02-05 17:06       ` Nishanth Aravamudan [this message]
2009-02-05 13:25     ` Mel Gorman
2009-02-05 19:08       ` Ravikiran G Thirumalai
2009-02-05 23:32         ` wli
2009-02-06  1:28           ` Ravikiran G Thirumalai
2009-02-10 11:09         ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090205170617.GB7490@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=kiran@scalex86.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=shai@scalex86.org \
    --cc=wli@movementarian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).