From patchwork Sat May 6 19:11:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 90792 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1218301vqo; Sat, 6 May 2023 12:26:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ZsQo5Llux0zBvgP9NrsdEB4cVRKjT3Db/GHuZGiaXvRNMlhzcX6UN/ZRuj0pQ5c6HS24U X-Received: by 2002:a17:903:11c6:b0:1ab:16e0:ef5e with SMTP id q6-20020a17090311c600b001ab16e0ef5emr13528277plh.4.1683401175415; Sat, 06 May 2023 12:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683401175; cv=none; d=google.com; s=arc-20160816; b=DfcMPoF5VkF/6LW4aiQQcJeheXMW4kQv1+WiRcC1oNn2TjdRsgIqQpwHejRyeDwJsh GzlaiTnlStB4GwqeS6JYqAeIhxavVmgFEUtd+PpQH9ctc2LIqJGvTjvvEnKd6NqBrUzn v3Yc1zIqnqZc4b6l5vOOt8pFT90MN7vzB6isbKusETbct7TdtRAVFBTzCcaF3wRY5Nun LOCbPL/cMUlEBbmrpvmpnyEykTxjbFWzfXs0/jIGvmoEAuRonlCYHXfQgpOQaK50vamq jAEC90H6VCQpihctNIC/F/53FfmJjKXb4QxPr1dYBEvLDRS0unWJ5WbER+xtAwo1WQdh x3Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:content-transfer-encoding :message-id:subject:cc:to:dkim-signature:dkim-signature:from; bh=/5qxPxJdjuzi5qhtVxwUOhNdmUZonUWqsXS+jNUmuk0=; b=cUHgQecPjC79BCDsCxhJbMOMnUq0lvo2K1jDjgAWW4BtsAWsBZQkzF3cUt8yplEoFG LkKLg5EPQGA+p4Vn813nmlSW4XgeAuWLYike4SXfkEJTFh2+fIqri4afYmxFW0ti+k6r H7el3Yog8XZcb6GC86aRelX3/javymIBz63259CNH0ZsUaLEv8sLEKim+8GlnXQJ0mYV raSE97AhXH5J5tmmet0lfMB6w3+bv+mp1us0v0G76Peoyt2uMtF/6NUNDDDOvZ+2dvr8 u5y5mpp7EeqiBIBvF/bp7RFA846bPNgsRiun0nqVk5GR4mTtw28mEPtr/jjc7yb1/a31 +rtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=glbdR3nQ; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f23-20020a17090ac29700b00246f8b06125si5372364pjt.108.2023.05.06.12.25.57; Sat, 06 May 2023 12:26:15 -0700 (PDT) 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=@linutronix.de header.s=2020 header.b=glbdR3nQ; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjEFTLS (ORCPT + 99 others); Sat, 6 May 2023 15:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjEFTLR (ORCPT ); Sat, 6 May 2023 15:11:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2750F19B3 for ; Sat, 6 May 2023 12:11:16 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683400273; 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; bh=/5qxPxJdjuzi5qhtVxwUOhNdmUZonUWqsXS+jNUmuk0=; b=glbdR3nQy0v0FmLLwbJPzJIr/nC8Ko4NHF3xbdxGHAbLZqP/SjinMYpsXgaHt2WXRPM6IQ AdZXWxogLrUI0phpw71gTb7vlVQDYbEhaWDV39mqE861xiV/bRInlBfZquJowH9+NEkdsZ 2t+1cJSpoTUhqgoyw0oCIi9x+259iE+iz3NEkKHMsqZwW5ZVLwjzwDupdUgCJZeC16y+nV wCoHrimKSWsPZlsPMZzMq7ySnVbulJXJVgsDHGWwj2a/hTuCC7bGfA8Wc7GxuwhDUlYDHT BMKFM8/g8HqU7d0Q0T56XATQaqyk7F2+SEjOj63dQFUl5cbe0c+zJr8pE4BCoQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683400273; 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; bh=/5qxPxJdjuzi5qhtVxwUOhNdmUZonUWqsXS+jNUmuk0=; b=QJBJMPLk0h6VCOZ4WHml9TEXWtpTP0e1JLuMsBr6EbUsF9qO8GtSNASEW7ev8tZ1+z/Yuw Xd1u6PpZFk97YsDA== To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: [GIT pull] core/debugobjects for v6.4-rc1 Message-ID: <168340025919.2105360.9722828595496474732.tglx@xen13> MIME-Version: 1.0 Date: Sat, 6 May 2023 21:11:13 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765174070973591153?= X-GMAIL-MSGID: =?utf-8?q?1765174070973591153?= Linus, please pull the latest core/debugobjects branch from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-debugobjects-2023-05-06 up to: 0af462f19e63: debugobject: Ensure pool refill (again) A single fix for debugobjects: The recent fix to ensure atomicity of lookup and allocation inadvertently broke the pool refill mechanism, so that debugobject OOMs now in certain situations. The reason is that the functions which got updated no longer invoke debug_objecs_init(), which is now the only place to care about refilling the tracking object pool. Restore the original behaviour by adding explicit refill opportunities to those places. Thanks, tglx ------------------> Thomas Gleixner (1): debugobject: Ensure pool refill (again) lib/debugobjects.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index b796799fadb2..003edc5ebd67 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -587,6 +587,16 @@ static struct debug_obj *lookup_object_or_alloc(void *addr, struct debug_bucket return NULL; } +static void debug_objects_fill_pool(void) +{ + /* + * On RT enabled kernels the pool refill must happen in preemptible + * context: + */ + if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible()) + fill_pool(); +} + static void __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack) { @@ -595,12 +605,7 @@ __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack struct debug_obj *obj; unsigned long flags; - /* - * On RT enabled kernels the pool refill must happen in preemptible - * context: - */ - if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible()) - fill_pool(); + debug_objects_fill_pool(); db = get_bucket((unsigned long) addr); @@ -685,6 +690,8 @@ int debug_object_activate(void *addr, const struct debug_obj_descr *descr) if (!debug_objects_enabled) return 0; + debug_objects_fill_pool(); + db = get_bucket((unsigned long) addr); raw_spin_lock_irqsave(&db->lock, flags); @@ -894,6 +901,8 @@ void debug_object_assert_init(void *addr, const struct debug_obj_descr *descr) if (!debug_objects_enabled) return; + debug_objects_fill_pool(); + db = get_bucket((unsigned long) addr); raw_spin_lock_irqsave(&db->lock, flags);