All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: kirill.shutemov@linux.intel.com
Cc: oleg@redhat.com, hpa@zytor.com, luto@amacapital.net,
	dave.hansen@linux.intel.com, mingo@elte.hu, minchan@kernel.org,
	tglx@linutronix.de, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: LTP regressions due to 6dc296e7df4c ("mm: make sure all file VMAs have ->vm_ops set")
Date: Mon, 14 Sep 2015 11:53:46 +0100	[thread overview]
Message-ID: <20150914105346.GB23878@arm.com> (raw)

Hi Kirill,

Your patch 6dc296e7df4c ("mm: make sure all file VMAs have ->vm_ops set")
causes some mmap regressions in LTP, which appears to use a MAP_PRIVATE
mmap of /dev/zero as a way to get anonymous pages in some of its tests
(specifically mmap10 [1]).

Dead simple reproducer below. Is this change in behaviour intentional?

Will

[1]
http://sourceforge.net/p/ltp/git/ci/1eb440c2b5fe43a3e5023015a16aa5d7d3385b1e/tree/testcases/kernel/syscalls/mmap/mmap10.c

--->8

#include <sys/mman.h>
#include <sys/stat.h>

#include <fcntl.h>
#include <stdio.h>

#define MAP_SZ	5*1024*1024

int main(void)
{
	char *foo;
	int fd;

	fd = open("/dev/zero", O_RDWR, 0666);
	if (fd < 0) {
		perror(NULL);
		return fd;
	}

	foo = mmap(NULL, MAP_SZ, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
	if (foo == MAP_FAILED) {
		perror(NULL);
		return -1;
	}

	foo[MAP_SZ >> 1] = 0; // Generates SIGBUS with 4.3-rc1
	return 0;
}

--
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>

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: kirill.shutemov@linux.intel.com
Cc: oleg@redhat.com, hpa@zytor.com, luto@amacapital.net,
	dave.hansen@linux.intel.com, mingo@elte.hu, minchan@kernel.org,
	tglx@linutronix.de, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: LTP regressions due to 6dc296e7df4c ("mm: make sure all file VMAs have ->vm_ops set")
Date: Mon, 14 Sep 2015 11:53:46 +0100	[thread overview]
Message-ID: <20150914105346.GB23878@arm.com> (raw)

Hi Kirill,

Your patch 6dc296e7df4c ("mm: make sure all file VMAs have ->vm_ops set")
causes some mmap regressions in LTP, which appears to use a MAP_PRIVATE
mmap of /dev/zero as a way to get anonymous pages in some of its tests
(specifically mmap10 [1]).

Dead simple reproducer below. Is this change in behaviour intentional?

Will

[1]
http://sourceforge.net/p/ltp/git/ci/1eb440c2b5fe43a3e5023015a16aa5d7d3385b1e/tree/testcases/kernel/syscalls/mmap/mmap10.c

--->8

#include <sys/mman.h>
#include <sys/stat.h>

#include <fcntl.h>
#include <stdio.h>

#define MAP_SZ	5*1024*1024

int main(void)
{
	char *foo;
	int fd;

	fd = open("/dev/zero", O_RDWR, 0666);
	if (fd < 0) {
		perror(NULL);
		return fd;
	}

	foo = mmap(NULL, MAP_SZ, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
	if (foo == MAP_FAILED) {
		perror(NULL);
		return -1;
	}

	foo[MAP_SZ >> 1] = 0; // Generates SIGBUS with 4.3-rc1
	return 0;
}

             reply	other threads:[~2015-09-14 10:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 10:53 Will Deacon [this message]
2015-09-14 10:53 ` LTP regressions due to 6dc296e7df4c ("mm: make sure all file VMAs have ->vm_ops set") Will Deacon
2015-09-14 11:57 ` Kirill A. Shutemov
2015-09-14 11:57   ` Kirill A. Shutemov
2015-09-14 13:22   ` Will Deacon
2015-09-14 13:22     ` Will Deacon
2015-09-14 17:05   ` Oleg Nesterov
2015-09-14 17:05     ` Oleg Nesterov
2015-09-14 17:46     ` Oleg Nesterov
2015-09-14 17:46       ` Oleg Nesterov
2015-09-14 18:20     ` Kirill A. Shutemov
2015-09-14 18:20       ` Kirill A. Shutemov
2015-09-15 12:12       ` Oleg Nesterov
2015-09-15 12:12         ` Oleg Nesterov
2015-09-15 13:42         ` Kirill A. Shutemov
2015-09-15 13:42           ` Kirill A. Shutemov
2015-09-15 15:13           ` Oleg Nesterov
2015-09-15 15:13             ` Oleg Nesterov
2015-09-16 21:28           ` Andrew Morton
2015-09-16 21:28             ` Andrew Morton
2015-09-17 15:37             ` Kirill A. Shutemov
2015-09-17 15:37               ` Kirill A. Shutemov

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=20150914105346.GB23878@arm.com \
    --to=will.deacon@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@amacapital.net \
    --cc=minchan@kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.