All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] Is MADV_HWPOISON supposed to work only on faulted-in pages?
@ 2017-02-14 15:41 ` Jan Stancek
  0 siblings, 0 replies; 26+ messages in thread
From: Jan Stancek @ 2017-02-14 15:41 UTC (permalink / raw)
  To: ltp

Hi,

code below (and LTP madvise07 [1]) doesn't produce SIGBUS,
unless I touch/prefault page before call to madvise().

Is this expected behavior?

Thanks,
Jan

[1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/madvise/madvise07.c

-------------------- 8< --------------------
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>

int main(void)
{
	void *mem = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE,
			MAP_ANONYMOUS | MAP_PRIVATE /*| MAP_POPULATE*/,
			-1, 0);

	if (mem == MAP_FAILED)
		exit(1);

	if (madvise(mem, getpagesize(), MADV_HWPOISON) == -1)
		exit(1);

	*((char *)mem) = 'd';

	return 0;
}
-------------------- 8< --------------------

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2017-03-28 20:26 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-14 15:41 [LTP] Is MADV_HWPOISON supposed to work only on faulted-in pages? Jan Stancek
2017-02-14 15:41 ` Jan Stancek
2017-02-20  5:00 ` [LTP] " Naoya Horiguchi
2017-02-20  5:00   ` Naoya Horiguchi
2017-02-23  3:23   ` [LTP] " Naoya Horiguchi
2017-02-23  3:23     ` Naoya Horiguchi
2017-02-25  2:28     ` [LTP] " Yisheng Xie
2017-02-25  2:28       ` Yisheng Xie
2017-02-27  1:20       ` [LTP] " Naoya Horiguchi
2017-02-27  1:20         ` Naoya Horiguchi
2017-02-27  4:27         ` [LTP] " Zi Yan
2017-02-27  4:27           ` Zi Yan
2017-02-27  6:33           ` [LTP] " Naoya Horiguchi
2017-02-27  6:33             ` Naoya Horiguchi
2017-02-27 16:10             ` [LTP] " Zi Yan
2017-02-27 16:10               ` Zi Yan
2017-03-14 13:20             ` [LTP] " Cyril Hrubis
2017-03-14 13:20               ` Cyril Hrubis
2017-03-27 12:08             ` Richard Palethorpe
2017-03-27 12:08               ` Richard Palethorpe
2017-03-27 23:54     ` Andi Kleen
2017-03-27 23:54       ` Andi Kleen
2017-03-28  8:25       ` [LTP] " Cyril Hrubis
2017-03-28  8:25         ` Cyril Hrubis
2017-03-28 20:26         ` Andi Kleen
2017-03-28 20:26           ` Andi Kleen

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.