tthtlc / compcache

Automatically exported from code.google.com/p/compcache
0 stars 0 forks source link

unknown field 'swap_slot_free_notify' specified in initializer #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Patched kernel with patch_swap_notifier_generic_2.6.25.diff (all others
did not patch correctly)
2. Compiled kernel
2. Downloaded compcache-0.6.2.tar.gz 
3. Uncommented #define CONFIG_SWAP_FREE_NOTIFY
4. Set compile vars:

export
CCOMPILER=/media/Android_dev/Donut_AOSP/prebuilt/linux-x86/toolchain/arm-eabi-4.
4.0/bin/arm-eabi-
KERNEL_BUILD_PATH=/media/Android_dev/Kernel/linux-new/

5. Attempting to compile compcache modules
make ARCH=arm CROSS_COMPILE=$CCOMPILER KERNEL_BUILD_PATH=$KERNEL_BUILD_PATH

RESULT:

make -C /media/Android_dev/Kernel/linux-new/
M=/media/Android_dev/Kernel/compcache-0.6.2 modules
make[1]: Entering directory `/media/Android_dev/Kernel/linux-new'
  CC [M]  /media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.o
/media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.c:1348: error:
unknown field 'swap_slot_free_notify' specified in initializer
/media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.c:1348: warning:
initialization from incompatible pointer type
make[2]: *** [/media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.o] Error 1
make[1]: *** [_module_/media/Android_dev/Kernel/compcache-0.6.2] Error 2
make[1]: Leaving directory `/media/Android_dev/Kernel/linux-new'
make: *** [all] Error 2

What version of the product are you using? On what operating system?
DSTL1
Android 1.6
2.6.28 kernel

Please provide any additional information below.

Compiles fine if I don't do Step #3

Should I use compcache-0.5.4?

Original issue reported on code.google.com by crzyru...@gmail.com on 16 May 2010 at 10:04

GoogleCodeExporter commented 9 years ago
compcache-0.5.4 works fine...

Any way to get or mod one of the 0.6.2 patches for my kernel?

Original comment by crzyru...@gmail.com on 16 May 2010 at 10:13

GoogleCodeExporter commented 9 years ago
Sorry, jumped the gun... it does not compile with either version

0.5.4 errors:

make -C /media/Android_dev/Kernel/linux-new/
M=/media/Android_dev/Kernel/compcache-0.5.4/sub-projects/allocators/xvmalloc-kmo
d modules
make[1]: Entering directory `/media/Android_dev/Kernel/linux-new'
  CC [M] 
/media/Android_dev/Kernel/compcache-0.5.4/sub-projects/allocators/xvmalloc-kmod/
xvmalloc.o
  Building modules, stage 2.
  MODPOST 1 modules
  LD [M] 
/media/Android_dev/Kernel/compcache-0.5.4/sub-projects/allocators/xvmalloc-kmod/
xvmalloc.ko
make[1]: Leaving directory `/media/Android_dev/Kernel/linux-new'
make -C /media/Android_dev/Kernel/linux-new/
M=/media/Android_dev/Kernel/compcache-0.5.4 modules
make[1]: Entering directory `/media/Android_dev/Kernel/linux-new'
  CC [M] 
/media/Android_dev/Kernel/compcache-0.5.4/sub-projects/allocators/xvmalloc-kmod/
xvmalloc.o
  CC [M]  /media/Android_dev/Kernel/compcache-0.5.4/ramzswap.o
/media/Android_dev/Kernel/compcache-0.5.4/ramzswap.c: In function
'ramzswap_swapon_notify':
/media/Android_dev/Kernel/compcache-0.5.4/ramzswap.c:451: error: implicit 
declaration
of function 'register_swap_event_notifier'
/media/Android_dev/Kernel/compcache-0.5.4/ramzswap.c: In function
'ramzswap_swapoff_notify':
/media/Android_dev/Kernel/compcache-0.5.4/ramzswap.c:469: error: implicit 
declaration
of function 'unregister_swap_event_notifier'
make[2]: *** [/media/Android_dev/Kernel/compcache-0.5.4/ramzswap.o] Error 1
make[1]: *** [_module_/media/Android_dev/Kernel/compcache-0.5.4] Error 2
make[1]: Leaving directory `/media/Android_dev/Kernel/linux-new'
make: *** [all] Error 2

Original comment by crzyru...@gmail.com on 16 May 2010 at 10:23

GoogleCodeExporter commented 9 years ago
So what does this tell me?

notify patch modifications don't want to compile against kernel... why? No 
idea. Help
appreciated.

Original comment by crzyru...@gmail.com on 16 May 2010 at 10:24

GoogleCodeExporter commented 9 years ago
Try applying this patch:
http://code.google.com/p/compcache/source/browse/patches/patch_swap_notify_core_
support_2.6.29.diff

Original comment by nitingupta910@gmail.com on 17 May 2010 at 4:04

GoogleCodeExporter commented 9 years ago
patch_swap_notify_core_support_2.6.29.diff
1,365 bytes

fails at HUNK #2

Original comment by crzyru...@gmail.com on 17 May 2010 at 5:24

GoogleCodeExporter commented 9 years ago
Are my parameters correct?

Original comment by crzyru...@gmail.com on 17 May 2010 at 5:25

GoogleCodeExporter commented 9 years ago
I will checkout kernel 2.6.28 and check the problem.

Original comment by nitingupta910@gmail.com on 17 May 2010 at 3:05

GoogleCodeExporter commented 9 years ago
Please try the patch attached.

Original comment by nitingupta910@gmail.com on 17 May 2010 at 3:19

Attachments:

GoogleCodeExporter commented 9 years ago
It should all work fine with the patch attached in previous comment. Please 
reopen if
you get further problems.

Original comment by nitingupta910@gmail.com on 27 May 2010 at 2:10

GoogleCodeExporter commented 9 years ago
Thanks for the patch!

attempting to patch...

crzyruski@dominion:/media/Android_dev/Kernel$ patch -p0 < 
patch_swap_notifier_generic_2.6.25.diff
patching file linux-new/include/linux/swap.h
Hunk #1 succeeded at 125 (offset 1 line).
Hunk #2 succeeded at 146 (offset 1 line).
Hunk #3 FAILED at 259.
1 out of 3 hunks FAILED -- saving rejects to file 
linux-new/include/linux/swap.h.rej
patching file linux-new/mm/swapfile.c
Hunk #1 succeeded at 49 (offset 1 line).
Hunk #2 succeeded at 288 (offset 1 line).
Hunk #3 succeeded at 1346 (offset 30 lines).
Hunk #4 succeeded at 1725 (offset 28 lines).
Hunk #5 succeeded at 1876 (offset 24 lines).

I imagine it is critical for all hunks to succeed?

Original comment by crzyru...@gmail.com on 1 Jul 2010 at 4:25

GoogleCodeExporter commented 9 years ago
crzyruski@dominion:/media/Android_dev/Kernel/compcache-0.6.2$ make ARCH=arm 
CROSS_COMPILE=$CCOMPILER KERNEL_BUILD_PATH=$KERNEL_BUILD_PATH
make -C /media/Android_dev/Kernel/linux-new/ 
M=/media/Android_dev/Kernel/compcache-0.6.2 modules
make[1]: Entering directory `/media/Android_dev/Kernel/linux-new'
  CC [M]  /media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.o
In file included from include/linux/gfp.h:4,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from /media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.c:18:
include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory
include/linux/mmzone.h:256:5: warning: "MAX_NR_ZONES" is not defined
include/linux/mmzone.h:258:7: warning: "MAX_NR_ZONES" is not defined
include/linux/mmzone.h:260:7: warning: "MAX_NR_ZONES" is not defined
In file included from include/linux/gfp.h:4,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from /media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.c:18:
include/linux/mmzone.h:277: error: 'MAX_NR_ZONES' undeclared here (not in a 
function)
In file included from include/linux/pagemap.h:7,
                 from include/linux/blkdev.h:12,
                 from /media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.c:21:
include/linux/mm.h:438:63: warning: "NR_PAGEFLAGS" is not defined
include/linux/mm.h:486:62: warning: "NR_PAGEFLAGS" is not defined
/media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.c:1348: error: unknown 
field 'swap_slot_free_notify' specified in initializer
/media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.c:1348: warning: 
initialization from incompatible pointer type
make[2]: *** [/media/Android_dev/Kernel/compcache-0.6.2/ramzswap_drv.o] Error 1
make[1]: *** [_module_/media/Android_dev/Kernel/compcache-0.6.2] Error 2
make[1]: Leaving directory `/media/Android_dev/Kernel/linux-new'
make: *** [all] Error 2

Original comment by crzyru...@gmail.com on 1 Jul 2010 at 4:46

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Reopening...

> I imagine it is critical for all hunks to succeed?

Yes, it is.

> crzyruski@dominion:/media/Android_dev/Kernel$ patch -p0 < 
patch_swap_notifier_generic_2.6.25.diff

You seem to be again using the same failing patch as mentioned in initial bug 
report. I uploaded a new test version (see comment 8) - please try that one. 
Please also mention kernel version you are using now.

Original comment by nitingupta910@gmail.com on 4 Jul 2010 at 2:32

GoogleCodeExporter commented 9 years ago
This looks pretty successful, what do you think?

crzyruski@d0mini0n:~/compcache2$ make
make -C /home/crzyruski/try1/b M=/home/crzyruski/compcache2 modules
make[1]: Entering directory `/home/crzyruski/try1/b'
  CC [M]  /home/crzyruski/compcache2/ramzswap_drv.o
  CC [M]  /home/crzyruski/compcache2/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o
  LD [M]  /home/crzyruski/compcache2/ramzswap.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "lzo1x_1_compress" [/home/crzyruski/compcache2/ramzswap.ko] undefined!
WARNING: "lzo1x_decompress_safe" [/home/crzyruski/compcache2/ramzswap.ko] 
undefined!
  CC      /home/crzyruski/compcache2/ramzswap.mod.o
  LD [M]  /home/crzyruski/compcache2/ramzswap.ko
make[1]: Leaving directory `/home/crzyruski/try1/b'
make -C sub-projects/rzscontrol
make[1]: Entering directory `/home/crzyruski/compcache2/sub-projects/rzscontrol'
make[1]: Leaving directory `/home/crzyruski/compcache2/sub-projects/rzscontrol'

Original comment by crzyru...@gmail.com on 10 Jul 2010 at 10:03

GoogleCodeExporter commented 9 years ago
> WARNING: "lzo1x_1_compress" [/home/crzyruski/compcache2/ramzswap.ko] 
undefined!
> WARNING: "lzo1x_decompress_safe" [/home/crzyruski/compcache2/ramzswap.ko] 
undefined!

Looks like your kernel does not have LZO de/compressor compiled as built-in or 
as modules. For this, select 'Crytographic API -> LZO compression algorithm' 
during menuconfig phase.

Original comment by nitingupta910@gmail.com on 10 Jul 2010 at 12:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Oops, ya wrong kernel source :-/ thats a my bad

Good to go, just need to test in Donut :)

crzyruski@d0mini0n:~/compcache2$ make
make -C /home/crzyruski/b M=/home/crzyruski/compcache2 modules
make[1]: Entering directory `/home/crzyruski/b'
  CC [M]  /home/crzyruski/compcache2/ramzswap_drv.o
  CC [M]  /home/crzyruski/compcache2/sub-projects/allocators/xvmalloc-kmod/xvmalloc.o
  LD [M]  /home/crzyruski/compcache2/ramzswap.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/crzyruski/compcache2/ramzswap.mod.o
  LD [M]  /home/crzyruski/compcache2/ramzswap.ko
make[1]: Leaving directory `/home/crzyruski/b'
make -C sub-projects/rzscontrol
make[1]: Entering directory `/home/crzyruski/compcache2/sub-projects/rzscontrol'
make[1]: Leaving directory `/home/crzyruski/compcache2/sub-projects/rzscontrol'

Original comment by crzyru...@gmail.com on 11 Jul 2010 at 5:31

GoogleCodeExporter commented 9 years ago

Original comment by nitingupta910@gmail.com on 22 Jul 2010 at 6:02

GoogleCodeExporter commented 9 years ago
Apparently the swap notify patch breaks my Wi-Fi & BT, any ideas?

Original comment by crzyru...@gmail.com on 10 Aug 2010 at 10:01

GoogleCodeExporter commented 9 years ago
> Apparently the swap notify patch breaks my Wi-Fi & BT, any ideas?

I don't have slightest of idea. BTW, whats BT?

Original comment by nitingupta910@gmail.com on 10 Aug 2010 at 11:26

GoogleCodeExporter commented 9 years ago
BT -> bluetooth probably

Original comment by mcuelena...@gmail.com on 10 Aug 2010 at 12:04

GoogleCodeExporter commented 9 years ago
Yea, I'm lost...
Everything is cool until I patch it.
The NOTIFY patch allows for a faster cleaning of compressed cache in RAM.
So how much performance loss am I to suffer without this patch?
I still have to even try the compcache feature.

Original comment by crzyru...@gmail.com on 10 Aug 2010 at 9:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Without notify patch, you might waste a lot of memory due to stale data. 

Anyways, I simply can't see how this patch can affect WiFi!

Original comment by nitingupta910@gmail.com on 12 Aug 2010 at 6:16

GoogleCodeExporter commented 9 years ago
It seems that adding swap_slot_free_notify to struct block_device_operations 
break the version check. The prebuilt modules I am using must be keeping an old 
define of struct block_device_operations.

Is there an way around this?

Original comment by crzyru...@gmail.com on 27 Aug 2010 at 12:16