Re: [Crash-utility] 答复: [External Mail]Re: zram decompress support for gcore/crash-utility

2020-04-09 Thread 赵乾利
I got little problem to compile 32-bit on my x86-64 host..
 96 /usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when searching for -lgcc
 97 /usr/bin/ld: cannot find -lgcc
 98 /usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s
 99 /usr/bin/ld: cannot find -lgcc_s

I think i have fixed the build warning,but failed rebuild in 32-bit since above 
error,please help confirm,and move log to try_zram_decompress,please check the 
attachment.


From: Dave Anderson 
Sent: Friday, April 10, 2020 1:00
To: 赵乾利
Cc: d hatayama; Discussion list for crash utility usage, maintenance and 
development
Subject: Re: 答复: [External Mail]Re: [Crash-utility] zram decompress support for 
gcore/crash-utility

- Original Message -
> Hi,Dave
>
> I modified RETURN_ON_ERROR to FAULT_ON_ERROR in all readmem,patch has > 
> attached.
> The reason for adding "decompress success"  is that i want indicate that zram
> address is different from the normal address,and calling zram_decompress not
> only readmem failures,but also decompression failures etc.i add "This page
> has swaped to zram"/"zram decompress success" as the signature log,and these
> log only printed when pc->debug >= 2.
>
> When gcore read UVA address,there may be many page fault happened,we can only
> deal with zram swap,"not mapped" and other types of swap will not be
> processed.For debug request,we may need the signature log for zram.
> so i think it's better to keep this log.

OK fine, but please move the message out of readmem(), and put it at the end of
try_zram_decompress() where it really belongs.  You'll have to replace the
"PAGEOFFSET(addr)" argument with "ulonglong addr", and then do the PAGEOFFSET()
in try_zram_decompress().

Also, this doesn't compile cleanly on 32-bit architectures:

$ make warn
TARGET: X86
 CRASH: 7.2.9rc10
   GDB: 7.6

...
cc -c -g -DX86 -m32 -D_FILE_OFFSET_BITS=64 -DLZO -DSNAPPY -DGDB_7_6  diskdump.c 
-Wall -O2 -Wstrict-prototypes -Wmissing-prototypes -fstack-protector 
-Wformat-security
diskdump.c: In function 'lookup_swap_cache':
diskdump.c:2657:2: warning: right shift count >= width of type [enabled by 
default]
  swp_type = __swp_type(pte_val);
  ^
diskdump.c:2659:3: warning: right shift count >= width of type [enabled by 
default]
   swp_offset = (ulonglong)__swp_offset(pte_val);
   ^
diskdump.c: In function 'try_zram_decompress':
diskdump.c:2709:3: warning: right shift count >= width of type [enabled by 
default]
   swap_info += (__swp_type(pte_val) * sizeof(void *));
   ^
diskdump.c:2713:3: warning: right shift count >= width of type [enabled by 
default]
   swap_info += (SIZE(swap_info_struct) * __swp_type(pte_val));
   ^
diskdump.c:2745:4: warning: right shift count >= width of type [enabled by 
default]
swp_offset = (ulonglong)__swp_offset(pte_val);
...

Thanks,
  Dave

#/**本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
 This e-mail and its attachments contain confidential information from XIAOMI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!**/#
<>
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Re: [Crash-utility] 答复: [External Mail]Re: zram decompress support for gcore/crash-utility

2020-04-09 Thread Dave Anderson




- Original Message -
> Hi,Dave
> 
> I modified RETURN_ON_ERROR to FAULT_ON_ERROR in all readmem,patch has > 
> attached.
> The reason for adding "decompress success"  is that i want indicate that zram
> address is different from the normal address,and calling zram_decompress not
> only readmem failures,but also decompression failures etc.i add "This page
> has swaped to zram"/"zram decompress success" as the signature log,and these
> log only printed when pc->debug >= 2.
> 
> When gcore read UVA address,there may be many page fault happened,we can only
> deal with zram swap,"not mapped" and other types of swap will not be
> processed.For debug request,we may need the signature log for zram.
> so i think it's better to keep this log.

OK fine, but please move the message out of readmem(), and put it at the end of 
try_zram_decompress() where it really belongs.  You'll have to replace the 
"PAGEOFFSET(addr)" argument with "ulonglong addr", and then do the PAGEOFFSET()
in try_zram_decompress().

Also, this doesn't compile cleanly on 32-bit architectures:

$ make warn
TARGET: X86
 CRASH: 7.2.9rc10
   GDB: 7.6

...
cc -c -g -DX86 -m32 -D_FILE_OFFSET_BITS=64 -DLZO -DSNAPPY -DGDB_7_6  diskdump.c 
-Wall -O2 -Wstrict-prototypes -Wmissing-prototypes -fstack-protector 
-Wformat-security 
diskdump.c: In function 'lookup_swap_cache':
diskdump.c:2657:2: warning: right shift count >= width of type [enabled by 
default]
  swp_type = __swp_type(pte_val);
  ^
diskdump.c:2659:3: warning: right shift count >= width of type [enabled by 
default]
   swp_offset = (ulonglong)__swp_offset(pte_val);
   ^
diskdump.c: In function 'try_zram_decompress':
diskdump.c:2709:3: warning: right shift count >= width of type [enabled by 
default]
   swap_info += (__swp_type(pte_val) * sizeof(void *));
   ^
diskdump.c:2713:3: warning: right shift count >= width of type [enabled by 
default]
   swap_info += (SIZE(swap_info_struct) * __swp_type(pte_val));
   ^
diskdump.c:2745:4: warning: right shift count >= width of type [enabled by 
default]
swp_offset = (ulonglong)__swp_offset(pte_val);
...

Thanks,
  Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility



Re: [Crash-utility] [PATCH] fix "kmem -[sS]" for caches created during SLUB bootstrap

2020-04-09 Thread Dave Anderson


- Original Message -
> Fix for "kmem -[sS]" options on Linux 4.14 and later kernels built
> with CONFIG_SLAB_FREELIST_HARDENED enabled. Without the patch, there
> will error messages of the type "kmem:  slab: 
> invalid freepointer: " for caches created during
> SLUB bootstrap, as they are likely to have s->random == 0.
> 
> Signed-off-by: Hari Bathini 

Hi Hari,

Queued for crash-7.2.9:

  
https://github.com/crash-utility/crash/commit/1ad5a3622f32387b271584d2fe26c07530bcddc9

Thanks,
  Dave


> ---
>  memory.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/memory.c b/memory.c
> index ccc2944..c2433eb 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -19244,7 +19244,7 @@ count_free_objects(struct meminfo *si, ulong
> freelist)
>  static ulong
>  freelist_ptr(struct meminfo *si, ulong ptr, ulong ptr_addr)
>  {
> - if (si->random)
> + if (VALID_MEMBER(kmem_cache_random))
>   /* CONFIG_SLAB_FREELIST_HARDENED */
>   return (ptr ^ si->random ^ ptr_addr);
>   else
> 
> 

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility