From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88BFD7C for ; Wed, 8 Jun 2022 20:45:33 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id l20-20020a17090a409400b001dd2a9d555bso19413755pjg.0 for ; Wed, 08 Jun 2022 13:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bTBDtpW2qpcmzetkuUn9+lFzWx5HLxWub8Bm7cJfh2o=; b=Ebv8KX8PrhCbhkiUOwrYsdSxtwhEYjuLpaIcWDDUxSEhuOm5U2E/ijtPueb/kBf9on UVGe3xTfppkY+qsf3Oc9TnYJjgyaLdovdnHfAF+PSF2bgjoDAg6x78SLsWc5kosawUIm ZzVM6u3shW7LjAmkuYlKaJIyw6UX3eUeMYTugbSxHS+oUYBy/UW9b8m5mVg81JUUgPcD 1RV33HRC0GYVgdFGBeEgmIw3B5rDlmCPMYhChQVskDJcmSqmiN4TxJ41JOj/P5FUWDGb lkMV7KEPpp0mCp4/P0mm97GwH7ojt8SUXm9n3engCy4mE4p/vFKnatudqpX5jbO0nOE/ CySg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=bTBDtpW2qpcmzetkuUn9+lFzWx5HLxWub8Bm7cJfh2o=; b=SjtMbchgSuoXBQR06AfreEPWLX6mee91fM8h+y6c3L9hvt4/20MK4Q9Gfgs99DMHmN Y+0EaKqeLsgbvFKZoz2e1VS88XyyNnjqNANe+65/Mj7G4cGTT0MSnf4u8in7Y494kgcv QmbZ7eIk4S+jsdiCLPSNPEI64Oehuqol8gPpStBmNa7XfYaaO0XGFlaWvDjjDc07xReu 0AxvQxIvkXNVH+/fIlLLPqS1l8Cf3/rkWHOlq8/bLcR5CkaiZqsdzntfaghUkNtROhqX oJG9LAH2ZG4x3I8bFyyScKVnvIUA2EuC0oskhBXElmE/yo5qxZX6BHtOYDGePrmfYoUp vvng== X-Gm-Message-State: AOAM533k+trb8mgrGsvHD+olVQHWED7n5OLOuWnWYsiZLRAV+qUuBroK 0hC9T9qQrOBKnfvn9NO7kZ4= X-Google-Smtp-Source: ABdhPJxWnOVLKSSb2udV5MEgFj+HgqKRxSGhFY7d0TphKFpZQyhmluBHlgWM/bio1Z4rR05TfrYjvA== X-Received: by 2002:a17:903:22c9:b0:163:e49d:648c with SMTP id y9-20020a17090322c900b00163e49d648cmr36311082plg.54.1654721132718; Wed, 08 Jun 2022 13:45:32 -0700 (PDT) Received: from google.com ([2620:15c:211:201:f30f:4d03:66e6:b121]) by smtp.gmail.com with ESMTPSA id cj24-20020a056a00299800b0051bc1865ca5sm13796026pfb.122.2022.06.08.13.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 13:45:32 -0700 (PDT) Sender: Minchan Kim Date: Wed, 8 Jun 2022 13:45:30 -0700 From: Minchan Kim To: Sergey Senozhatsky Cc: Naresh Kamboju , open list , linux-fsdevel@vger.kernel.org, Linux ARM , "open list:KERNEL SELFTEST FRAMEWORK" , linux-block , regressions@lists.linux.dev, Jens Axboe , Nitin Gupta Subject: Re: qemu-arm: zram: mkfs.ext4 : Unable to handle kernel NULL pointer dereference at virtual address 00000140 Message-ID: References: Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jun 08, 2022 at 11:42:33AM +0900, Sergey Senozhatsky wrote: > On (22/06/08 11:39), Sergey Senozhatsky wrote: > > On (22/06/07 16:52), Minchan Kim wrote: > > > > rootfs: https://oebuilds.tuxbuild.com/29zhlbEc3EWq2wod9Uy964Bp27q/images/am57xx-evm/rpb-console-image-lkft-am57xx-evm-20220601222434.rootfs.ext4.gz > > > > kernel: https://builds.tuxbuild.com/29zhqJJizU2Y7Ka7ArhryUOrNDC/zImage > > > > > > > > Boot command, > > > > /usr/bin/qemu-system-aarch64 -cpu host,aarch64=off -machine > > > > virt-2.10,accel=kvm -nographic -net > > > > nic,model=virtio,maaacaddr=BA:DD:AD:CC:09:04 -net tap -m 2048 -monitor > > > > none -kernel kernel/zImage --append "console=ttyAMA0 root=/dev/vda rw" > > > > -hda rootfs/rpb-console-image-lkft-am57xx-evm-20220601222434.rootfs.ext4 > > > > -m 4096 -smp 2 > > > > > > > > # cd /opt/kselftests/default-in-kernel/zram > > > > # ./zram.sh > > > > > > > > Allow me sometime I will try to bisect this problem. > > > > > > Thanks for sharing the info. > > > > > > I managed to work your rootfs with my local arm build > > > based on the problematic git tip. > > > However, I couldn't suceed to reproduce it. > > > > > > I needed to build zsmalloc/zram built-in instead of modules > > > Is it related? Hmm, > > > > > > Yeah, It would be very helpful if you could help to bisect it. > > > > This looks like a NULL lock->name dereference in lockdep. I suspect > > that somehow local_lock doesn't get .dep_map initialized. Maybe running > > the kernel with CONFIG_DEBUG_LOCK_ALLOC would help us? Naresh, can you > > help us with this? > > Hmm, actually, hold on. mapping_area is per-CPU, so what happens if CPU > get offlined and onlined again? I don't see us re-initializing mapping_area > local_lock_init(&zs_map_area.lock) and so on. I am trying to understand the problem. AFAIK, the mapping_area was static allocation per cpu so in zs_cpu_down, we never free the mapping_area itself. Then, why do we need to reinitialize the local lock again? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DFDDC43334 for ; Wed, 8 Jun 2022 20:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3QU5lfmh04++bnYRdCwsMJuBidqQ6StO7tp78WnPnAw=; b=fNc+YSmkpTqKfO ZyFhHR/5mjY+AjNAnn5EKx45iMv2ZP7kLR7kLxBv8ofrbgbwU5bUuAExpg5eVaS1LvtoyeRx4cmB+ Zqw1nv3FdqtaT8uxjKg0w2WmiwJuWYtXOeoAOLrBubS1e2KZyxTfcrscv/tXvY5x2D8eqyMG+JPqC q9yoVAjTvYO6N51eU7x3xSaaA78LpbLGSTgHw5BJH4dMkQueP76pAd2etHL3hW3OFsn2bDrYhldl0 KPcYw5w7LGAqIKTP0rrOd0L7bOXjcUCsYICbiTKoNxqsPVJO5PQlFyQvYOeTfnk0PU34GDWZ+7rLg GwIOhyQ5wYKUZBOTWSHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz2Yc-00Euxh-N2; Wed, 08 Jun 2022 20:45:38 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz2YY-00EuwC-Rj for linux-arm-kernel@lists.infradead.org; Wed, 08 Jun 2022 20:45:36 +0000 Received: by mail-pl1-x632.google.com with SMTP id o17so18676017pla.6 for ; Wed, 08 Jun 2022 13:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bTBDtpW2qpcmzetkuUn9+lFzWx5HLxWub8Bm7cJfh2o=; b=Ebv8KX8PrhCbhkiUOwrYsdSxtwhEYjuLpaIcWDDUxSEhuOm5U2E/ijtPueb/kBf9on UVGe3xTfppkY+qsf3Oc9TnYJjgyaLdovdnHfAF+PSF2bgjoDAg6x78SLsWc5kosawUIm ZzVM6u3shW7LjAmkuYlKaJIyw6UX3eUeMYTugbSxHS+oUYBy/UW9b8m5mVg81JUUgPcD 1RV33HRC0GYVgdFGBeEgmIw3B5rDlmCPMYhChQVskDJcmSqmiN4TxJ41JOj/P5FUWDGb lkMV7KEPpp0mCp4/P0mm97GwH7ojt8SUXm9n3engCy4mE4p/vFKnatudqpX5jbO0nOE/ CySg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=bTBDtpW2qpcmzetkuUn9+lFzWx5HLxWub8Bm7cJfh2o=; b=Slsb5yI08xkS/bgfb/yOGMuDRJ89vmJ3rQ3EqQWvkK4V+iPiVCs1sM/YWkoZXEI2S1 v85UarMkU8HGvtZ0TNbptOL/KyPjRaKc2RifmMP6iE9rh//EJsA9KDJPOYu2/Nl7pM5L HH23Si6Y83woe9Lg+e7Kh8DRgv5C/bZgETSMZWb95pdVPY1Mosxyaai/sXZLleF+xv3M N+98hT1EuoNwm7nRDyC7+nV+kMt0pkLVsy7xDEZvGCL6Yc3J4XdcvVo3enuIET0w3vC8 nuPfwsEEQR2bGtZlPgAjmSPxmrktalzhb/waWU+0QquKehs67Hk/m1o39BOzPWsJJS1Q ravQ== X-Gm-Message-State: AOAM531fcmEgUKu/ix7Xbl81NagPPW3AkDqIRbfHejhJ87kaL0LbV5Ka x6pZ6wDJVXZAOqog3Q1XYSw= X-Google-Smtp-Source: ABdhPJxWnOVLKSSb2udV5MEgFj+HgqKRxSGhFY7d0TphKFpZQyhmluBHlgWM/bio1Z4rR05TfrYjvA== X-Received: by 2002:a17:903:22c9:b0:163:e49d:648c with SMTP id y9-20020a17090322c900b00163e49d648cmr36311082plg.54.1654721132718; Wed, 08 Jun 2022 13:45:32 -0700 (PDT) Received: from google.com ([2620:15c:211:201:f30f:4d03:66e6:b121]) by smtp.gmail.com with ESMTPSA id cj24-20020a056a00299800b0051bc1865ca5sm13796026pfb.122.2022.06.08.13.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 13:45:32 -0700 (PDT) Date: Wed, 8 Jun 2022 13:45:30 -0700 From: Minchan Kim To: Sergey Senozhatsky Cc: Naresh Kamboju , open list , linux-fsdevel@vger.kernel.org, Linux ARM , "open list:KERNEL SELFTEST FRAMEWORK" , linux-block , regressions@lists.linux.dev, Jens Axboe , Nitin Gupta Subject: Re: qemu-arm: zram: mkfs.ext4 : Unable to handle kernel NULL pointer dereference at virtual address 00000140 Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_134534_920116_B7F4304A X-CRM114-Status: GOOD ( 20.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 08, 2022 at 11:42:33AM +0900, Sergey Senozhatsky wrote: > On (22/06/08 11:39), Sergey Senozhatsky wrote: > > On (22/06/07 16:52), Minchan Kim wrote: > > > > rootfs: https://oebuilds.tuxbuild.com/29zhlbEc3EWq2wod9Uy964Bp27q/images/am57xx-evm/rpb-console-image-lkft-am57xx-evm-20220601222434.rootfs.ext4.gz > > > > kernel: https://builds.tuxbuild.com/29zhqJJizU2Y7Ka7ArhryUOrNDC/zImage > > > > > > > > Boot command, > > > > /usr/bin/qemu-system-aarch64 -cpu host,aarch64=off -machine > > > > virt-2.10,accel=kvm -nographic -net > > > > nic,model=virtio,maaacaddr=BA:DD:AD:CC:09:04 -net tap -m 2048 -monitor > > > > none -kernel kernel/zImage --append "console=ttyAMA0 root=/dev/vda rw" > > > > -hda rootfs/rpb-console-image-lkft-am57xx-evm-20220601222434.rootfs.ext4 > > > > -m 4096 -smp 2 > > > > > > > > # cd /opt/kselftests/default-in-kernel/zram > > > > # ./zram.sh > > > > > > > > Allow me sometime I will try to bisect this problem. > > > > > > Thanks for sharing the info. > > > > > > I managed to work your rootfs with my local arm build > > > based on the problematic git tip. > > > However, I couldn't suceed to reproduce it. > > > > > > I needed to build zsmalloc/zram built-in instead of modules > > > Is it related? Hmm, > > > > > > Yeah, It would be very helpful if you could help to bisect it. > > > > This looks like a NULL lock->name dereference in lockdep. I suspect > > that somehow local_lock doesn't get .dep_map initialized. Maybe running > > the kernel with CONFIG_DEBUG_LOCK_ALLOC would help us? Naresh, can you > > help us with this? > > Hmm, actually, hold on. mapping_area is per-CPU, so what happens if CPU > get offlined and onlined again? I don't see us re-initializing mapping_area > local_lock_init(&zs_map_area.lock) and so on. I am trying to understand the problem. AFAIK, the mapping_area was static allocation per cpu so in zs_cpu_down, we never free the mapping_area itself. Then, why do we need to reinitialize the local lock again? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel