Linux IA64 platform development
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>,
	Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Hugh Dickins <hughd@google.com>,
	linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
	Michel Lespinasse <walken@google.com>,
	Oleg Nesterov <oleg@redhat.com>,
	linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Don't mlock guardpage if the stack is growing up
Date: Mon, 09 May 2011 22:31:42 +0000	[thread overview]
Message-ID: <BANLkTim7ATRyJ2NvoCj4Sv=7CLizKMd_WA@mail.gmail.com> (raw)
In-Reply-To: <1304979549.4865.56.camel@mulgrave.site>

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

On Mon, May 9, 2011 at 3:19 PM, James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
>
> So I can test the patch, if you tell me how.  I don't use lvm2, so it
> would have to be a simple test case.

Something like the attached. Run it as root (it needs root just for
the mlockall), and see whether the stack it shows changes.

With current kernels, I think the stack expands by one page during the
mlockall (for STACK_GROWSUP), with the patch it shouldn't.

                   Linus

[-- Attachment #2: t.c --]
[-- Type: text/x-csrc, Size: 400 bytes --]

#include <stdio.h>
#include <string.h>
#include <sys/mman.h>

static void show_stack(void)
{
	FILE *map;
	char buf[1000];

	map = fopen("/proc/self/maps", "r");
	if (!map)
		return;

	while (fgets(buf, 1000, map)) {
		if (!strstr(buf, "[stack]"))
			continue;
		fputs(buf, stdout);
	}

	fclose(map);
}

int main(void)
{
	show_stack();
	mlockall(MCL_CURRENT | MCL_FUTURE);
	show_stack();
	return 0;
}

  reply	other threads:[~2011-05-09 22:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.00.1105082045250.15552@artax.karlin.mff.cuni.cz>
     [not found] ` <alpine.LSU.2.00.1105081303540.16151@sister.anvils>
     [not found]   ` <alpine.DEB.2.00.1105091307570.32299@artax.karlin.mff.cuni.cz>
     [not found]     ` <BANLkTinCUQSjjif3op3H_9HDm5Eu-o+Luw@mail.gmail.com>
2011-05-09 22:07       ` [PATCH] Don't mlock guardpage if the stack is growing up Linus Torvalds
2011-05-09 22:19         ` James Bottomley
2011-05-09 22:31           ` Linus Torvalds [this message]
2011-05-09 22:53             ` Tony Luck
2011-05-09 22:58               ` Linus Torvalds
2011-05-09 23:08                 ` Tony Luck
2011-05-09 23:17                   ` Linus Torvalds
2011-05-09 23:25                     ` Linus Torvalds
2011-05-10  4:12                       ` James Bottomley
2011-05-09 22:26         ` Mikulas Patocka
2011-05-15 22:18           ` Mikulas Patocka

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='BANLkTim7ATRyJ2NvoCj4Sv=7CLizKMd_WA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=fenghua.yu@intel.com \
    --cc=hughd@google.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    --cc=oleg@redhat.com \
    --cc=tony.luck@intel.com \
    --cc=walken@google.com \
    /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