[linux-mm-cc] [PATCH] module param size too big fix up

John McCabe-Dansted gmatht at gmail.com
Mon Apr 28 15:01:01 EDT 2008


On Mon, Apr 28, 2008 at 5:36 PM, Nai Xia <nai.xia at gmail.com> wrote:

>   Hmm,,... Well, I think a reasonable up limit should be based on a wide
>  range of workloads.
>  The patch I posted was only a quick fix,
>  It will be good if you have solid evidence of a safe up bound. :)
>

  I have tryed creating larger and larger compcaches. (2^22-4) KB appears to
work while (2^22-2) fails. The problem seems to be caused by integer
overflow in compcache_size_kbyte, or compcache.size at
        compcache.size = compcache_size_kbytes << 10;
        compcache.size = (compcache.size + PAGE_SIZE - 1) & PAGE_MASK;

We could probably eliminate the need for compcache.size by going direct from
_kbytes to num_pages, allowing ~4TB devices. Using only num_pages  would
increase the max size of compcache to ~16TB and simplify the compcache code
somewhat. Unfortunately it seem  hard to get at PAGE_SIZE from userspace.

--

xp at xp-desktop:~/src/compcache-read-only$ sudo ./unuse_compcache.sh ; sudo
./use_compcache.sh $((1024*1024*4-4))
Turning off compache swap device ...
Unloading modules ...
Done!
Loading modules ...
Setting up swap device ...
Done!
xp at xp-desktop:~/src/compcache-read-only$ sudo ./unuse_compcache.sh ; sudo
./use_compcache.sh $((1024*1024*4-2))
Turning off compache swap device ...
Unloading modules ...
Done!
Loading modules ...
./use_compcache.sh: line 21:  7238 Segmentation fault      $INSMOD_BIN
$MOD_NAME.ko "$MOD_PARAM"
Setting up swap device ...
swapon: cannot stat /dev/ramzswap0: No such file or directory
Could not add compcache swapdevice.
Apr 29 02:21:27 xp-desktop kernel: [ 2655.365401] compcache: cleanup done!
Apr 29 02:21:27 xp-desktop kernel: [ 2655.568661] compcache: Compressed swap
size set to: 0 KB
Apr 29 02:21:27 xp-desktop kernel: [ 2655.569815] compcache: Error
allocating compcache address table
Apr 29 02:21:27 xp-desktop kernel: [ 2655.570840] BUG: unable to handle
kernel NULL pointer dereference at virtual address 00000000
Apr 29 02:21:27 xp-desktop kernel: [ 2655.570903] printing eip: d09b42d8
*pde = 00000000
Apr 29 02:21:27 xp-desktop kernel: [ 2655.572071] Oops: 0000 [#1] SMP
Apr 29 02:21:27 xp-desktop kernel: [ 2655.572577] Modules linked in:
compcache tlsf lzo_decompress lzo_compress af_packet rfcomm l2cap bluetooth
ppdev ipv6 speedstep_lib cpufreq_conservative cpufreq_userspace
cpufreq_ondemand cpufreq_powersave cpufreq_stats freq_table container video
output sbs sbshc dock battery parport_pc lp parport evdev psmouse ac
serio_raw pcspkr button i2c_piix4 i2c_core ext3 jbd mbcache sg sr_mod cdrom
sd_mod ata_generic pata_acpi floppy ata_piix pcnet32 mii libata scsi_mod
thermal processor fan fuse
Apr 29 02:21:27 xp-desktop kernel: [ 2655.573931]
Apr 29 02:21:27 xp-desktop kernel: [ 2655.574199] Pid: 7238, comm: insmod
Not tainted (2.6.24-5-generic #1)
Apr 29 02:21:27 xp-desktop kernel: [ 2655.574299] EIP: 0060:[<d09b42d8>]
EFLAGS: 00010246 CPU: 0
Apr 29 02:21:27 xp-desktop kernel: [ 2655.574849] EIP is at
compcache_init+0x2d8/0x3ff [compcache]
Apr 29 02:21:27 xp-desktop kernel: [ 2655.574947] EAX: 00000000 EBX:
fffffff4 ECX: 00000086 EDX: 00000000
Apr 29 02:21:27 xp-desktop kernel: [ 2655.575043] ESI: d09c6f00 EDI:
00000000 EBP: d09c6f00 ESP: c25d9e64
Apr 29 02:21:27 xp-desktop kernel: [ 2655.575140]  DS: 007b ES: 007b FS:
00d8 GS: 0033 SS: 0068
Apr 29 02:21:27 xp-desktop kernel: [ 2655.575304] Process insmod (pid: 7238,
ti=c25d8000 task=ce22c000 task.ti=c25d8000)
Apr 29 02:21:27 xp-desktop kernel: [ 2655.575384] Stack: d09c59cc 00000000
a024e82f a024e84c c04a7370 00000246 00000246 c25d9e88
Apr 29 02:21:27 xp-desktop kernel: [ 2655.575658]        c03ab78f c0150010
d09c6f00 00000286 cea6a5a0 d09c6f00 00000001 d09c6f00
Apr 29 02:21:27 xp-desktop kernel: [ 2655.575864]        d09c6f00 00000010
d09c6f00 d09c6f00 d09c6f00 00000010 c01515e6 00000001
Apr 29 02:21:27 xp-desktop kernel: [ 2655.576068] Call Trace:
Apr 29 02:21:27 xp-desktop kernel: [ 2655.576410]  [__link_module+0x0/0x20]
__link_module+0x0/0x20
Apr 29 02:21:27 xp-desktop kernel: [ 2655.577003]
[sys_init_module+0x126/0x19c0] sys_init_module+0x126/0x19c0
Apr 29 02:21:27 xp-desktop kernel: [ 2655.577660]
[get_zeroed_page+0x0/0x50] get_zeroed_page+0x0/0x50
Apr 29 02:21:27 xp-desktop kernel: [ 2655.578151]  [syscall_call+0x7/0x0b]
syscall_call+0x7/0xb
Apr 29 02:21:27 xp-desktop kernel: [ 2655.578536]  =======================
Apr 29 02:21:27 xp-desktop kernel: [ 2655.578605] Code: 8d 76 00 a1 a0 74 9c
d0 85 c0 74 1a 8b 08 85 c9 7e 0f 8d 50 0c 89 c8 e8 67 5e 85 ef a1 a0 74 9c
d0 e8 5d 8c 81 ef a1 8c 74 9c d0 <8b> 00 85 c0 74 07 31 d2 e8 4b ae 7b ef a1
84 74 9c d0 85 c0 74
Apr 29 02:21:27 xp-desktop kernel: [ 2655.579928] EIP: [<d09b42d8>]
compcache_init+0x2d8/0x3ff [compcache] SS:ESP 0068:c25d9e64
Apr 29 02:21:27 xp-desktop kernel: [ 2655.581121] ---[ end trace
cbd4a5ac68883bfe ]---


-- 
John C. McCabe-Dansted
PhD Student
University of Western Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/linux-mm-cc/attachments/20080429/45497482/attachment.htm 


More information about the linux-mm-cc mailing list