Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1156831pxp; Sat, 12 Mar 2022 03:20:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7ADXnuB+HJ+00yxVL+4Rbcjob7z+zSJNcwpihcgFuj0RLq0+FwadXQeO8Llb/iEEOdVQh X-Received: by 2002:a05:6402:5193:b0:416:b3bf:23c3 with SMTP id q19-20020a056402519300b00416b3bf23c3mr11029184edd.163.1647084052374; Sat, 12 Mar 2022 03:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647084052; cv=none; d=google.com; s=arc-20160816; b=n+VZk4tzlyWVjc5oV3+/Rx4Vy6nP3n0ptEcHpzucBRPqZ3kj0qAkkRhiKTfbJgjSxL /XEpkGupqIPwjvRgUoB0cE11xudkeseGbpIVe17RYKnbeC4ZUP2yVBPKdqyQUqu81sOJ XDt8orOnoRercRtLuB2t8FQAUiF7T5kixtTchjFsZOfUKVnP+f4ISn/U3od1Q6+JtNmi 9QnmLHStbyVgNj9moIG0JdkAnzRLT2DJ5534QYn8bUH74rHRXXian832Co3Fi2R4fP6v OEN48RohmJvqtPzQhRuzzWYQzoiGjUw39h+drTfeZUrUNlqo/JJcypkdcCnD4AaLY+am yC9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=vGJCc13UG0K1VbfEUqQBOawVmyBeZkeKPtFXK/dmfXw=; b=tMpzbuNI9dNUcZpKnAAKV0Fq0xMFizIc8gl9vVr6FyyehTKGMd5Lt7A2FqCPL/6kP2 +RTLsNPHLCQkX+CCl3CRWvIjru3fi2Z56IMpFS+P2fXrIJJ+4vE8KMrek4CpUfMprTVm kBiTT7sdVA7jbcFGH1MqTwphTuGlby/0Tg1MF5qJm4NnFV58HL7+S9qP/FJSeunOpRE5 3laUNi4FNCRfH2hl1zQCwupKqxe2+yyfa/Lqr6eVJ4qN3B6Mx8tX0qvJZ8HgqeaEgFFu SUQkv50FOfHJ2UbFRQCR1eaeT7egpX/j4oCemwaxFjNik7bVDxA8fLcJIrNsDZPixujP 7A3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=nPLA+jwb; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=xFWVrnxW; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp36-20020a1709073e2400b006da7ac9c4c5si6599291ejc.427.2022.03.12.03.20.27; Sat, 12 Mar 2022 03:20:52 -0800 (PST) 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=@suse.cz header.s=susede2_rsa header.b=nPLA+jwb; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=xFWVrnxW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231622AbiCLJXh (ORCPT + 99 others); Sat, 12 Mar 2022 04:23:37 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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?