On Tue, Jun 23, 2020 at 01:35:21PM +0200, Vlastimil Babka wrote:
> On 6/23/20 11:02 AM, kernel test robot wrote:
> > Greeting,
> > 
> > FYI, we noticed the following commit (built with gcc-6):
> > 
> > commit: 7b39adbb1b1d3e73df9066a8d1e93a83c18d7730 ("mm, slab/slub: improve 
> > error reporting and overhead of cache_from_obj()")
> > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master
> > 
> > in testcase: boot
> > 
> > on test machine: qemu-system-i386 -enable-kvm -cpu SandyBridge -smp 2 -m 16G
> > 
> > caused below changes (please refer to attached dmesg/kmsg for entire 
> > log/backtrace):
> > 
> > 
> > +--------------------------------------------------------+------------+------------+
> > |                                                        | 5a2a0a5f04 | 
> > 7b39adbb1b |
> > +--------------------------------------------------------+------------+------------+
> > | boot_successes                                         | 4          | 0   
> >        |
> > | boot_failures                                          | 4          | 8   
> >        |
> > | WARNING:at_kernel/trace/trace.c:#trace_find_next_entry | 4          | 4   
> >        |
> > | EIP:trace_find_next_entry                              | 4          | 4   
> >        |
> > | WARNING:at_mm/slab.h:#kmem_cache_free                  | 0          | 8   
> >        |
> > | EIP:kmem_cache_free                                    | 0          | 8   
> >        |
> > +--------------------------------------------------------+------------+------------+
> > 
> > 
> > If you fix the issue, kindly add following tag
> > Reported-by: kernel test robot <rong.a.c...@intel.com>
> > 
> > 
> > [    3.251054] WARNING: CPU: 0 PID: 8 at mm/slab.h:298 
> > kmem_cache_free+0x5/0x170
> 
> So this is due to the latest fixups.
> 
> Roman suggested VM_WARN_ON_ONCE(!(flags & SLAB_DEBUG_FLAGS)); which triggered 
> here.
> For Kees, the cache_from_obj() is again shared between SLAB and SLUB and is
> testing kmem_cache_debug_flags(s, SLAB_CONSISTENCY_CHECKS).
> 
> However under CONFIG_SLAB, SLAB_DEBUG_FLAGS doesn't include 
> SLAB_CONSISTENCY_CHECKS.
> 
> I think I'll need to move the VM_WARN_ON_ONCE() under #ifdef CONFIG_SLUB ?

Or just add SLAB_CONSISTENCY_CHECKS to SLAB's SLAB_DEBUG_FLAGS?

I'm fine with moving VM_WARN_ON_ONCE() too.

Thanks!


> 
> > [    3.251054] Modules linked in:
> > [    3.251054] CPU: 0 PID: 8 Comm: kdevtmpfs Not tainted 
> > 5.8.0-rc1-00277-g7b39adbb1b1d3 #1
> > [    3.251054] EIP: kmem_cache_free+0x5/0x170
> > [    3.251054] Code: 9f 8c 89 f8 e8 cc 58 fd ff 0f 0b 8d 78 ff e9 77 ff ff 
> > ff e8 2d d3 90 00 8d b4 26 00 00 00 00 8d b6 00 00 00 00 66 66 66 66 90 
> > <0f> 0b 85 c0 0f 84 a6 00 00 00 8b 0d 64 50 b7 8c 85 c9 0f 84 33 01
> > [    3.251054] EAX: 80090780 EBX: 802b4000 ECX: 00000000 EDX: 802b4000
> > [    3.251054] ESI: 802b4000 EDI: 80305e04 EBP: 80305df4 ESP: 80305dec
> > [    3.251054] DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068 EFLAGS: 00010246
> > [    3.251054] CR0: 80050033 CR2: ffffffff CR3: 0ceb2000 CR4: 000406b0
> > [    3.251054] Call Trace:
> > [    3.251054]  ? putname+0x5c/0x60
> > [    3.251054]  filename_lookup+0xde/0x1a0
> > [    3.251054]  ? rcu_read_lock_sched_held+0x20/0x50
> > [    3.251054]  ? strncpy_from_user+0x21/0x1a0
> > [    3.251054]  user_path_at_empty+0x2a/0x40
> > [    3.251054]  do_mount+0x5d/0x9b0
> > [    3.251054]  devtmpfsd+0x69/0x2c0
> > [    3.251054]  ? sched_clock_cpu+0x44/0xc0
> > [    3.251054]  ? _raw_spin_unlock_irqrestore+0x2a/0x72
> > [    3.251054]  ? trace_hardirqs_on+0xbf/0x270
> > [    3.251054]  ? __kthread_parkme+0x5a/0x80
> > [    3.251054]  kthread+0xf0/0x120
> > [    3.251054]  ? public_dev_mount+0x40/0x40
> > [    3.251054]  ? kthread_create_worker_on_cpu+0x20/0x20
> > [    3.251054]  ret_from_fork+0x19/0x30
> > [    3.251054] irq event stamp: 41
> > [    3.251054] hardirqs last  enabled at (41): [<8ba11885>] 
> > set_root+0x95/0x190
> > [    3.251054] hardirqs last disabled at (40): [<8ba11856>] 
> > set_root+0x66/0x190
> > [    3.251054] softirqs last  enabled at (0): [<8b87027b>] 
> > copy_process+0x3eb/0x15b0
> > [    3.251054] softirqs last disabled at (0): [<00000000>] 0x0
> > [    3.251054] ---[ end trace e72be312a52f9020 ]---
> > 
> > 
> > To reproduce:
> > 
> >         # build kernel
> >     cd linux
> >     cp config-5.8.0-rc1-00277-g7b39adbb1b1d3 .config
> >     make HOSTCC=gcc-6 CC=gcc-6 ARCH=i386 olddefconfig prepare 
> > modules_prepare bzImage
> > 
> >         git clone https://github.com/intel/lkp-tests.git
> >         cd lkp-tests
> >         bin/lkp qemu -k <bzImage> job-script # job-script is attached in 
> > this email
> > 
> > 
> > 
> > Thanks,
> > Rong Chen
> > 
> 

Reply via email to