All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6.36-git17] /proc/vmstat failure.
@ 2010-10-31 15:53 Tetsuo Handa
  2010-11-03 11:11 ` [2.6.37-rc1] " Tetsuo Handa
  0 siblings, 1 reply; 11+ messages in thread
From: Tetsuo Handa @ 2010-10-31 15:53 UTC (permalink / raw)
  To: linux-fsdevel

Hello.

"cat /proc/vmstat" triggered below failure.

[root@tomoyo ~]# cat /proc/vmstat
nr_free_pages 50565
nr_inactive_anon 67
nr_active_anon 4098
nr_inactive_file 34934
nr_active_file 3598
nr_unevictable 0
nr_mlock 0
nr_anon_pages 4108
nr_mapped 3003
nr_file_pages 38610
nr_dirty 55
nr_writeback 0
nr_slab_reclaimable 24047
nr_slab_unreclaimable 6487
nr_page_table_pages 261
nr_kernel_stack 87
nr_unstable 0
nr_bounce 0
nr_vmscan_write 0
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_shmem 78
nr_dirtied 1150
nr_written 1093
nr_dirty_threshold 17819
nr_dirty_background_threshold 8909
pgpgin 153267
pgpgout 13776
pswpin 0
pswpout 0
pgalloc_dma 8
pgalloc_normal 201674
pgalloc_high 0
pgalloc_movable 0
pgfree 252447
pgactivate 3921
pgdeactivate 0
pgfault 470482
pgmajfault 365
pgrefill_dma 0
pgrefill_normal 0
pgrefill_high 0
pgrefill_movable 0
pgsteal_dma 0
pgsteal_normal 0
pgsteal_high 0
pgsteal_movable 0
pgscan_kswapd_dma 0
pgscan_kswapd_normal 0
pgscan_kswapd_high 0
pgscan_kswapd_movable 0
pgscan_direct_dma 0
pgscan_direct_normal 0
pgscan_direct_high 0
pgscan_direct_movable 0
pginodesteaKilled
[root@tomoyo ~]# dmesg
[  104.226042] BUG: unable to handle kernel paging request at afc07757
[  104.226746] IP: [<c0539449>] strnlen+0x9/0x20
[  104.226746] *pde = 00000000
[  104.226746] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
[  104.226746] last sysfs file: /sys/block/fd0/dev
[  104.226746] Modules linked in: ipv6 video output sbs sbshc battery serio_raw ac floppy rtc_cmos rtc_core rtc_lib button pcnet32 mii i2c_piix4 i2c_core ccsecurity mptspi mptscsih mptbase scsi_transport_spi ext3 jbd mbcache
[  104.226746]
[  104.226746] Pid: 2931, comm: cat Not tainted 2.6.36-git17 #2 440BX Desktop Reference Platform/VMware Virtual Platform
[  104.226746] EIP: 0060:[<c0539449>] EFLAGS: 00010297 CPU: 0
[  104.226746] EIP is at strnlen+0x9/0x20
[  104.226746] EAX: afc07757 EBX: dd115000 ECX: afc07757 EDX: fffffffe
[  104.226746] ESI: dd114000 EDI: dd233ef8 EBP: dd233e5c ESP: dd233e5c
[  104.226746]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[  104.226746] Process cat (pid: 2931, ti=dd232000 task=dd030af0 task.ti=dd232000)
[  104.226746] Stack:
[  104.226746]  dd233e8c c05373ed dd233e6c afc07757 ffff0af0 00000000 dd030f50 c0775590
[  104.226746]  c0775591 00000002 c0775590 dd233ef8 dd233ed0 c05380c6 ff0a0004 ffffffff
[  104.226746]  00000006 00000000 00001000 dd114000 dd114000 dd115000 c0775592 dd233efc
[  104.226746] Call Trace:
[  104.226746]  [<c05373ed>] ? string+0x3d/0xf0
[  104.226746]  [<c05380c6>] ? vsnprintf+0x1d6/0x350
[  104.226746]  [<c04d608d>] ? seq_printf+0x2d/0x60
[  104.226746]  [<c049edcc>] ? vmstat_show+0x2c/0x30
[  104.226746]  [<c04d646a>] ? seq_read+0xda/0x370
[  104.226746]  [<c04fa348>] ? proc_reg_read+0x48/0x90
[  104.226746]  [<c04d6390>] ? seq_read+0x0/0x370
[  104.226746]  [<c04fa35d>] ? proc_reg_read+0x5d/0x90
[  104.226746]  [<c04bb6f4>] ? vfs_read+0x94/0x130
[  104.226746]  [<c04fa300>] ? proc_reg_read+0x0/0x90
[  104.226746]  [<c04bb94d>] ? sys_read+0x3d/0x70
[  104.226746]  [<c0402c50>] ? sysenter_do_call+0x12/0x36
[  104.226746] Code: c3 90 55 85 c9 89 e5 57 89 c7 89 d0 74 05 f2 ae 75 01 4f 89 f8 5f 5d c3 8d 76 00 8d bc 27 00 00 00 00 55 89 c1 89 e5 89 c8 eb 06 <80> 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 5d c3 90 90 90 90 90
[  104.226746] EIP: [<c0539449>] strnlen+0x9/0x20 SS:ESP 0068:dd233e5c
[  104.226746] CR2: 00000000afc07757
[  104.259875] ---[ end trace 1f2e096de1d38845 ]---

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).

2.6.36 was OK. I haven't tested further.

Regards.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [2.6.37-rc1] /proc/vmstat failure.
  2010-10-31 15:53 [2.6.36-git17] /proc/vmstat failure Tetsuo Handa
@ 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; 11+ 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] 11+ messages in thread

* Re: [2.6.37-rc1] /proc/vmstat failure.
  2010-11-03 11:11 ` [2.6.37-rc1] " Tetsuo Handa
@ 2010-11-03 17:43   ` Linus Torvalds
  2010-11-03 17:46   ` Wu Fengguang
  1 sibling, 0 replies; 11+ 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] 11+ messages in thread

* Re: [2.6.37-rc1] /proc/vmstat failure.
  2010-11-03 11:11 ` [2.6.37-rc1] " 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; 11+ messages in thread
From: Wu Fengguang @ 2010-11-03 17:46 UTC (permalink / raw)
  To: Tetsuo Handa
  Cc: mrubin, david, axboe, kosaki.motohiro, nickpiggin, akpm,
	torvalds, linux-kernel

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] 11+ 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; 11+ messages in thread
From: Linus Torvalds @ 2010-11-03 17:55 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: Tetsuo Handa, mrubin, david, axboe, kosaki.motohiro, akpm, linux-kernel

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] 11+ 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; 11+ 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] 11+ 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; 11+ messages in thread
From: Wu Fengguang @ 2010-11-04  2:20 UTC (permalink / raw)
  To: Tetsuo Handa
  Cc: mrubin, david, axboe, kosaki.motohiro, nickpiggin, akpm,
	torvalds, linux-kernel

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] 11+ 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; 11+ messages in thread
From: Américo Wang @ 2010-11-04  2:52 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: Tetsuo Handa, mrubin, david, axboe, kosaki.motohiro, nickpiggin,
	akpm, torvalds, linux-kernel

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] 11+ 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; 11+ messages in thread
From: Wu Fengguang @ 2010-11-04  2:53 UTC (permalink / raw)
  To: Américo Wang
  Cc: Tetsuo Handa, mrubin, david, axboe, kosaki.motohiro, nickpiggin,
	akpm, torvalds, linux-kernel

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] 11+ 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; 11+ 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, david, axboe,
	kosaki.motohiro, nickpiggin, akpm, torvalds, linux-kernel

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] 11+ 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; 11+ messages in thread
From: Wu Fengguang @ 2010-11-04  3:43 UTC (permalink / raw)
  To: Américo Wang
  Cc: Tetsuo Handa, mrubin, david, axboe, kosaki.motohiro, nickpiggin,
	akpm, torvalds, linux-kernel

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] 11+ messages in thread

end of thread, other threads:[~2010-11-04  3:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-31 15:53 [2.6.36-git17] /proc/vmstat failure Tetsuo Handa
2010-11-03 11:11 ` [2.6.37-rc1] " 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.