Kirill A. Shutemov
461c7fa126
drivers/scsi/sg.c: mark VMA as VM_IO to prevent migration
Reduced testcase:
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <numaif.h>
#define SIZE 0x2000
int main()
{
int fd;
void *p;
fd = open("/dev/sg0", O_RDWR);
p = mmap(NULL, SIZE, PROT_EXEC, MAP_PRIVATE | MAP_LOCKED, fd, 0);
mbind(p, SIZE, 0, NULL, 0, MPOL_MF_MOVE);
return 0;
}
We shouldn't try to migrate pages in sg VMA as we don't have a way to
update Sg_scatter_hold::pages accordingly from mm core.
Let's mark the VMA as VM_IO to indicate to mm core that the VMA is not
migratable.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Shiraz Hashim <shashim@codeaurora.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: syzkaller <syzkaller@googlegroups.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-02-03 08:28:43 -08:00
..
2016-01-29 21:44:53 +01:00
2016-01-11 19:33:59 -08:00
2016-01-31 16:55:04 -08:00
2016-01-17 12:32:01 -08:00
2016-01-24 12:34:13 -08:00
2016-01-06 16:37:14 +01:00
2016-01-20 18:42:30 -08:00
2016-01-06 08:25:24 -05:00
2016-01-26 22:27:34 +08:00
2016-01-20 18:16:29 -08:00
2016-01-31 15:49:06 -08:00
2016-01-29 21:45:17 +01:00
2016-01-29 21:45:17 +01:00
2016-01-30 22:05:17 +08:00
2016-01-13 17:30:33 +09:00
2016-01-20 10:15:21 -08:00
2016-01-20 17:09:18 -08:00
2016-01-20 18:03:56 -08:00
2016-01-29 10:04:29 +10:00
2016-01-20 17:30:20 -08:00
2016-01-07 16:07:54 +01:00
2016-01-13 10:23:36 -08:00
2016-01-27 18:48:46 -08:00
2016-01-29 11:13:52 +01:00
2016-01-18 14:12:33 -05:00
2016-01-31 17:00:27 -08:00
2016-01-23 18:45:06 -08:00
2016-01-22 17:20:30 -08:00
2016-01-29 12:30:47 +01:00
2016-01-31 14:48:58 -08:00
2016-01-11 23:55:43 -05:00
2016-01-17 12:32:01 -08:00
2016-01-12 12:17:28 +01:00
2016-01-12 08:21:18 -07:00
2016-01-21 18:19:38 -08:00
2016-01-20 17:09:18 -08:00
2016-01-20 18:42:30 -08:00
2016-01-20 17:09:18 -08:00
2016-01-17 12:32:01 -08:00
2016-01-21 12:32:08 -08:00
2016-01-22 12:04:21 -08:00
2016-01-24 12:50:56 -08:00
2016-02-01 15:56:08 -08:00
2016-01-21 19:53:10 -05:00
2016-01-29 17:43:16 -08:00
2016-01-21 19:58:02 -08:00
2016-02-01 15:56:08 -08:00
2016-01-22 18:04:28 -05:00
2016-01-20 17:09:18 -08:00
2016-01-29 21:44:53 +01:00
2016-01-17 12:32:01 -08:00
2016-01-24 10:15:01 -08:00
2016-01-14 01:03:18 +01:00
2016-01-12 01:12:40 +01:00
2016-01-29 12:38:59 -08:00
2016-01-21 15:04:59 +01:00
2016-01-20 17:09:18 -08:00
2016-01-15 12:14:47 -08:00
2016-01-12 20:47:06 +02:00
2016-01-12 20:47:06 +02:00
2016-01-18 12:10:45 -08:00
2016-01-26 12:47:51 +01:00
2016-02-03 08:28:43 -08:00
2016-01-22 17:30:52 -08:00
2016-01-15 13:18:47 -08:00
2016-01-19 21:25:57 +02:00
2016-01-31 17:09:39 -08:00
2016-01-21 19:58:02 -08:00
2016-01-24 12:43:06 -08:00
2016-01-31 17:09:39 -08:00
2016-01-28 08:32:42 -08:00
2016-01-27 11:22:25 -07:00
2016-01-22 18:04:28 -05:00
2016-01-26 10:18:28 +02:00
2016-01-11 22:48:05 +01:00
2016-01-29 15:13:48 -08:00