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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CCF7C433EF for ; Sat, 12 Mar 2022 09:22:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231626AbiCLJXi (ORCPT ); Sat, 12 Mar 2022 04:23:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231218AbiCLJXg (ORCPT ); Sat, 12 Mar 2022 04:23:36 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FF91264832 for ; Sat, 12 Mar 2022 01:22:31 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C049521115; Sat, 12 Mar 2022 09:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1647076948; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vGJCc13UG0K1VbfEUqQBOawVmyBeZkeKPtFXK/dmfXw=; b=nPLA+jwbqemdF0yMl+jHAT0VKgcAXBHMAkZ84hPxVc4OvBhDNj+s/mGJg8jARMPaKPkyvH OmfDuMK/6xDAyjD39sQlPT/jGB2/QXZO3vp1ksQJNfHhFqbdRdwBasL4GTuKzuqDMQDrXb m+LG8iK+Ot1NzBusXxWhdhwKcRr2dp4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1647076948; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vGJCc13UG0K1VbfEUqQBOawVmyBeZkeKPtFXK/dmfXw=; b=xFWVrnxWNVuQFS/8TqdWuVXxNVm3Y5ZrhrhTIYg95u8H6Er6hrCGc+LbAKhkixy5WpAbEx Gzrh16XYYW2iQ2Cg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8CC3E13AB1; Sat, 12 Mar 2022 09:22:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id x+7DIFRmLGKsPwAAMHmgww (envelope-from ); Sat, 12 Mar 2022 09:22:28 +0000 Message-ID: Date: Sat, 12 Mar 2022 10:21:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [mm/slub] ae107fa919: BUG:unable_to_handle_page_fault_for_address Content-Language: en-US To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: kernel test robot , Oliver Glitta , lkp@lists.01.org, lkp@intel.com, LKML , linux-mm@kvack.org, Mike Rapoport References: <20220311145427.GA1227220@odroid> <667d594b-bdad-4082-09d5-7b0587af2ae3@suse.cz> <20220311164600.GA1234616@odroid> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0293869502252042599==" MIME-Version: 1.0 From: Vlastimil Babka To: lkp@lists.01.org Subject: Re: [mm/slub] ae107fa919: BUG:unable_to_handle_page_fault_for_address Date: Sat, 12 Mar 2022 10:21:25 +0100 Message-ID: In-Reply-To: List-Id: --===============0293869502252042599== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 stack= depot to save stack trace in objects") >>>>> https://git.kernel.org/cgit/linux/kernel/git/vbabka/linux.git slub-st= ackdepot-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] =3D 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 mess= age >>> 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=3Dy && 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=3Dy because stackdepot always assume > that it was initialized in boot step, or failed > (stack_depot_disable=3Dtrue). > = > But as it didn't even tried to initialize it, stack_table =3D=3D NULL && > stack_depot_disable =3D=3D 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? --===============0293869502252042599==--