* Ingo Molnar wrote: > > * Mel Gorman wrote: > > > From: Peter Zijlstra > > > > Note: This was originally based on Peter's patch "mm/migrate: Introduce > > migrate_misplaced_page()" but borrows extremely heavily from Andrea's > > "autonuma: memory follows CPU algorithm and task/mm_autonuma stats > > collection". The end result is barely recognisable so signed-offs > > had to be dropped. If original authors are ok with it, I'll > > re-add the signed-off-bys. > > > > Add migrate_misplaced_page() which deals with migrating pages from > > faults. > > > > Based-on-work-by: Lee Schermerhorn > > Based-on-work-by: Peter Zijlstra > > Based-on-work-by: Andrea Arcangeli > > Signed-off-by: Mel Gorman > > --- > > include/linux/migrate.h | 8 ++++ > > mm/migrate.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++- > > 2 files changed, 110 insertions(+), 2 deletions(-) > > That's a nice patch - the TASK_NUMA_FAULT approach in the > original patch was not very elegant. > > I've started testing it to see how well your version works. Hm, I'm seeing some instability - see the boot crash below. If I undo your patch it goes away. ( To help debugging this I've attached migration.patch which applies your patch on top of Peter's latest queue of patches. If I revert this patch then the crash goes away. ) I've gone back to the well-tested page migration code from Peter for the time being. Thanks, Ingo [ 7.999147] Freeing unused kernel memory: 148k freed [ 8.004841] Freeing unused kernel memory: 44k freed [ 8.028683] BUG: Bad page state in process init pfn:815ae6 [ 8.034462] page:ffffea002056b980 count:0 mapcount:1 mapping:ffff8804175c3218 index:0x14 [ 8.042835] page flags: 0xc080000000001c(referenced|uptodate|dirty) [ 8.049884] Modules linked in: [ 8.053164] Pid: 1, comm: init Not tainted 3.7.0-rc5-01482-g324e8d9-dirty #349 [ 8.060626] Call Trace: [ 8.063246] [] bad_page+0xe6/0xfb [ 8.068358] [] free_pages_prepare+0x104/0x110 [ 8.074510] [] free_hot_cold_page+0x40/0x160 [ 8.080576] [] __put_single_page+0x27/0x30 [ 8.084612] usb 3-1: New USB device found, idVendor=1241, idProduct=1503 [ 8.084615] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 8.084618] usb 3-1: Product: USB Keyboard [ 8.084620] usb 3-1: Manufacturer: [ 8.098878] input: USB Keyboard as /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/input/input5 [ 8.099128] hid-generic 0003:1241:1503.0003: input,hidraw2: USB HID v1.10 Keyboard [ USB Keyboard] on usb-0000:00:12.0-1/input0 [ 8.121649] input: USB Keyboard as /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.1/input/input6 [ 8.121896] hid-generic 0003:1241:1503.0004: input,hidraw3: USB HID v1.10 Device [ USB Keyboard] on usb-0000:00:12.0-1/input1 [ 8.150442] [] put_page+0x35/0x50 [ 8.155563] [] handle_pte_fault+0x3c0/0xbb0 [ 8.161544] [] ? native_flush_tlb_others+0x2e/0x30 [ 8.168137] [] handle_mm_fault+0x278/0x340 [ 8.174030] [] __do_page_fault+0x172/0x4e0 [ 8.179933] [] ? task_numa_work+0x21e/0x2f0 [ 8.185935] [] ? task_work_run+0xac/0xe0 [ 8.191657] [] do_page_fault+0xe/0x10 [ 8.197126] [] page_fault+0x28/0x30 [ 8.202411] Disabling lock debugging due to kernel taint [ 8.208057] ------------[ cut here ]------------ [ 8.212843] kernel BUG at include/linux/mm.h:419! [ 8.217688] invalid opcode: 0000 [#1] SMP [ 8.222075] Modules linked in: [ 8.225345] CPU 8 [ 8.227256] Pid: 1, comm: init Tainted: G B 3.7.0-rc5-01482-g324e8d9-dirty #349 Supermicro H8DG6/H8DGi/H8DG6/H8DGi [ 8.239018] RIP: 0010:[] [] get_page.part.44+0x4/0x6 [ 8.247489] RSP: 0000:ffff880415c67d08 EFLAGS: 00010246 [ 8.252940] RAX: 0000000000000000 RBX: ffff8808161bc5e0 RCX: 000000002056b980 [ 8.260210] RDX: 0000000815ae6100 RSI: 00007f006f4bc915 RDI: 0000000815ae6100 [ 8.267488] RBP: ffff880415c67d08 R08: ffff88081499e2c0 R09: 0000000000000028 [ 8.274763] R10: 00007fffcaf301a0 R11: 00007fffcaf302b0 R12: ffffea002056b980 [ 8.282042] R13: 0000000815ae6100 R14: ffff88081499e2c0 R15: ffffea0020586f30 [ 8.289318] FS: 00007f006f6c3740(0000) GS:ffff880817c00000(0000) knlGS:0000000000000000 [ 8.297626] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 8.303537] CR2: 00007f006f4bc915 CR3: 00000008161b1000 CR4: 00000000000407e0 [ 8.310813] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 8.318091] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 8.325369] Process init (pid: 1, threadinfo ffff880415c66000, task ffff880415c68000) [ 8.333416] Stack: [ 8.335570] ffff880415c67dc8 ffffffff811ae135 ffff8808149a02b8 00000000004da000 [ 8.343505] 0000000000400000 00000000004da000 ffff880415c67d68 ffffffff81098cee [ 8.351475] ffff880415c67d68 ffffffff00000028 ffff8808149a02b8 ffff8808149a0000 [ 8.359384] Call Trace: [ 8.361977] [] handle_pte_fault+0xba5/0xbb0 [ 8.367957] [] ? native_flush_tlb_others+0x2e/0x30 [ 8.374538] [] ? flush_tlb_mm_range+0x1ee/0x230 [ 8.380856] [] handle_mm_fault+0x278/0x340 [ 8.386740] [] __do_page_fault+0x172/0x4e0 [ 8.392625] [] ? __switch_to+0x181/0x4a0 [ 8.398343] [] ? task_numa_work+0x21e/0x2f0 [ 8.404315] [] ? task_work_run+0xac/0xe0 [ 8.410026] [] do_page_fault+0xe/0x10 [ 8.415478] [] page_fault+0x28/0x30 [ 8.420753] Code: 99 ff ff ff 85 c0 74 0c 4c 89 e0 48 c1 e0 06 48 29 d8 eb 02 31 c0 5b 41 5c 5d c3 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55 48 89 e5 <0f> 0b 55 48 8b 07 31 c9 48 89 e5 f6 c4 40 74 03 8b 4f 68 bf 00 [ 8.444972] RIP [] get_page.part.44+0x4/0x6 [ 8.451021] RSP [ 8.454674] ---[ end trace 871518523836e5de ]--- [ 32.668913] BUG: soft lockup - CPU#8 stuck for 22s! [init:1]