From patchwork Wed Sep 13 10:16:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 138766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp1036060vqx; Wed, 13 Sep 2023 05:08:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6ZE0mtbOw1029Ukv8FA0rYHSAL9xqmqlAWZO3M37kkrWOBgGaKusiVzF1yxXx1Xp247uD X-Received: by 2002:a05:6870:8320:b0:1c8:39a6:779e with SMTP id p32-20020a056870832000b001c839a6779emr2728155oae.19.1694606897834; Wed, 13 Sep 2023 05:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694606897; cv=none; d=google.com; s=arc-20160816; b=w2ES/wKI6slE9Ux5Cq4f9c32I5/G9Eac1UQBHP6tZXqz/yUMG4/DWD9+AtCytUIYrf g+CKszxJ68p+jdR9HHzPSOaZ+DI40oQ8JNHjel4M1dsrLRhPqQ0bqjLCTcEkimYFrrEb g3xHp7n89vUasPBv5khau8Yb0wTNvZ3NiCY8u/vcDLa7jA8A71EbT9Khw/hdzPnlt+gC XaM5f8F+ZNf7IYuBILt96njT0JnsHDRoDwvL64fPGdl28CBxZQKBnDE2l240nVqluX+x 1utOfsoO3hFzYUP8Qh0LrGhJzoX6Q5aExjs46iHKaLnoe7MdZ17SvmpUav3TC7qhcLR2 fv0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:dkim-signature:dkim-signature:from; bh=lsQkFEGOfI0iTMla2oxJpk+1VZ0aBz8IS1SfHikhG0E=; fh=Q/pZN5aiwUNXyTq80PuHgQq+tzfjGLDO4yt31hgYY64=; b=Ed97bvizTtdUjN92eysvyiBRbcg5PS0NQSM4qALcdrbVoMS8TOMGNYU5tuNK76as79 DaaurHPQfzcrjKsw5aUogftRGPCnEqCRANGGiX1hSw65mQTQ3aSkXt2E4Pf9d/BOUJH7 nLdn5wAha5XPSGty3pVw33mNknnoFlVXSwo68crXhDtfbzI+Ld4TxVZ860v0hMAzqlMW btf/xa9kmWUbq866+/u+bjm7jHEv/d6HQHDhVTEH93qsNEkUqsLjPMERC8+nwGwFbY0c BSM8SWP89OwgfhbVrzgxSxcs8F5mJr3ATsaMqAnGSYc3U21y0+IxlW90ACLegAVnNyIH mW1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4L5tv09n; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id h190-20020a6383c7000000b0057777451a5csi5276833pge.374.2023.09.13.05.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 05:08:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4L5tv09n; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 46867811F24D; Wed, 13 Sep 2023 03:16:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239633AbjIMKQo (ORCPT + 36 others); Wed, 13 Sep 2023 06:16:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239605AbjIMKQn (ORCPT ); Wed, 13 Sep 2023 06:16:43 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E188A19B2 for ; Wed, 13 Sep 2023 03:16:39 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694600197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=lsQkFEGOfI0iTMla2oxJpk+1VZ0aBz8IS1SfHikhG0E=; b=4L5tv09nLX3TJ+ucf5Vl8nfFx/rchv6fs+fjF1lAuHkOo3sohpiw/pRxnvo3Ryvqmm7yHy NEwMxI8yU8lr6C/XcBju/cxzFHyEecK6G4E3YiDccsk3dVWT9DyTKznqy+nGCZeDcu+AX3 itfu9KbPHEkweSxV1wNqIFHoThOINyIl4LNfVZNT97Lrm1pJHE1zIG7o/Ho4ogRoPG6P/U AJT6HODJeUqz5nmueIA/cSu+SoT51W1P3hRaSLbIybjdT9IraDNUrIRJV4WB8YiNb6Uu4c BKA2n5G78NzXR07crYDb1ev0CbXMPR1UuIArTVQgUI4oWI4gyVrTHMveCkV7qw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694600197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=lsQkFEGOfI0iTMla2oxJpk+1VZ0aBz8IS1SfHikhG0E=; b=8h3cVqiGAikaWSGmo0PhID5kItFlKCihsyQpwglmRlXZplOk86n/4rCwnhJbuDJ8H97VMf 5dpbqxEsnLHcqnDA== To: Tejun Heo Cc: Lai Jiangshan , linux-kernel@vger.kernel.org Subject: [PATCH] workqueue: fix duplicate wq_update_pod_attrs_buf allocation Date: Wed, 13 Sep 2023 12:22:34 +0206 Message-Id: <20230913101634.553699-1-john.ogness@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Sep 2023 03:16:54 -0700 (PDT) X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776924122732180724 X-GMAIL-MSGID: 1776924122732180724 One of the hunks for the patch resulting in commit 84193c07105c ("workqueue: Generalize unbound CPU pods") was applied incorrectly. This resulted in @wq_update_pod_attrs_buf being allocated twice. From the kmemleak detector: unreferenced object 0xc0000000040074c0 (size 64): comm "swapper/0", pid 0, jiffies 4294937296 (age 1936.580s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<0000000076b83a6e>] .kmalloc_trace+0x54/0x190 [<00000000898f2356>] .alloc_workqueue_attrs+0x2c/0x60 [<0000000063365e1f>] .workqueue_init_early+0xe4/0x4b8 [<00000000ca97ff39>] .start_kernel+0x8d0/0xba4 [<000000002ee12080>] start_here_common+0x1c/0x20 Remove the redundant allocation. Signed-off-by: John Ogness --- kernel/workqueue.c | 3 --- 1 file changed, 3 deletions(-) base-commit: 3669558bdf354cd352be955ef2764cde6a9bf5ec diff --git a/kernel/workqueue.c b/kernel/workqueue.c index c85825e17df8..43ab8399b72b 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -6524,9 +6524,6 @@ void __init workqueue_init_early(void) pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); - wq_update_pod_attrs_buf = alloc_workqueue_attrs(); - BUG_ON(!wq_update_pod_attrs_buf); - /* initialize WQ_AFFN_SYSTEM pods */ pt->pod_cpus = kcalloc(1, sizeof(pt->pod_cpus[0]), GFP_KERNEL); pt->pod_node = kcalloc(1, sizeof(pt->pod_node[0]), GFP_KERNEL);