linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Don Dupuis <dondster@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Hugh Dickins <hugh@veritas.com>
Subject: Re: Can't mlock hugetlb in 2.6.15
Date: Fri, 20 Jan 2006 23:52:40 -0800	[thread overview]
Message-ID: <20060120235240.39d34279.akpm@osdl.org> (raw)
In-Reply-To: <632b79000601181149o67f1c013jfecc5e32ee17fe7e@mail.gmail.com>

Don Dupuis <dondster@gmail.com> wrote:
>
> I have an app that mlocks hugepages. The same app works just fine in 2.6.14.
> This app has 128MB or more of shared memory that is using hugepages via
> mmap. When I try this, I get the error "can't allocate memory".  Is this a
> kernel bug or is this not supported anymore.  I want to guarantee that
> this memory doesn't get swapped out to a swap device.

hugetlb areas are not pageable and it's very unlikely that they will become
so in the forseeable future.  So you don't need to do this.

That being said, we shouldn't have broken your application.

I guess a suitable back-compatibility fix would be to check for a hugetlb
vma early on and return "success" for that vma section without actually
doing anything.

But we need to understand why this happened.

> I made the same
> modifications to include/linux/resource.h that was in 2.6.14, which
> set MLOCK_LIMIT to 2GB.
> 

That's rather naughty of you ;) You're supposed to use setrlimit() in a
parent process for this...


  reply	other threads:[~2006-01-21  7:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-18 19:49 Can't mlock hugetlb in 2.6.15 Don Dupuis
2006-01-21  7:52 ` Andrew Morton [this message]
2006-01-21 14:12   ` Nick Piggin
2006-01-23  2:32     ` Don Dupuis
2006-01-23 19:51       ` Hugh Dickins
2006-01-23 20:53         ` Don Dupuis
2006-01-23 21:34         ` Adam Litke
2006-01-23 23:52         ` William Lee Irwin III

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=20060120235240.39d34279.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dondster@gmail.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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).