* [2.6.37-rc1] /proc/vmstat failure. [not found] <201011010053.ADE86905.JMLFHVtSQOOFOF@I-love.SAKURA.ne.jp> @ 2010-11-03 11:11 ` Tetsuo Handa 2010-11-03 17:43 ` Linus Torvalds 2010-11-03 17:46 ` Wu Fengguang 0 siblings, 2 replies; 10+ messages in thread From: Tetsuo Handa @ 2010-11-03 11:11 UTC (permalink / raw) To: mrubin Cc: fengguang.wu, david, axboe, kosaki.motohiro, nickpiggin, akpm, torvalds, linux-kernel Hello. "cat /proc/vmstat" triggered below failure. BUG: unable to handle kernel paging request at 07c06d16 IP: [<c050c336>] strnlen+0x6/0x20 *pde = 00000000 Oops: 0000 [#2] SMP last sysfs file: /sys/devices/pci0000:00/0000:00:11.0/0000:02:02.0/irq Modules linked in: ipv6 video output sbs sbshc battery ac button pcnet32 serio_raw mii floppy i2c_piix4 i2c_core rtc_cmos rtc_core rtc_lib mptspi mptscsih mptbase scsi_transport_spi ext3 jbd mbcache Pid: 2982, comm: cat Tainted: G D 2.6.36+ #12 440BX Desktop Reference Platform/VMware Virtual Platform EIP: 0060:[<c050c336>] EFLAGS: 00010297 CPU: 0 EIP is at strnlen+0x6/0x20 EAX: 07c06d16 EBX: 07c06d16 ECX: 07c06d16 EDX: fffffffe ESI: df0ce000 EDI: de769f0c EBP: df0cf000 ESP: de769e80 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 Process cat (pid: 2982, ti=de768000 task=df0e8e00 task.ti=de768000) Stack: c050a249 ffff9f10 dea43000 00000000 00000001 c042be6b c06d1514 00000002 <0> c06d1513 de769f0c df0ce000 c050afcc ff0a0004 ffffffff 00000000 00000004 <0> 00001000 df0ce000 df0cf000 c06d1515 de769f10 ff0a0004 ffffffff df0ce000 Call Trace: [<c050a249>] ? string+0x39/0xe0 [<c042be6b>] ? __wake_up_common+0x4b/0x80 [<c050afcc>] ? vsnprintf+0x1ec/0x380 [<c04b380e>] ? seq_printf+0x2e/0x60 [<c04829a6>] ? vmstat_show+0x26/0x30 [<c04b3bb6>] ? seq_read+0xa6/0x380 [<c04b3b10>] ? seq_read+0x0/0x380 [<c04d5d2f>] ? proc_reg_read+0x5f/0x90 [<c049c4a1>] ? vfs_read+0xa1/0x140 [<c04d5cd0>] ? proc_reg_read+0x0/0x90 [<c049c981>] ? sys_read+0x41/0x70 [<c0402bd0>] ? sysenter_do_call+0x12/0x26 Code: 90 8d 74 26 00 85 c9 57 89 c7 89 d0 74 05 f2 ae 75 01 4f 89 f8 5f c3 8d b4 26 00 00 00 00 8d bc 27 00 00 00 00 89 c1 89 c8 eb 06 <80> 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 c3 90 90 90 90 90 90 EIP: [<c050c336>] strnlen+0x6/0x20 SS:ESP 0068:de769e80 CR2: 0000000007c06d16 ---[ end trace 051c52adf97c7465 ]--- git bisect reported that commit 79da826aee6a10902ef411bc65864bd02102fa83 "writeback: report dirty thresholds in /proc/vmstat" is first bad commit. My environment: CentOS 5.5 on i686 Steps to reproduce: Boot and login via SSH and do "cat /proc/vmstat". What is strange, this failure occurs when tty is /dev/pts/0 (i.e. devpts filesystem / interactive ssh login session) and does not occur when tty is /dev/tty1 (i.e. console login session). Regards. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-03 11:11 ` [2.6.37-rc1] /proc/vmstat failure Tetsuo Handa @ 2010-11-03 17:43 ` Linus Torvalds 2010-11-03 17:46 ` Wu Fengguang 1 sibling, 0 replies; 10+ messages in thread From: Linus Torvalds @ 2010-11-03 17:43 UTC (permalink / raw) To: Tetsuo Handa Cc: mrubin, fengguang.wu, david, axboe, kosaki.motohiro, nickpiggin, akpm, linux-kernel On Wed, Nov 3, 2010 at 7:11 AM, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote: > > git bisect reported that commit 79da826aee6a10902ef411bc65864bd02102fa83 > "writeback: report dirty thresholds in /proc/vmstat" is first bad commit. Have you verified that reverting that on top of current -git also fixes the problem (outside of just the bisected kernels)? > Steps to reproduce: > Boot and login via SSH and do "cat /proc/vmstat". > > What is strange, this failure occurs when tty is /dev/pts/0 (i.e. > devpts filesystem / interactive ssh login session) and does not occur > when tty is /dev/tty1 (i.e. console login session). It really sounds like memory corruption, likely because something has stepped on somebody elses allocation. One thing that patch does is to change the size of the allocation - perhaps it now ends up being in the same bucket size with some tty data structure? Have you tried enabling SLUB/SLAB debugging? Linus ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-03 11:11 ` [2.6.37-rc1] /proc/vmstat failure Tetsuo Handa 2010-11-03 17:43 ` Linus Torvalds @ 2010-11-03 17:46 ` Wu Fengguang 2010-11-03 17:55 ` Linus Torvalds 2010-11-03 21:54 ` Tetsuo Handa 1 sibling, 2 replies; 10+ messages in thread From: Wu Fengguang @ 2010-11-03 17:46 UTC (permalink / raw) To: Tetsuo Handa Cc: mrubin@google.com, david@fromorbit.com, axboe@kernel.dk, kosaki.motohiro@jp.fujitsu.com, nickpiggin@yahoo.com.au, akpm@linux-foundation.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org On Wed, Nov 03, 2010 at 07:11:11PM +0800, Tetsuo Handa wrote: > Hello. > > "cat /proc/vmstat" triggered below failure. > > BUG: unable to handle kernel paging request at 07c06d16 > IP: [<c050c336>] strnlen+0x6/0x20 It seems that m->private is of type (void *) while the original v is (unsigned long *). Can be fixed by the following patch. Thanks, Fengguang --- diff --git a/mm/vmstat.c b/mm/vmstat.c index cd2e42b..42eac4d 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -949,7 +949,7 @@ static void *vmstat_start(struct seq_file *m, loff_t *pos) v[PGPGIN] /= 2; /* sectors -> kbytes */ v[PGPGOUT] /= 2; #endif - return m->private + *pos; + return (unsigned long *)m->private + *pos; } static void *vmstat_next(struct seq_file *m, void *arg, loff_t *pos) ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-03 17:46 ` Wu Fengguang @ 2010-11-03 17:55 ` Linus Torvalds 2010-11-03 21:54 ` Tetsuo Handa 1 sibling, 0 replies; 10+ messages in thread From: Linus Torvalds @ 2010-11-03 17:55 UTC (permalink / raw) To: Wu Fengguang Cc: Tetsuo Handa, mrubin@google.com, david@fromorbit.com, axboe@kernel.dk, kosaki.motohiro@jp.fujitsu.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org On Wed, Nov 3, 2010 at 1:46 PM, Wu Fengguang <fengguang.wu@intel.com> wrote: > > It seems that m->private is of type (void *) while the original v is > (unsigned long *). Can be fixed by the following patch. Good catch. Tetsuo, does that fix it for you? And Wu - sign-off/changelog, please? Linus ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-03 17:46 ` Wu Fengguang 2010-11-03 17:55 ` Linus Torvalds @ 2010-11-03 21:54 ` Tetsuo Handa 2010-11-04 2:20 ` Wu Fengguang 1 sibling, 1 reply; 10+ messages in thread From: Tetsuo Handa @ 2010-11-03 21:54 UTC (permalink / raw) To: fengguang.wu Cc: mrubin, david, axboe, kosaki.motohiro, nickpiggin, akpm, torvalds, linux-kernel Wu Fengguang wrote: > On Wed, Nov 03, 2010 at 07:11:11PM +0800, Tetsuo Handa wrote: > > Hello. > > > > "cat /proc/vmstat" triggered below failure. > > > > BUG: unable to handle kernel paging request at 07c06d16 > > IP: [<c050c336>] strnlen+0x6/0x20 > > It seems that m->private is of type (void *) while the original v is > (unsigned long *). Can be fixed by the following patch. Fixed by this patch. Thank you. By the way, GCC treats "(void *) + offset" as "(char *) + offset" but it is GCC specific extention. Maybe we should avoid such usage in order to avoid build failure for other compilers. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-03 21:54 ` Tetsuo Handa @ 2010-11-04 2:20 ` Wu Fengguang 2010-11-04 2:52 ` Américo Wang 0 siblings, 1 reply; 10+ messages in thread From: Wu Fengguang @ 2010-11-04 2:20 UTC (permalink / raw) To: Tetsuo Handa Cc: mrubin@google.com, david@fromorbit.com, axboe@kernel.dk, kosaki.motohiro@jp.fujitsu.com, nickpiggin@yahoo.com.au, akpm@linux-foundation.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org On Thu, Nov 04, 2010 at 05:54:48AM +0800, Tetsuo Handa wrote: > Wu Fengguang wrote: > > On Wed, Nov 03, 2010 at 07:11:11PM +0800, Tetsuo Handa wrote: > > > Hello. > > > > > > "cat /proc/vmstat" triggered below failure. > > > > > > BUG: unable to handle kernel paging request at 07c06d16 > > > IP: [<c050c336>] strnlen+0x6/0x20 > > > > It seems that m->private is of type (void *) while the original v is > > (unsigned long *). Can be fixed by the following patch. > > Fixed by this patch. Thank you. Great, thanks! > By the way, GCC treats "(void *) + offset" as "(char *) + offset" > but it is GCC specific extention. Maybe we should avoid such usage > in order to avoid build failure for other compilers. "(void *) + offset" seems to be used quite often. I tried enable this gcc option, only to see huge amount of warnings. -Wpointer-arith Warn about anything that depends on the "size of" a function type or of "void". GNU C assigns these types a size of 1, for convenience in calculations with "void *" pointers and pointers to functions. /cc/linux-next/scripts/mod/file2alias.c: In function ‘device_id_check’: /cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c:94: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c:94: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c:94: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c: In function ‘do_usb_table’: /cc/linux-next/scripts/mod/file2alias.c:275: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c: In function ‘do_table’: /cc/linux-next/scripts/mod/file2alias.c:870: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c: In function ‘handle_moddevtable’: /cc/linux-next/scripts/mod/file2alias.c:897: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/file2alias.c:897: warning: pointer of type ‘void *’ used in arithmetic HOSTCC scripts/mod/modpost.o /cc/linux-next/scripts/mod/modpost.c: In function ‘parse_elf’: /cc/linux-next/scripts/mod/modpost.c:412: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:456: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:472: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:489: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:491: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:491: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:494: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:501: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:503: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:503: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c: In function ‘sec_name’: /cc/linux-next/scripts/mod/modpost.c:716: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:717: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c: In function ‘sech_name’: /cc/linux-next/scripts/mod/modpost.c:723: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:724: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c: In function ‘reloc_location’: /cc/linux-next/scripts/mod/modpost.c:1443: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:1444: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:1444: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c: In function ‘section_rela’: /cc/linux-next/scripts/mod/modpost.c:1520: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:1521: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c: In function ‘section_rel’: /cc/linux-next/scripts/mod/modpost.c:1564: warning: pointer of type ‘void *’ used in arithmetic /cc/linux-next/scripts/mod/modpost.c:1565: warning: pointer of type ‘void *’ used in arithmetic Thanks, Fengguang ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-04 2:20 ` Wu Fengguang @ 2010-11-04 2:52 ` Américo Wang 2010-11-04 2:53 ` Wu Fengguang 0 siblings, 1 reply; 10+ messages in thread From: Américo Wang @ 2010-11-04 2:52 UTC (permalink / raw) To: Wu Fengguang Cc: Tetsuo Handa, mrubin@google.com, david@fromorbit.com, axboe@kernel.dk, kosaki.motohiro@jp.fujitsu.com, nickpiggin@yahoo.com.au, akpm@linux-foundation.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org On Thu, Nov 04, 2010 at 10:20:52AM +0800, Wu Fengguang wrote: >On Thu, Nov 04, 2010 at 05:54:48AM +0800, Tetsuo Handa wrote: >> Wu Fengguang wrote: >> > On Wed, Nov 03, 2010 at 07:11:11PM +0800, Tetsuo Handa wrote: >> > > Hello. >> > > >> > > "cat /proc/vmstat" triggered below failure. >> > > >> > > BUG: unable to handle kernel paging request at 07c06d16 >> > > IP: [<c050c336>] strnlen+0x6/0x20 >> > >> > It seems that m->private is of type (void *) while the original v is >> > (unsigned long *). Can be fixed by the following patch. >> >> Fixed by this patch. Thank you. > >Great, thanks! > >> By the way, GCC treats "(void *) + offset" as "(char *) + offset" >> but it is GCC specific extention. Maybe we should avoid such usage >> in order to avoid build failure for other compilers. > >"(void *) + offset" seems to be used quite often. > >I tried enable this gcc option, only to see huge amount of warnings. > > -Wpointer-arith > Warn about anything that depends on the "size of" a > function type or of "void". GNU C assigns these types a > size of 1, for convenience in calculations with "void *" > pointers and pointers to functions. > Yup! I think it is good to have this. >/cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type ‘void *’ used in arithmetic ... >/cc/linux-next/scripts/mod/modpost.c:1565: warning: pointer of type ‘void *’ used in arithmetic > No problem, this is from kbuild and most of them that I checked are actually fine, we can send patches to remove these warnings. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-04 2:52 ` Américo Wang @ 2010-11-04 2:53 ` Wu Fengguang 2010-11-04 3:31 ` Américo Wang 0 siblings, 1 reply; 10+ messages in thread From: Wu Fengguang @ 2010-11-04 2:53 UTC (permalink / raw) To: Américo Wang Cc: Tetsuo Handa, mrubin@google.com, david@fromorbit.com, axboe@kernel.dk, kosaki.motohiro@jp.fujitsu.com, nickpiggin@yahoo.com.au, akpm@linux-foundation.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org On Thu, Nov 04, 2010 at 10:52:51AM +0800, Américo Wang wrote: > On Thu, Nov 04, 2010 at 10:20:52AM +0800, Wu Fengguang wrote: > >On Thu, Nov 04, 2010 at 05:54:48AM +0800, Tetsuo Handa wrote: > >> Wu Fengguang wrote: > >> > On Wed, Nov 03, 2010 at 07:11:11PM +0800, Tetsuo Handa wrote: > >> > > Hello. > >> > > > >> > > "cat /proc/vmstat" triggered below failure. > >> > > > >> > > BUG: unable to handle kernel paging request at 07c06d16 > >> > > IP: [<c050c336>] strnlen+0x6/0x20 > >> > > >> > It seems that m->private is of type (void *) while the original v is > >> > (unsigned long *). Can be fixed by the following patch. > >> > >> Fixed by this patch. Thank you. > > > >Great, thanks! > > > >> By the way, GCC treats "(void *) + offset" as "(char *) + offset" > >> but it is GCC specific extention. Maybe we should avoid such usage > >> in order to avoid build failure for other compilers. > > > >"(void *) + offset" seems to be used quite often. > > > >I tried enable this gcc option, only to see huge amount of warnings. > > > > -Wpointer-arith > > Warn about anything that depends on the "size of" a > > function type or of "void". GNU C assigns these types a > > size of 1, for convenience in calculations with "void *" > > pointers and pointers to functions. > > > > Yup! I think it is good to have this. > > >/cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type ‘void *’ used in arithmetic > ... > >/cc/linux-next/scripts/mod/modpost.c:1565: warning: pointer of type ‘void *’ used in arithmetic > > > > No problem, this is from kbuild and most of them that I checked are actually fine, > we can send patches to remove these warnings. Confirmed. Now my full kernel build is complete and the above are the only warnings I see. So it should be easy to add the -Wpointer-arith check. Thanks, Fengguang ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-04 2:53 ` Wu Fengguang @ 2010-11-04 3:31 ` Américo Wang 2010-11-04 3:43 ` Wu Fengguang 0 siblings, 1 reply; 10+ messages in thread From: Américo Wang @ 2010-11-04 3:31 UTC (permalink / raw) To: Wu Fengguang Cc: Américo Wang, Tetsuo Handa, mrubin@google.com, david@fromorbit.com, axboe@kernel.dk, kosaki.motohiro@jp.fujitsu.com, nickpiggin@yahoo.com.au, akpm@linux-foundation.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org On Thu, Nov 04, 2010 at 10:53:41AM +0800, Wu Fengguang wrote: >On Thu, Nov 04, 2010 at 10:52:51AM +0800, Américo Wang wrote: >> On Thu, Nov 04, 2010 at 10:20:52AM +0800, Wu Fengguang wrote: >> >On Thu, Nov 04, 2010 at 05:54:48AM +0800, Tetsuo Handa wrote: >> >> Wu Fengguang wrote: >> >> > On Wed, Nov 03, 2010 at 07:11:11PM +0800, Tetsuo Handa wrote: >> >> > > Hello. >> >> > > >> >> > > "cat /proc/vmstat" triggered below failure. >> >> > > >> >> > > BUG: unable to handle kernel paging request at 07c06d16 >> >> > > IP: [<c050c336>] strnlen+0x6/0x20 >> >> > >> >> > It seems that m->private is of type (void *) while the original v is >> >> > (unsigned long *). Can be fixed by the following patch. >> >> >> >> Fixed by this patch. Thank you. >> > >> >Great, thanks! >> > >> >> By the way, GCC treats "(void *) + offset" as "(char *) + offset" >> >> but it is GCC specific extention. Maybe we should avoid such usage >> >> in order to avoid build failure for other compilers. >> > >> >"(void *) + offset" seems to be used quite often. >> > >> >I tried enable this gcc option, only to see huge amount of warnings. >> > >> > -Wpointer-arith >> > Warn about anything that depends on the "size of" a >> > function type or of "void". GNU C assigns these types a >> > size of 1, for convenience in calculations with "void *" >> > pointers and pointers to functions. >> > >> >> Yup! I think it is good to have this. >> >> >/cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type ‘void *’ used in arithmetic >> ... >> >/cc/linux-next/scripts/mod/modpost.c:1565: warning: pointer of type ‘void *’ used in arithmetic >> > >> >> No problem, this is from kbuild and most of them that I checked are actually fine, >> we can send patches to remove these warnings. > >Confirmed. Now my full kernel build is complete and the above are the >only warnings I see. So it should be easy to add the -Wpointer-arith >check. > Well, after I tried to compile with it, I got lots of warnings. Most of them that I checked is something like: (void *) CONST_PTR + OFFSET in macros. In order to fix this, we need to: (void *) ((char *) CONST_PTR + OFFSET) So, we have to make some efforts to kill all the warnings. :-/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [2.6.37-rc1] /proc/vmstat failure. 2010-11-04 3:31 ` Américo Wang @ 2010-11-04 3:43 ` Wu Fengguang 0 siblings, 0 replies; 10+ messages in thread From: Wu Fengguang @ 2010-11-04 3:43 UTC (permalink / raw) To: Américo Wang Cc: Tetsuo Handa, mrubin@google.com, david@fromorbit.com, axboe@kernel.dk, kosaki.motohiro@jp.fujitsu.com, nickpiggin@yahoo.com.au, akpm@linux-foundation.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org On Thu, Nov 04, 2010 at 11:31:48AM +0800, Américo Wang wrote: > On Thu, Nov 04, 2010 at 10:53:41AM +0800, Wu Fengguang wrote: > >On Thu, Nov 04, 2010 at 10:52:51AM +0800, Américo Wang wrote: > >> On Thu, Nov 04, 2010 at 10:20:52AM +0800, Wu Fengguang wrote: > >> >On Thu, Nov 04, 2010 at 05:54:48AM +0800, Tetsuo Handa wrote: > >> >> Wu Fengguang wrote: > >> >> > On Wed, Nov 03, 2010 at 07:11:11PM +0800, Tetsuo Handa wrote: > >> >> > > Hello. > >> >> > > > >> >> > > "cat /proc/vmstat" triggered below failure. > >> >> > > > >> >> > > BUG: unable to handle kernel paging request at 07c06d16 > >> >> > > IP: [<c050c336>] strnlen+0x6/0x20 > >> >> > > >> >> > It seems that m->private is of type (void *) while the original v is > >> >> > (unsigned long *). Can be fixed by the following patch. > >> >> > >> >> Fixed by this patch. Thank you. > >> > > >> >Great, thanks! > >> > > >> >> By the way, GCC treats "(void *) + offset" as "(char *) + offset" > >> >> but it is GCC specific extention. Maybe we should avoid such usage > >> >> in order to avoid build failure for other compilers. > >> > > >> >"(void *) + offset" seems to be used quite often. > >> > > >> >I tried enable this gcc option, only to see huge amount of warnings. > >> > > >> > -Wpointer-arith > >> > Warn about anything that depends on the "size of" a > >> > function type or of "void". GNU C assigns these types a > >> > size of 1, for convenience in calculations with "void *" > >> > pointers and pointers to functions. > >> > > >> > >> Yup! I think it is good to have this. > >> > >> >/cc/linux-next/scripts/mod/file2alias.c:88: warning: pointer of type ‘void *’ used in arithmetic > >> ... > >> >/cc/linux-next/scripts/mod/modpost.c:1565: warning: pointer of type ‘void *’ used in arithmetic > >> > > >> > >> No problem, this is from kbuild and most of them that I checked are actually fine, > >> we can send patches to remove these warnings. > > > >Confirmed. Now my full kernel build is complete and the above are the > >only warnings I see. So it should be easy to add the -Wpointer-arith > >check. > > > > Well, after I tried to compile with it, I got lots of warnings. > Most of them that I checked is something like: > > (void *) CONST_PTR + OFFSET > > in macros. In order to fix this, we need to: > > (void *) ((char *) CONST_PTR + OFFSET) > > So, we have to make some efforts to kill all the warnings. :-/ Sorry I didn't run allyesconfig/allmodconfig as suggested by Tetsuo. So expect more warnings.. Thanks, Fengguang ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-11-04 3:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <201011010053.ADE86905.JMLFHVtSQOOFOF@I-love.SAKURA.ne.jp>
2010-11-03 11:11 ` [2.6.37-rc1] /proc/vmstat failure Tetsuo Handa
2010-11-03 17:43 ` Linus Torvalds
2010-11-03 17:46 ` Wu Fengguang
2010-11-03 17:55 ` Linus Torvalds
2010-11-03 21:54 ` Tetsuo Handa
2010-11-04 2:20 ` Wu Fengguang
2010-11-04 2:52 ` Américo Wang
2010-11-04 2:53 ` Wu Fengguang
2010-11-04 3:31 ` Américo Wang
2010-11-04 3:43 ` Wu Fengguang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox