From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1A2A30DEA5 for ; Mon, 8 Jun 2026 02:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780885328; cv=none; b=ifb1V89xNXQ8Zzuls1+9svNm3kSs52AWbnjPTxbn9dTnHY7p9xakJfBe3GrxlPjJlDJzAqb/WA2pL688cn6VzjkTfL31QFqKBPi44KqyFWQYvgRlNgjjTtJr2tSoj/UosIdX3vSb+TXgS4LyiaaMfF5giZDoth5tFT1kvjB1tAw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780885328; c=relaxed/simple; bh=yBcwxfno4nWAj3Uj7ltcBVg4Xsp9mT+NJrtHENWbaH0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MSHxchC9bxvUw334WefhESVDVxSR7PxaRAZjzgRAVZTBV0A160fcvdpKyyboUIYEXyaNmB8BA/xQD1+Ie/kXcuxGdBb5JNBKHPyyUULBICzozUr+1etm6GuZTc8sLQIB/67djCxW6YNdaEtunZTIxQ3uAFZ8l7oZPgPaMB0Hfo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=br2u3B7R; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="br2u3B7R" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780885325; h=from:from:reply-to:subject:subject: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=SVpugBYUPu/REUSH123I3T+dvBgdgeTreN5r26Hty7U=; b=br2u3B7RePdqae+ZIDQHlLZ/p2k1RSGy/N2kyovHWgRZl4Uz9t0IbEM8b2NICNU1zu2uqC EanS6OLM2UPsQUurMwDMu30esNY/FYlDeKVJCp801I6XyGq9wHBpElz1XgubqVO+AdFUtd rqFdFlRSKAnnZx0VfUPtIjWB67L2/PQ= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-37-y_SAc3oOMOuEz221GkN_Og-1; Sun, 07 Jun 2026 22:22:02 -0400 X-MC-Unique: y_SAc3oOMOuEz221GkN_Og-1 X-Mimecast-MFC-AGG-ID: y_SAc3oOMOuEz221GkN_Og_1780885320 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DFAB0180034B; Mon, 8 Jun 2026 02:21:59 +0000 (UTC) Received: from [10.22.88.52] (unknown [10.22.88.52]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4655330001BE; Mon, 8 Jun 2026 02:21:58 +0000 (UTC) Message-ID: <445b741f-c36e-4b20-ab0a-4a2215489eba@redhat.com> Date: Sun, 7 Jun 2026 22:21:57 -0400 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: [PATCH v5] debugobjects: Don't call fill_pool() in early boot hardirq context To: Ingo Molnar Cc: Thomas Gleixner , Andrew Morton , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev References: <20260605173038.495075-1-longman@redhat.com> Content-Language: en-US From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On 6/7/26 1:15 AM, Ingo Molnar wrote: > * Waiman Long wrote: > >> When booting a debug PREEMPT_RT kernel on an arm64 system with grace >> processor, a "inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage" >> lockdep warning message was reported to the console. >> >> During early boot, interrupts are getting enabled before the scheduler >> is enabled. In this window (before SYSTEM_SCHEDULING is set) interrupts >> can fire and attempt to fill the pool from within the hardirq. This can >> lead to a deadlock the interrupt occurred while in the memory allocator. >> >> Add a new can_fill_pool() helper and reorder the exception rule and >> forbid this scenario by excluding allocations from hardirq. >> >> Fixes: 06e0ae988f6e ("debugobjects: Allow to refill the pool before SYSTEM_SCHEDULING") >> Co-developed-by: Waiman Long >> Co-developed-by: Sebastian Andrzej Siewior >> Co-developed-by: Thomas Gleixner >> Reviewed-by: Sebastian Andrzej Siewior >> Signed-off-by: Waiman Long >> --- >> lib/debugobjects.c | 46 +++++++++++++++++++++++++++++++++++++--------- >> 1 file changed, 37 insertions(+), 9 deletions(-) >> >> diff --git a/lib/debugobjects.c b/lib/debugobjects.c >> index b18a682fe3da..6fb00e08a4e2 100644 >> --- a/lib/debugobjects.c >> +++ b/lib/debugobjects.c >> @@ -720,6 +720,41 @@ static inline bool debug_objects_is_pi_blocked_on(void) >> #endif >> } >> >> +static inline bool can_fill_pool(void) >> +{ >> + /* >> + * On !RT enabled kernels there are no restrictions and spinlock_t and >> + * raw_spinlock_t are the same types. >> + */ >> + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) >> + return true; >> - if (!IS_ENABLED(CONFIG_PREEMPT_RT) || system_state < SYSTEM_SCHEDULING || >> - (preemptible() && !debug_objects_is_pi_blocked_on())) { >> + if (can_fill_pool()) { > Would have been nice to have this as two patches: first one > factors out the check into can_fill_pool() without changing the > logic, while the second one applies the fix to can_fill_pool(). OK, I will send a v6 patch as suggested. However, Thomas had merged the v5 patch into tip. I am fine whether it will be one patch or 2 as long as the problem is going to be fixed. Cheers, Longman