Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp502289pxb; Fri, 15 Oct 2021 09:50:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAuvOXLfvH5n2gYiFrhFGRPoHjX745dS83PF6rwPP79PDxLBJ+aMfjTLRoXRp9LDZU2EUQ X-Received: by 2002:a17:906:4a09:: with SMTP id w9mr8066059eju.419.1634316610971; Fri, 15 Oct 2021 09:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634316610; cv=none; d=google.com; s=arc-20160816; b=ZfWk5EAxyKQ4l5Io1GwEWJfsUVdlFmUinCdHCsdnOyw3wv1E4vb7fvvXlQYBegK+rS AI2kaEkgDTTckDriif2gTzqje+zDoE9jrO+qAnzSnGR9zRYncrAXjY73i1T6vHMnX+gh 8oUcZBwL4TStQK/eJ4vTipX/bYPhC5le/Z92B6gxipltQidLweuXFITKcZyzsN94lc/a mzoKo2BEjq+p83W6juy4y1n1mUJ0NBE/reevomqAK0lL0ovA+4mOIV36sEQNpvlgf5ek YtGy9pGQuGGKy2Na6IoOB9ZXDSMksCWYJ9DdvWfp2xbkf5PsZDTLIG2FoIYDe80TvTBn YAmg== 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=/ttHx/rEjYBoqUkZIaGtEXyDLWjP5Qm04VJxdL79k80=; b=qdglxO7Wc9p2IQ47FNm4hqpusk1Ssswe6zrPIiB8RAm8aHrbKJfoQK4jz0AHGBraI9 w1ZfOAHm5tg5b+SCdmVDxvphvT4fHkKVDaGu3MHnVkIbZF9uePHh2Sc9EoKWQq063Hpw gnpVOi/Go3Wc+1mkTNUqv+bGnhsfD3BZxwhHMw+uO6RZ1FgsYx7D08dGUv7YMK5kPOt8 /SKgeJjSx8ji1eIAcSZjYXbHtaXpgN1bBLRn/sE0CquB9NZqF8mk6osRoCw7lHjiHVKG rZEmTB0zR8IFh2FHc/OnBj157DtNHNafid3GlALyPACr9x17LMsoblzk6AMCkmC90fOY xGJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uHWFxjgN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si8809663ejl.293.2021.10.15.09.49.47; Fri, 15 Oct 2021 09:50:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uHWFxjgN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233345AbhJOI6Y (ORCPT + 99 others); Fri, 15 Oct 2021 04:58:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:49938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233419AbhJOI6Q (ORCPT ); Fri, 15 Oct 2021 04:58:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BAD2E61053; Fri, 15 Oct 2021 08:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634288170; bh=Q7ariDqv81ESrlC2dW0PuAyGJAandYcqDaiSNHfbxQQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uHWFxjgN0j6uy54kk+PuKWsQXZAravsfZY8pZKixqTo8/t9859egP1Fzz/r/UFP3j pKRuamEiuY/Dwc/+QpnfWTf/sWNNfhMwZbVWxVfub1kH4CRYdWRn5CQYjdbgLCac9o sh7ORqtEfm9q5AKGtzFZlP/kLNO/R2oFHLN3PRlxsXtO7/HYTzofgjq4C072XXT9lh KbGmTC7vqWacVxEn3eNhUgZ/EA7McQ1YvxSRGhlsTVouHPeADKh3UBp0IaceH36bIf Y9c+6PGwmjdmSCJ0ZadDxaYmKgTuJ65zPH3wNm8vQE6+zKn5B8ls+d97XXK85PZn9u zx39wdy59p99g== Date: Fri, 15 Oct 2021 11:55:58 +0300 From: Mike Rapoport To: Vlastimil Babka Cc: kernel test robot , 0day robot , Dmitry Vyukov , Marco Elver , Vijayanand Jitta , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Geert Uytterhoeven , Oliver Glitta , Imran Khan , LKML , lkp@lists.01.org, Andrew Morton , linux-mm@kvack.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kasan-dev@googlegroups.com Subject: Re: [lib/stackdepot] 1cd8ce52c5: BUG:unable_to_handle_page_fault_for_address Message-ID: References: <20211014085450.GC18719@xsang-OptiPlex-9020> <4d99add1-5cf7-c608-a131-18959b85e5dc@suse.cz> <137e4211-266f-bdb3-6830-e101c27c3be4@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <137e4211-266f-bdb3-6830-e101c27c3be4@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 15, 2021 at 10:27:17AM +0200, Vlastimil Babka wrote: > On 10/14/21 12:16, Mike Rapoport wrote: > > On Thu, Oct 14, 2021 at 11:33:03AM +0200, Vlastimil Babka wrote: > >> On 10/14/21 10:54, kernel test robot wrote: > >> > >> In my local testing of the patch, when stackdepot was initialized through > >> page owner init, it was using kvmalloc() so slab_is_available() was true. > >> Looks like the exact order of slab vs page_owner alloc is non-deterministic, > >> could be arch-dependent or just random ordering of init calls. A wrong order > >> will exploit the apparent fact that slab_is_available() is not a good > >> indicator of using memblock vs page allocator, and we would need a better one. > >> Thoughts? > > > > The order of slab vs page_owner is deterministic, but it is different for > > FLATMEM and SPARSEMEM. And page_ext_init_flatmem_late() that initializes > > page_ext for FLATMEM is called exactly between buddy and slab setup: > > Oh, so it was due to FLATMEM, thanks for figuring that out! > > > static void __init mm_init(void) > > { > > ... > > > > mem_init(); > > mem_init_print_info(); > > /* page_owner must be initialized after buddy is ready */ > > page_ext_init_flatmem_late(); > > kmem_cache_init(); > > > > ... > > } > > > > I've stared for a while at page_ext init and it seems that the > > page_ext_init_flatmem_late() can be simply dropped because there is anyway > > a call to invoke_init_callbacks() in page_ext_init() that is called much > > later in the boot process. > > Yeah, but page_ext_init() only does something for SPARSEMEM, and is empty on > FLATMEM. Otherwise it would be duplicating all the work. So I'll just move > page_ext_init_flatmem_late() below kmem_cache_init() in mm_init(). I hope at some point we'll have cleaner mm_init(), but for now simply moving page_ext_init_flatmem_late() should work. > Thanks again! Welcome :) -- Sincerely yours, Mike.