Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1907635pxp; Sun, 13 Mar 2022 03:54:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLynalqAYLtkZXcbb7SCFEU2mDEFSFXLMw2gNrnlOK9pMyS0FkyFwrRwWA6NxNtUnNHiZC X-Received: by 2002:a17:90b:789:b0:1bc:293c:1445 with SMTP id l9-20020a17090b078900b001bc293c1445mr30817854pjz.111.1647168857757; Sun, 13 Mar 2022 03:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647168857; cv=none; d=google.com; s=arc-20160816; b=uim1pKKJtlHd2OnbYtXC/K5A+20c5JIDC6LZUmSP+FC3lq2jp7s3KoHwIQcvXY69OP ruvyDPBdlZnlABe3VM0SlAsZsXrC2YXihO1c+wYrtgywE2xW0F713py2mEBD/uFb0JKy fDx8fDmsJx/49rT/719E7V61LY0ZXQHnGDcvZo6bJ8OONkfG7No2g3GrkLRHe/Vdlbbd DWykNgaoXAFdQEDrxmulYAua8qqE5M7M6Pi5CYGyMu2EnrGarnh4ak0rwLQZkN6gzeVi zQFnpwHrr4BK6QwsZcxN5H5x5Tqi6Q1JE7xRfvN+axJbxcywB3Mf0RVyNI29RG+ObYZ5 s2vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xixA67+CyBszDmeLpcJ5bC/ErLQH8CHjHgxpS8GoaOg=; b=tqxI9k6lHJL63AVU5dWnm9T9RUNucE9LJdOx7Ma1BV8fzRsDgFC1CR79HmiTrqtMur vjGDY03iXcYhQ9MQiGWanT1y8C/glp4NfbnqmZXa72D79LrI5ROlJirW4AKy+JLG8Cbq taheuBclP5cgDQzCJo/INb7uIJ9oT20KDYJvdc2plGzNPW6oe1aJGYNYU+f5J4etfTKD Ljsqa9kWcnk/p8x3XjHBaIML0S3S8Eg9VHI82wLgeEAO9oLRfOzxtZtzpPRk3HvwTR/H u/iMzgH/g8cBDsEMLb2itx4fYWgmAZ2SxIZX+62gzXh1JVs6e5ZeKS+JVHqKt7cEVhib b5/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FaLddWrj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gj21-20020a17090b109500b001bd14e03040si9278947pjb.24.2022.03.13.03.54.05; Sun, 13 Mar 2022 03:54:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FaLddWrj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbiCLLFn (ORCPT + 99 others); Sat, 12 Mar 2022 06:05:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbiCLLFl (ORCPT ); Sat, 12 Mar 2022 06:05:41 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D7120D53C for ; Sat, 12 Mar 2022 03:04:36 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id r12so9741448pla.1 for ; Sat, 12 Mar 2022 03:04:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xixA67+CyBszDmeLpcJ5bC/ErLQH8CHjHgxpS8GoaOg=; b=FaLddWrjzCNwNpV+4oG8wrN5zawUTnx/S2++0S0ZRKYRxMR78ty3GxOil0Zbmj8ikz k+chYyEryktbPiwQKEHbPn8RNkffjmIyd740/rFdMw5lTHeZX46BFlrOLiAAwpb9FXrH zS5kOtAffkm3QWBtFisz/Qarv/HbKrO0qthDc752+0XABN43fAazTM5BSuee8pMZkHr2 UDS6uRSdAVjtm/Vmw5Ka4G7RkAtPnpcVsEq43nPVKuvtrj99oO/c+XM0v93FYCWkmFVY saf7Ma6zqhQdpP9QMEcPe27O0mEzcmHwtt16uAGyEKCndgR3MG44bf06QArQpwW6w31M mlSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xixA67+CyBszDmeLpcJ5bC/ErLQH8CHjHgxpS8GoaOg=; b=HalfMh3HOgW3OTp5RhP7mY61KuwWea8jpIVs9zuASraSw1Y6oda3udgUPvUHrU2UX6 wQPUqW7fCxqhCAtFlZOYc+ltU8G90V01RJng8HlnXpOtDz2gubhCtC1cMa26AZcaeq2j TquJRUzRX3BSQYSUGce3J8OaYIz78ktE5XEi8CmDUXmdCN/4KgOiDIGMXO6nxcrZ7/bf yaUzVPlVo0iKlSyz/KHlrpVZOUtTW/0Hu55jDj8naELmkfkqTRiyUq1DdoLBT+x1DLIE AWm40c/Xhk+aUmqnaSGWtjl6awURRg9OUAdWaR0pzJdESLp1OOuzpU4sdvpKKMUps3Pq 7BAA== X-Gm-Message-State: AOAM531K1UASfvBc3ubs6wLwhPeWDnI5yIEoXJlRaX3i2/VvPyOyUNy/ rnJLGat+Z8bMQ0F62c2qxLFmLd+3vhIskQ== X-Received: by 2002:a17:902:b614:b0:151:f034:4058 with SMTP id b20-20020a170902b61400b00151f0344058mr15057749pls.84.1647083075766; Sat, 12 Mar 2022 03:04:35 -0800 (PST) Received: from ip-172-31-19-208.ap-northeast-1.compute.internal (ec2-18-181-137-102.ap-northeast-1.compute.amazonaws.com. [18.181.137.102]) by smtp.gmail.com with ESMTPSA id a20-20020a056a000c9400b004f7ab5a44ebsm1885214pfv.18.2022.03.12.03.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Mar 2022 03:04:35 -0800 (PST) Date: Sat, 12 Mar 2022 11:04:30 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: kernel test robot , Oliver Glitta , lkp@lists.01.org, lkp@intel.com, LKML , linux-mm@kvack.org, Mike Rapoport Subject: Re: [mm/slub] ae107fa919: BUG:unable_to_handle_page_fault_for_address Message-ID: References: <20220311145427.GA1227220@odroid> <667d594b-bdad-4082-09d5-7b0587af2ae3@suse.cz> <20220311164600.GA1234616@odroid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 12, 2022 at 10:21:25AM +0100, Vlastimil Babka wrote: > On 3/12/22 02:10, Hyeonggon Yoo wrote: > > On Fri, Mar 11, 2022 at 04:46:00PM +0000, Hyeonggon Yoo wrote: > >> On Fri, Mar 11, 2022 at 04:36:47PM +0100, Vlastimil Babka wrote: > >>> On 3/11/22 15:54, Hyeonggon Yoo wrote: > >>>> On Wed, Mar 09, 2022 at 10:15:31AM +0800, kernel test robot wrote: > >>>>> > >>>>> > >>>>> Greeting, > >>>>> > >>>>> FYI, we noticed the following commit (built with gcc-9): > >>>>> > >>>>> commit: ae107fa91914f098cd54ab77e68f83dd6259e901 ("mm/slub: use stackdepot to save stack trace in objects") > >>>>> https://git.kernel.org/cgit/linux/kernel/git/vbabka/linux.git slub-stackdepot-v3r0 > >>>>> > >>>>> in testcase: boot > >>>>> > >>>>> on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G > >>>>> > >>>>> caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace): > >>>>> > >>>> > >>>> [+Cc Vlastimil and linux-mm] > >>> > >>> Thanks. > >>> lkp folks: it would be nice if I was CC'd automatically on this, it's a > >>> commit from my git tree and with by s-o-b :) > >>> > >>>> I _strongly_ suspect that this is because we don't initialize > >>>> stack_table[i] = NULL when we allocate it from memblock_alloc(). > >>> > >>> No, Mike (CC'd) suggested to drop the array init cycle, because > >>> memblock_alloc would zero the area anyway. > >> > >> Ah, you are right. My mistake. > >> > >>> There has to be a different > >>> reason. Wondering if dmesg contains the stack depot initialization message > >>> at all... > >> > >> I think I found the reason. > >> This is because of CONFIG_SLUB_DEBUG_ON. > >> It can enable debugging without passing boot parameter. > >> > >> if CONFIG_SLUB_DEBUG_ON=y && slub_debug is not passed, we do not call > >> stack_depot_want_early_init(), but the debugging flags are set. > >> > >> And we only call stack_depot_init() later in kmem_cache_create_usercopy(). > >> > >> so it crashed while creating boot cache. > > > > I tested this, and this was the reason. > > It crashed on CONFIG_SLUB_DEBUG_ON=y because stackdepot always assume > > that it was initialized in boot step, or failed > > (stack_depot_disable=true). > > > > But as it didn't even tried to initialize it, stack_table == NULL && > > stack_depot_disable == false. So accessing *(NULL + ) > > Thanks for finding the cause! > ;) > > Ideas? implementing something like kmem_cache_init_early() again? > > I think we could simply make CONFIG_SLUB_DEBUG_ON select/depend on > STACKDEPOT_ALWAYS_INIT? Oh, sounds better. If we make CONFIG_SLUB_DEBUG_ON select STACK_DEPOT_ALWAYS_INIT, that is simple solution. but stackdepot will be initialized on slub_debug=- too. But I think no one will set CONFIG_SLUB_DEBUG_ON=y if not debugging... I don't think making CONFIG_SLUB_DEBUG_ON depend on CONFIG_STACKDEPOT_ALWAYS_INIT is good solution. only KASAN selects it. -- Thank you, You are awesome! Hyeonggon :-)