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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BF80C433EF for ; Sat, 12 Mar 2022 09:22:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E0DE8D0002; Sat, 12 Mar 2022 04:22:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 890488D0001; Sat, 12 Mar 2022 04:22:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 730CA8D0002; Sat, 12 Mar 2022 04:22:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 6338C8D0001 for ; Sat, 12 Mar 2022 04:22:31 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1C7E6251F9 for ; Sat, 12 Mar 2022 09:22:31 +0000 (UTC) X-FDA: 79235193702.06.1D2E888 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf07.hostedemail.com (Postfix) with ESMTP id 5267540025 for ; Sat, 12 Mar 2022 09:22:30 +0000 (UTC) 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 X-Rspam-User: X-Rspamd-Queue-Id: 5267540025 X-Stat-Signature: zp6p4zbaxd6p3fqc8ftm3ftmfnpx4tux Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nPLA+jwb; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=xFWVrnxW; dmarc=none; spf=pass (imf07.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam03 X-HE-Tag: 1647076950-803072 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?