sirlucjan / kernel-patches

Custom Linux kernel patches

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Request] Please consider adding Speculative Page Faults

ms178 opened this issue · comments

commented

Your repo was mentioned in a recent comment Phoronix forum post. What a great ressource!

I want to suggest to add the Speculative Page Faults series from Michel Lespinasse to your collection as it decreases application startup time quite significantly which is important for desktop and mobile use cases. You can read about it at LWN (https://lwn.net/Articles/851853/), the most recent series is found at the developer's Github repo (mid-June 2021): https://github.com/lespinasse/linux/tree/v5.12-spf

I had to adjust one file to get it to apply to 5.12.19 and I don't know how hard it would be to maintain the patchset going forward but as 5.12 EOLed recently, a place such as your repo to get a re-based version would be great.

I'll try by Friday to see if these patches can be applied to line 5.13 - if they can, I'll put the patches in my repository. If the patches fail, I will have to wait until the author ported them to the 5.13 line.

Attempting to patch the sources produced this result. Unfortunately, at the moment it's impossible to include them for line 5.13. If you want it to work, you should tell the author to port it to the latest kernel.

---> patching source with ../0001-scripts-package-builddeb-add-UPLOAD_DIR-and-NO_HEADE.patch <---
patching file scripts/package/builddeb
---> patching source with ../0002-build-fixes.patch <---
patching file arch/x86/boot/compressed/kaslr.c
---> patching source with ../0003-enable-Werror-build.patch <---
patching file .force_werror
patching file .gitignore
---> patching source with ../0004-mm-export-dump_mm.patch <---
patching file mm/debug.c
---> patching source with ../0005-mmap-locking-API-mmap_lock_is_contended-returns-a-bo.patch <---
patching file include/linux/mmap_lock.h
---> patching source with ../0006-mmap-locking-API-name-the-return-values.patch <---
patching file include/linux/mmap_lock.h
---> patching source with ../0007-do_anonymous_page-use-update_mmu_tlb.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 3652 (offset 85 lines).
---> patching source with ../0008-do_anonymous_page-reduce-code-duplication.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 3579 (offset 84 lines).
Hunk #2 FAILED at 3525.
1 out of 2 hunks FAILED -- saving rejects to file mm/memory.c.rej
---> patching source with ../0009-mm-introduce-CONFIG_SPECULATIVE_PAGE_FAULT.patch <---
patching file mm/Kconfig
Hunk #1 FAILED at 872.
1 out of 1 hunk FAILED -- saving rejects to file mm/Kconfig.rej
---> patching source with ../0010-x86-mm-define-ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT.patch <---
patching file arch/x86/Kconfig
---> patching source with ../0011-mm-add-FAULT_FLAG_SPECULATIVE-flag.patch <---
patching file include/linux/mm.h
Hunk #1 succeeded at 450 (offset 16 lines).
Hunk #2 FAILED at 465.
Hunk #3 succeeded at 521 (offset 19 lines).
1 out of 3 hunks FAILED -- saving rejects to file include/linux/mm.h.rej
---> patching source with ../0012-mm-add-do_handle_mm_fault.patch <---
patching file include/linux/mm.h
Hunk #1 succeeded at 1763 (offset 39 lines).
patching file mm/memory.c
Hunk #1 succeeded at 4624 (offset 115 lines).
Hunk #2 succeeded at 4674 (offset 115 lines).
---> patching source with ../0013-mm-add-per-mm-mmap-sequence-counter-for-speculative-.patch <---
patching file include/linux/mm_types.h
Hunk #1 succeeded at 466 with fuzz 2 (offset 5 lines).
patching file include/linux/mmap_lock.h
---> patching source with ../0014-mm-rcu-safe-vma-freeing.patch <---
patching file include/linux/mm_types.h
patching file kernel/fork.c
Hunk #1 succeeded at 370 (offset 1 line).
---> patching source with ../0015-x86-mm-attempt-speculative-mm-faults-first.patch <---
patching file arch/x86/mm/fault.c
patching file include/linux/mm_types.h
patching file include/linux/vm_event_item.h
Hunk #1 succeeded at 124 with fuzz 2 (offset 4 lines).
patching file mm/vmstat.c
Hunk #1 succeeded at 1373 with fuzz 2 (offset 8 lines).
---> patching source with ../0016-mm-add-speculative_page_walk_begin-and-speculative_p.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 2621 (offset 55 lines).
---> patching source with ../0017-mm-refactor-__handle_mm_fault-handle_pte_fault.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 3622 (offset 84 lines).
Hunk #2 succeeded at 3926 with fuzz 1 (offset 107 lines).
Hunk #3 succeeded at 4390 (offset 115 lines).
Hunk #4 succeeded at 4529 (offset 115 lines).
---> patching source with ../0018-mm-implement-speculative-handling-in-__handle_mm_fau.patch <---
patching file include/linux/mm.h
Hunk #1 succeeded at 543 with fuzz 2 (offset 18 lines).
patching file mm/memory.c
Hunk #1 succeeded at 4444 (offset 115 lines).
Hunk #2 succeeded at 4459 (offset 115 lines).
Hunk #3 succeeded at 4751 (offset 115 lines).
---> patching source with ../0019-mm-add-pte_map_lock-and-pte_spinlock.patch <---
patching file include/linux/mm.h
Hunk #1 succeeded at 3262 with fuzz 2 (offset 79 lines).
patching file mm/memory.c
Hunk #1 succeeded at 2641 (offset 55 lines).
---> patching source with ../0020-mm-implement-speculative-handling-in-do_anonymous_pa.patch <---
patching file mm/memory.c
Hunk #1 FAILED at 3615.
Hunk #2 succeeded at 3737 with fuzz 2 (offset 100 lines).
Hunk #3 FAILED at 3655.
Hunk #4 FAILED at 3672.
3 out of 4 hunks FAILED -- saving rejects to file mm/memory.c.rej
---> patching source with ../0021-mm-enable-speculative-fault-handling-through-do_anon.patch <---
patching file arch/x86/mm/fault.c
patching file mm/memory.c
Hunk #1 succeeded at 4220 (offset 100 lines).
Hunk #2 succeeded at 4467 (offset 108 lines).
Hunk #3 succeeded at 4800 (offset 108 lines).
Hunk #4 succeeded at 4822 (offset 108 lines).
---> patching source with ../0022-mm-implement-speculative-handling-in-do_numa_page.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 4297 (offset 99 lines).
---> patching source with ../0023-mm-enable-speculative-fault-handling-in-do_numa_page.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 3449 (offset 86 lines).
Hunk #2 succeeded at 4472 (offset 108 lines).
---> patching source with ../0024-mm-implement-speculative-handling-in-wp_page_copy.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 2983 (offset 55 lines).
Hunk #2 succeeded at 3020 (offset 55 lines).
Hunk #3 succeeded at 3033 (offset 55 lines).
Hunk #4 succeeded at 3126 (offset 56 lines).
Hunk #5 succeeded at 3274 (offset 56 lines).
Hunk #6 succeeded at 3313 (offset 56 lines).
---> patching source with ../0025-mm-implement-and-enable-speculative-fault-handling-i.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 3176 (offset 56 lines).
Hunk #2 succeeded at 3197 (offset 56 lines).
Hunk #3 succeeded at 3252 (offset 56 lines).
Hunk #4 succeeded at 4496 (offset 108 lines).
---> patching source with ../0026-mm-implement-speculative-handling-in-do_swap_page.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 2709 (offset 55 lines).
Hunk #2 succeeded at 3448 (offset 86 lines).
Hunk #3 succeeded at 3496 (offset 86 lines).
Hunk #4 succeeded at 3564 with fuzz 2 (offset 84 lines).
Hunk #5 succeeded at 3595 (offset 84 lines).
---> patching source with ../0027-mm-enable-speculative-fault-handling-through-do_swap.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 3443 (offset 86 lines).
---> patching source with ../0028-mm-disable-speculative-faults-for-single-threaded-us.patch <---
patching file arch/x86/mm/fault.c
---> patching source with ../0029-mm-disable-rcu-safe-vma-freeing-for-single-threaded-.patch <---
patching file kernel/fork.c
Hunk #1 succeeded at 382 (offset 1 line).
---> patching source with ../0030-mm-anon-spf-statistics.patch <---
patching file arch/x86/mm/fault.c
patching file include/linux/mmap_lock.h
patching file include/linux/vm_event_item.h
Hunk #1 succeeded at 128 with fuzz 2 (offset 4 lines).
patching file include/linux/vmstat.h
patching file mm/Kconfig.debug
patching file mm/memory.c
Hunk #1 succeeded at 2658 (offset 55 lines).
Hunk #2 succeeded at 2672 (offset 55 lines).
Hunk #3 succeeded at 2692 (offset 55 lines).
Hunk #4 succeeded at 2969 (offset 55 lines).
Hunk #5 succeeded at 3233 (offset 56 lines).
Hunk #6 succeeded at 3455 (offset 86 lines).
Hunk #7 succeeded at 3484 (offset 86 lines).
Hunk #8 succeeded at 3511 (offset 86 lines).
Hunk #9 succeeded at 3716 (offset 84 lines).
Hunk #10 FAILED at 3664.
Hunk #11 FAILED at 3707.
Hunk #12 succeeded at 4340 (offset 99 lines).
Hunk #13 succeeded at 4524 (offset 108 lines).
Hunk #14 succeeded at 4594 (offset 108 lines).
Hunk #15 succeeded at 4631 (offset 108 lines).
2 out of 15 hunks FAILED -- saving rejects to file mm/memory.c.rej
patching file mm/vmstat.c
Hunk #1 succeeded at 1377 (offset 8 lines).
---> patching source with ../0031-arm64-mm-define-ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT.patch <---
patching file arch/arm64/Kconfig
Hunk #1 FAILED at 208.
1 out of 1 hunk FAILED -- saving rejects to file arch/arm64/Kconfig.rej
---> patching source with ../0032-arm64-mm-attempt-speculative-mm-faults-first.patch <---
patching file arch/arm64/mm/fault.c
Hunk #2 succeeded at 531 with fuzz 1.
Hunk #3 succeeded at 586 (offset 16 lines).
Hunk #4 succeeded at 680 (offset 16 lines).
---> patching source with ../0033-powerpc-mm-define-ARCH_SUPPORTS_SPECULATIVE_PAGE_FAU.patch <---
patching file arch/powerpc/Kconfig
Hunk #1 succeeded at 266 (offset 9 lines).
---> patching source with ../0034-powerpc-mm-attempt-speculative-mm-faults-first.patch <---
patching file arch/powerpc/mm/fault.c
Hunk #1 succeeded at 394 (offset -4 lines).
Hunk #3 succeeded at 585 (offset -2 lines).
---> patching source with ../0035-fix-non-memcg-build-issue.patch <---
patching file include/linux/mmap_lock.h
patching file include/linux/vm_event.h
patching file include/linux/vmstat.h
---> patching source with ../0036-fix-i386-build-issue.patch <---
patching file include/linux/mm.h
Hunk #1 succeeded at 3281 (offset 79 lines).
---> patching source with ../0037-mm-rcu-safe-vma-vm_file-freeing.patch <---
patching file fs/exec.c
patching file kernel/fork.c
Hunk #1 succeeded at 370 (offset 1 line).
Hunk #2 succeeded at 394 (offset 1 line).
Hunk #3 succeeded at 638 (offset 4 lines).
patching file mm/mmap.c
Hunk #1 succeeded at 184 (offset 6 lines).
Hunk #2 succeeded at 954 (offset 6 lines).
Hunk #3 succeeded at 1834 (offset 6 lines).
Hunk #4 succeeded at 1913 (offset 6 lines).
Hunk #5 succeeded at 2786 (offset 6 lines).
Hunk #6 succeeded at 3335 (offset -10 lines).
patching file mm/nommu.c
Hunk #1 succeeded at 654 (offset -10 lines).
Hunk #2 succeeded at 1256 (offset -10 lines).
---> patching source with ../0038-mm-implement-speculative-handling-in-__do_fault.patch <---
patching file mm/memory.c
Hunk #1 succeeded at 3835 (offset 85 lines).
---> patching source with ../0039-mm-implement-speculative-handling-in-filemap_fault.patch <---
patching file mm/filemap.c
Hunk #1 succeeded at 2944 (offset 86 lines).
Hunk #2 succeeded at 2970 (offset 85 lines).
---> patching source with ../0040-mm-implement-speculative-fault-handling-in-finish_fa.patch <---
patching file mm/memory.c
Hunk #1 FAILED at 3957.
1 out of 1 hunk FAILED -- saving rejects to file mm/memory.c.rej
---> patching source with ../0041-mm-implement-speculative-handling-in-do_fault_around.patch <---
patching file fs/xfs/xfs_file.c
patching file mm/memory.c
Hunk #1 succeeded at 4148 (offset 94 lines).
Hunk #2 succeeded at 4167 (offset 94 lines).
---> patching source with ../0042-mm-implement-speculative-handling-in-filemap_map_pag.patch <---
patching file mm/filemap.c
Hunk #1 succeeded at 3221 (offset 78 lines).
Hunk #2 succeeded at 3275 (offset 78 lines).
---> patching source with ../0043-fs-list-file-types-that-support-speculative-faults.patch <---
patching file fs/btrfs/file.c
Hunk #1 succeeded at 2302 (offset 9 lines).
patching file fs/cifs/file.c
Hunk #1 succeeded at 4191 (offset 75 lines).
patching file fs/fuse/file.c
Hunk #1 succeeded at 2365 (offset 11 lines).
patching file fs/nfs/file.c
patching file fs/ubifs/file.c
patching file fs/vboxsf/file.c
Hunk #1 succeeded at 163 (offset 17 lines).
patching file include/linux/mm.h
Hunk #1 succeeded at 659 (offset 18 lines).
patching file mm/filemap.c
Hunk #1 succeeded at 3311 (offset 78 lines).
---> patching source with ../0044-mm-enable-speculative-fault-handling-for-supported-f.patch <---
patching file arch/arm64/mm/fault.c
Hunk #1 succeeded at 608 (offset 16 lines).
patching file arch/powerpc/mm/fault.c
patching file arch/x86/mm/fault.c
patching file include/linux/mm.h
Hunk #1 succeeded at 718 (offset 18 lines).
patching file include/linux/vm_event_item.h
Hunk #1 succeeded at 147 (offset 4 lines).
patching file mm/memory.c
Hunk #1 succeeded at 4227 (offset 94 lines).
Hunk #2 succeeded at 4271 (offset 94 lines).
Hunk #3 succeeded at 4317 (offset 94 lines).
Hunk #4 succeeded at 4909 (offset 102 lines).
patching file mm/vmstat.c
Hunk #1 succeeded at 1395 (offset 8 lines).
---> patching source with ../0045-ext4-implement-speculative-fault-handling.patch <---
patching file fs/ext4/file.c
Hunk #1 succeeded at 759 (offset 17 lines).
patching file fs/ext4/inode.c
Hunk #1 succeeded at 6190 (offset -2 lines).
---> patching source with ../0046-f2fs-implement-speculative-fault-handling.patch <---
patching file fs/f2fs/file.c
Hunk #1 succeeded at 38 (offset 1 line).
Hunk #2 succeeded at 177 (offset 1 line).

If you're still interested, here you go.

bc7cab0

commented

Thanks a lot!