dolohow / uksm

Ultra Kernel Samepage Merging
242 stars 35 forks source link

Kernel 5.2.x support #48

Closed tpgxyz closed 4 years ago

tpgxyz commented 4 years ago

Any plans to support kernel 5.2.x ?

Szpadel commented 4 years ago

Here you go: #49

tpgxyz commented 4 years ago

@Szpadel seems does not compile :( Full logs can be found here https://abf.openmandriva.org/build_lists/581690

BUILDSTDERR: mm/uksm.c: In function 'write_protect_page':
BUILDSTDERR: mm/uksm.c:1533:40: error: incompatible type for argument 2 of 'mmu_notifier_range_init'
BUILDSTDERR:  1533 |        mmu_notifier_range_init(&range, mm, pvmw.address, pvmw.address + PAGE_SIZE);
BUILDSTDERR:       |                                        ^~
BUILDSTDERR:       |                                        |
BUILDSTDERR:       |                                        struct mm_struct *
BUILDSTDERR: In file included from mm/uksm.c:64:
BUILDSTDERR: ./include/linux/mmu_notifier.h:363:33: note: expected 'enum mmu_notifier_event' but argument is of type 'struct mm_struct *'
BUILDSTDERR:   363 |         enum mmu_notifier_event event,
BUILDSTDERR:       |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
BUILDSTDERR: mm/uksm.c:1533:71: warning: passing argument 4 of 'mmu_notifier_range_init' makes pointer from integer without a cast [-Wint-conversion]
BUILDSTDERR:  1533 |        mmu_notifier_range_init(&range, mm, pvmw.address, pvmw.address + PAGE_SIZE);
BUILDSTDERR: In file included from mm/uksm.c:64:
BUILDSTDERR: ./include/linux/mmu_notifier.h:365:32: note: expected 'struct vm_area_struct *' but argument is of type 'long unsigned int'
BUILDSTDERR:   365 |         struct vm_area_struct *vma,
BUILDSTDERR:       |         ~~~~~~~~~~~~~~~~~~~~~~~^~~
BUILDSTDERR: mm/uksm.c:1533:8: error: too few arguments to function 'mmu_notifier_range_init'
BUILDSTDERR:  1533 |        mmu_notifier_range_init(&range, mm, pvmw.address, pvmw.address + PAGE_SIZE);
BUILDSTDERR:       |        ^~~~~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: In file included from mm/uksm.c:64:
BUILDSTDERR: ./include/linux/mmu_notifier.h:362:20: note: declared here
BUILDSTDERR:   362 | static inline void mmu_notifier_range_init(struct mmu_notifier_range *range,
BUILDSTDERR:       |                    ^~~~~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: mm/uksm.c: In function 'replace_page':
BUILDSTDERR: mm/uksm.c:1638:40: error: incompatible type for argument 2 of 'mmu_notifier_range_init'
BUILDSTDERR:  1638 |        mmu_notifier_range_init(&range, mm, addr, addr + PAGE_SIZE);
BUILDSTDERR:       |                                        ^~
BUILDSTDERR:       |                                        |
BUILDSTDERR:       |                                        struct mm_struct *
BUILDSTDERR: In file included from mm/uksm.c:64:
BUILDSTDERR: ./include/linux/mmu_notifier.h:363:33: note: expected 'enum mmu_notifier_event' but argument is of type 'struct mm_struct *'
BUILDSTDERR:   363 |         enum mmu_notifier_event event,
BUILDSTDERR:       |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
BUILDSTDERR: mm/uksm.c:1638:55: warning: passing argument 4 of 'mmu_notifier_range_init' makes pointer from integer without a cast [-Wint-conversion]
BUILDSTDERR:  1638 |        mmu_notifier_range_init(&range, mm, addr, addr + PAGE_SIZE);
BUILDSTDERR: In file included from mm/uksm.c:64:
BUILDSTDERR: ./include/linux/mmu_notifier.h:365:32: note: expected 'struct vm_area_struct *' but argument is of type 'long unsigned int'
BUILDSTDERR:   365 |         struct vm_area_struct *vma,
BUILDSTDERR:       |         ~~~~~~~~~~~~~~~~~~~~~~~^~~
BUILDSTDERR: mm/uksm.c:1638:8: error: too few arguments to function 'mmu_notifier_range_init'
BUILDSTDERR:  1638 |        mmu_notifier_range_init(&range, mm, addr, addr + PAGE_SIZE);
BUILDSTDERR:       |        ^~~~~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: In file included from mm/uksm.c:64:
BUILDSTDERR: ./include/linux/mmu_notifier.h:362:20: note: declared here
BUILDSTDERR:   362 | static inline void mmu_notifier_range_init(struct mmu_notifier_range *range,
BUILDSTDERR:       |                    ^~~~~~~~~~~~~~~~~~~~~~~
BUILDSTDERR: make[1]: *** [scripts/Makefile.build:279: mm/uksm.o] Error 1
BUILDSTDERR: make: *** [Makefile:1075: mm] Error 2
BUILDSTDERR: make: *** Waiting for unfinished jobs....
Szpadel commented 4 years ago

Ok, I migrated this api to new api, and it should be fine. But I hope I understood that change correctly: https://github.com/torvalds/linux/commit/d87f055b94ea9270c491b5e650dd776ecc30d7c9

tpgxyz commented 4 years ago

@Szpadel i've started new build with your updated patch

tpgxyz commented 4 years ago

@Szpadel you fixed patch works ! Thanks

dolohow commented 4 years ago

Fixed in 1336201b3f9c206842097b4dd2605e2e79b2cd86