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 X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 913E3C4338F for ; Fri, 13 Aug 2021 08:12:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7267860FC0 for ; Fri, 13 Aug 2021 08:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239793AbhHMIMh (ORCPT ); Fri, 13 Aug 2021 04:12:37 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:35452 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239784AbhHMIMg (ORCPT ); Fri, 13 Aug 2021 04:12:36 -0400 Date: Fri, 13 Aug 2021 08:12:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628842329; h=from:from:sender:sender:reply-to: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=kiGssYmJWifNSL0LTgOD5QX+8xwLadt3DKw2Hxa10IQ=; b=26TJiJuZAljXXPIv0E/MvMlxsEV+H0jhbMhpgXONGfnAtYYv4gOAEWzPafTajMefYs5hci F3ato2u/bSKJwlGOLK8gXcUed32i1OaiN1NLlETse49T12lnoUxqHyX9FrnVxidbDKFM0s lwB8vsbVzGc/4BQN9TZDORzZVmd3Z1Ri26wmn3qV354mjxz95Um+WPRoDQ6kGT/rOREYgA k3J2Wjin/F09soxIo4yhVrBqeaAX2AeHhha+VZ/LGpBv4/U2ppoJWBBKqK7QJa8RvRrJ68 pjwocZAE0uZFIbKzMtuj1QfDcWtHQZqdiwzlJ2C4ioQxHFBJhHnRYk31eS0Fzw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628842329; h=from:from:sender:sender:reply-to: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=kiGssYmJWifNSL0LTgOD5QX+8xwLadt3DKw2Hxa10IQ=; b=GPKuvd7qq01jpkcJd838iJukEAiEJhUpAWuWjRxU55NcPuxEhxhhWXsEVORKI5yMGlfAgh Maepe4bZl75yiqCg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/debugobjects] debugobjects: Make them PREEMPT_RT aware Cc: Thomas Gleixner , Sebastian Andrzej Siewior , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <87sfzehdnl.ffs@tglx> References: <87sfzehdnl.ffs@tglx> MIME-Version: 1.0 Message-ID: <162884232829.395.5057138139418300894.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the core/debugobjects branch of tip: Commit-ID: 4bedcc28469a24fe481a8a31b3584e6070457ddb Gitweb: https://git.kernel.org/tip/4bedcc28469a24fe481a8a31b3584e6070457ddb Author: Thomas Gleixner AuthorDate: Thu, 12 Aug 2021 17:43:26 +02:00 Committer: Thomas Gleixner CommitterDate: Fri, 13 Aug 2021 10:07:44 +02:00 debugobjects: Make them PREEMPT_RT aware On PREEMPT_RT enabled kernels it is not possible to refill the object pool from atomic context (preemption or interrupts disabled) as the allocator might acquire 'sleeping' spinlocks. Guard the invocation of fill_pool() accordingly. Signed-off-by: Thomas Gleixner Tested-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/87sfzehdnl.ffs@tglx --- lib/debugobjects.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 9e14ae0..6946f8e 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -557,7 +557,12 @@ __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack struct debug_obj *obj; unsigned long flags; - fill_pool(); + /* + * On RT enabled kernels the pool refill must happen in preemptible + * context: + */ + if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible()) + fill_pool(); db = get_bucket((unsigned long) addr);