From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14DAB36F427 for ; Mon, 9 Feb 2026 11:39:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770637147; cv=none; b=sKpO0VBgl4ZTNGnxUIdl+rqzRYusp68F5S36Y1rU+H5ptqko9kRtm01FT6S2RheXpW30DzFhTa7xk9eAFV2JH/25bRJw8VopCUKSsLYE5gJfy7w5PbJ/5AE08GHT9KzEZRDtbNqUDcJ7YH+BWJd4JGOWOC4Jwptyr5mwB0MUreI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770637147; c=relaxed/simple; bh=c20C/yCmcuCW/JF2A251VXBxkZi1O0fBlfo9yVky90U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YqQbllodyuIVV16uO0SdWYfaW4wzZxmjkryPNf71lsxljd9FMimQboEwnG6TeKbpsxOrhFBSATMx7SYENoDzryGSCpbC2aOXZKy9q2FHulPPeS4F0cxefhxKNN9vws4fOnwR48LAhJl3tSfc7XH/4nmf3lEcTXF7NxI/TBQ7uFw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=ekM7qRVy; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Y1hJK+Jg; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=ns+uZb2h; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=9Yd0ENmj; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ekM7qRVy"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Y1hJK+Jg"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="ns+uZb2h"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="9Yd0ENmj" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2B7423E6F5; Mon, 9 Feb 2026 11:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1770637145; 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:autocrypt:autocrypt; bh=ToxBEdItQKpoHU1ZARpjASVHuw3Uk9MwufWB/gn0SsY=; b=ekM7qRVygLfvvzfoQ6cBymPaiXZuaJhyychAahGL4CMrkJT9bWOzwQt1M7deAQzBvLDoRQ TkW/yvi5MW9PGzVbMnocaG+4mQ140xn7fHBCkA4CcIwjXqqfuAsMAVYKQbnLZrLcufedbX gC/T6/rVbNJRb9rEqaHY6A0v5CBQw4Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1770637145; 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:autocrypt:autocrypt; bh=ToxBEdItQKpoHU1ZARpjASVHuw3Uk9MwufWB/gn0SsY=; b=Y1hJK+JgXQ27mz8+belJ1wnK9l0rUtHMoX/jkqYXGAOZ3qz+e5UMG5BCQt4CvOyqgGAmoR anCG/1tW0aPKYFAA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1770637144; 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:autocrypt:autocrypt; bh=ToxBEdItQKpoHU1ZARpjASVHuw3Uk9MwufWB/gn0SsY=; b=ns+uZb2hbfaEFRoGg4OsvNqYu1pT4me1AXoLUpNmu1az0vRAuMHzoHMZa9PoDneLKLs5nW MWmy3pX5uPVxuXsYZKAL6ddI0OzciRQiIPobDm7+If8qB9resoiD3jDUkQFTDTBiFW2vHw 9fE11y1iteZSfCcC8lvaITw8vhLK4O0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1770637144; 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:autocrypt:autocrypt; bh=ToxBEdItQKpoHU1ZARpjASVHuw3Uk9MwufWB/gn0SsY=; b=9Yd0ENmjTur2CoccmtvN1JXUmZCLvZOddhjrVyamQnhGQ82Sp9ao6MfPY+crT1Rp5PI5xq 4yNfz0qzHs/4eRDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0D5A13EA63; Mon, 9 Feb 2026 11:39:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id JfzoAljHiWl2AgAAD6G6ig (envelope-from ); Mon, 09 Feb 2026 11:39:04 +0000 Message-ID: Date: Mon, 9 Feb 2026 12:39:03 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: debugobject: Make it work with deferred page initialization - again Content-Language: en-US To: Thomas Gleixner , LKML Cc: Peter Zijlstra , Alexei Starovoitov , linux-mm@vger.kernel.org References: <87pl6gznti.ffs@tglx> From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; keydata= xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+ 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv BB2T79D4WGdDuV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dF26dMP69BwePQao1M8Acrrex9sAHYjQGyVmReRjVEtv9iG4DoTsnIR3amKVk6si4Ea X/mrapJqSCcBUVYUFH8M7bsm4CSxier5ofy8jTEa/CfvkqpKThTMCQPNZKY7hke5qEq1CBk2 wxhX48ZrJEFf1v3NuV3OimgsF2odzieNABEBAAHCwXwEGAEKACYCGwwWIQSpQNQ0mSwujpkQ PVAiT6fnzIKmZAUCZ8gcVAUJFhTonwAKCRAiT6fnzIKmZLY8D/9uo3Ut9yi2YCuASWxr7QQZ lJCViArjymbxYB5NdOeC50/0gnhK4pgdHlE2MdwF6o34x7TPFGpjNFvycZqccSQPJ/gibwNA zx3q9vJT4Vw+YbiyS53iSBLXMweeVV1Jd9IjAoL+EqB0cbxoFXvnjkvP1foiiF5r73jCd4PR rD+GoX5BZ7AZmFYmuJYBm28STM2NA6LhT0X+2su16f/HtummENKcMwom0hNu3MBNPUOrujtW khQrWcJNAAsy4yMoJ2Lw51T/5X5Hc7jQ9da9fyqu+phqlVtn70qpPvgWy4HRhr25fCAEXZDp xG4RNmTm+pqorHOqhBkI7wA7P/nyPo7ZEc3L+ZkQ37u0nlOyrjbNUniPGxPxv1imVq8IyycG AN5FaFxtiELK22gvudghLJaDiRBhn8/AhXc642/Z/yIpizE2xG4KU4AXzb6C+o7LX/WmmsWP Ly6jamSg6tvrdo4/e87lUedEqCtrp2o1xpn5zongf6cQkaLZKQcBQnPmgHO5OG8+50u88D9I rywqgzTUhHFKKF6/9L/lYtrNcHU8Z6Y4Ju/MLUiNYkmtrGIMnkjKCiRqlRrZE/v5YFHbayRD dJKXobXTtCBYpLJM4ZYRpGZXne/FAtWNe4KbNJJqxMvrTOrnIatPj8NhBVI0RSJRsbilh6TE m6M14QORSWTLRg== In-Reply-To: <87pl6gznti.ffs@tglx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -4.30 X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] X-Spam-Level: X-Spam-Flag: NO On 2/7/26 14:27, Thomas Gleixner wrote: > debugobjects uses __GFP_HIGH for allocations as it might be invoked > within locked regions. That worked perfectly fine until v6.18. It still > works correctly when deferred page initialization is disabled and works > by chance when no page allocation is required before deferred page > initialization has completed. > > Since v6.18 allocations w/o a reclaim flag cause new_slab() to end up in > alloc_frozen_pages_nolock_noprof(), which returns early when deferred > page initialization has not yet completed. As the deferred page > initialization takes quite a while the debugobject pool is depleted and > debugobjects are disabled. > > This can be worked around when PREEMPT_COUNT is enabled as that allows > debugobjects to add __GFP_KSWAPD_RECLAIM to the GFP flags when the context > is preemtible. When PREEMPT_COUNT is disabled the context is unknown and > the reclaim bit can't be set because the caller might hold locks which > might deadlock in the allocator. > > In preemptible context the reclaim bit is harmless and not a performance > issue as that's usually invoked from slow path initialization context. > > That makes debugobjects depend on PREEMPT_COUNT || !DEFERRED_STRUCT_PAGE_INIT. > > Fixes: af92793e52c3 ("slab: Introduce kmalloc_nolock() and kfree_nolock().") > Signed-off-by: Thomas Gleixner Acked-by: Vlastimil Babka > --- > lib/Kconfig.debug | 1 + > lib/debugobjects.c | 19 ++++++++++++++++++- > 2 files changed, 19 insertions(+), 1 deletion(-) > > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -753,6 +753,7 @@ source "mm/Kconfig.debug" > > config DEBUG_OBJECTS > bool "Debug object operations" > + depends on PREEMPT_COUNT || !DEFERRED_STRUCT_PAGE_INIT > depends on DEBUG_KERNEL > help > If you say Y here, additional code will be inserted into the > --- a/lib/debugobjects.c > +++ b/lib/debugobjects.c > @@ -398,9 +398,26 @@ static void fill_pool(void) > > atomic_inc(&cpus_allocating); > while (pool_should_refill(&pool_global)) { > + gfp_t gfp = __GFP_HIGH | __GFP_NOWARN; > HLIST_HEAD(head); > > - if (!kmem_alloc_batch(&head, obj_cache, __GFP_HIGH | __GFP_NOWARN)) > + /* > + * Allow reclaim only in preemptible context and during > + * early boot. If not preemptible, the caller might hold > + * locks causing a deadlock in the allocator. > + * > + * If the reclaim flag is not set during early boot then > + * allocations, which happen before deferred page > + * initialization has completed, will fail. > + * > + * In preemptible context the flag is harmless and not a > + * performance issue as that's usually invoked from slow > + * path initialization context. > + */ > + if (preemptible() || system_state < SYSTEM_SCHEDULING) > + gfp |= __GFP_KSWAPD_RECLAIM; > + > + if (!kmem_alloc_batch(&head, obj_cache, gfp)) > break; > > guard(raw_spinlock_irqsave)(&pool_lock);