Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1500332rdb; Tue, 30 Jan 2024 23:45:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEt9YD6RODwbdSoR++22y0w4pwlLfg+Cd3aNyCZrJIOhUQPQrhwRd0eu8Uny/i/UPHlUW+B X-Received: by 2002:a25:aa2c:0:b0:dc6:1735:e0ac with SMTP id s41-20020a25aa2c000000b00dc61735e0acmr1013338ybi.15.1706687142988; Tue, 30 Jan 2024 23:45:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706687142; cv=pass; d=google.com; s=arc-20160816; b=TR4dYCqI39m+Xw9Q+f+khSRvxzRazthBOG/NTiW+/RSPjPif1TbGDi013ZelY6k5wl c3KU4SXpowuRb4iF/RRJt3hW6iQL3RxPxi2mrKw27HdaUvK9FgSxny9kRvAiBUpU4i6X QghU8BA/LnJkSf+kvqn14u84xuRaXwrPZG2Uq8EKezQtxVcSOPuUmZz9NKXj6QI+Chgy qa21SpzXqgMGKOKSIsafPYjfgsfFRiHZQYa3q6pWRXAvhdBgu9BOuJFJW8+Zwz7l1Zy6 ChPB4NvbbjE5WPy/Hl0u4krMmAFEGw9f49CSjiegFbmm2h8NC0BiGvUqWNiRLRLbtCZQ j3+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:content-transfer-encoding:in-reply-to:from:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature:dkim-filter; bh=S9pCICTqN1F3e5Nuf2qjgG414cF5+i5Fu3bz/IKz3go=; fh=uHktJ8pSj5QPkYU4sWamJb6257+RtAMQQoIXPbAYn1Q=; b=tSIDnnUeoVYFOd1abdIxooCpei9gTqt6e0h7NYQb/fMnsPo8FnjJ/gYa9lOjQBlIqD FNkxFsX52watK9E48G0YSyvKHmJ2M6UZt673jxpkPKLLWqFDWN6GcmwRMKksVxebiJrc vdt/VaZW3b1Z3I+Qc+Y/1RDzO483zKcA3wGypWEmeKjFn39lo7k0BY+C2ZM6T6VvKA5k MCdGU0uW+j3gl/j5ylYxDkhPurmWjQCAggxa4NN3xmx3Y+HRCtfzyvnr1gX1MXRGX0gJ Pb85s3VuMe52ibffu3p9pnjeG74xNjlLl1S/GtA1ePxR9Qjz49dd1HGkrbFwS0VV07em LLRQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=WX9DdyDc; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-45943-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45943-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com X-Forwarded-Encrypted: i=1; AJvYcCVkwP1U6/YAHQVSfQ9jEC2TkyYNF5wnU/gAiSpoMTfQjcz8IRevXwO+A4FAnRjPykwRoreHmDHx0snQbCPrH8ovcwudXQEUs9092dFC0Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w5-20020a636205000000b005d8c19ca98dsi6069064pgb.137.2024.01.30.23.45.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 23:45:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45943-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=WX9DdyDc; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-45943-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45943-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9ADCA287C54 for ; Wed, 31 Jan 2024 07:45:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48BE055C24; Wed, 31 Jan 2024 07:45:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="WX9DdyDc" Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 B598B5577C for ; Wed, 31 Jan 2024 07:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706687130; cv=none; b=GzU9eBoR6lRZVSs3ng1a6fkkk6AoWV9cD5Dv1gsHkEeIbsE2OWUKWDx3L9fEhodNSbr3Rg2M5IFKCi3ouEzZhTfvK43+vz9z7gYW99Qwi6JTq2PTSldVmpT2rAJgR+NAShyiiOs7EWaQlO/yntswck4Zg86y2BECI21CkuUSc80= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706687130; c=relaxed/simple; bh=r72jR+ohmF08fx34PK4uPYzGYiSjmalKc4/TBzaO2l8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=mNWPqfIIYngJ6ghKKpR42gZZyWZxt7UyLBAYDIiEHR89osqiUMzlbD5dvlBtQNOmouWV9lPr1pGL8n6bwjcDPJLXn71e3uuU5W9OnWQsbTq/UXsKQL53hN24sxRuJ7Zx02uwHN4U/dys8Mo9aINlcLQGpeRhz9DIWjIBZnblrPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=WX9DdyDc; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240131074525euoutp02254734cb023cc31708c4b23630b354a9~vXuX3Avm40742707427euoutp02F for ; Wed, 31 Jan 2024 07:45:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240131074525euoutp02254734cb023cc31708c4b23630b354a9~vXuX3Avm40742707427euoutp02F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1706687125; bh=S9pCICTqN1F3e5Nuf2qjgG414cF5+i5Fu3bz/IKz3go=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=WX9DdyDcZMMTxij5BdbUmH/lpU/+BLavOHz4fOTYB82DLs5HifomcgEjDb/Frp/rD VS1g9uAaNVdKOHAbjX2YcT0fPfoxQ693D1Vld9S0v0Xf0KPgYHlH45TzHL/2D/VY0u Bs/FgPKFUgiaRooNLyZgPs8tpfMeJ+q/BljP4dQk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240131074525eucas1p1373c4835c0aa3050e8315f874b9ca546~vXuXj6Cgo2760927609eucas1p1C; Wed, 31 Jan 2024 07:45:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F6.44.09552.59AF9B56; Wed, 31 Jan 2024 07:45:25 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240131074524eucas1p135ce025e8d4ebec1c957b21f124a45ae~vXuW_KfON1875218752eucas1p1g; Wed, 31 Jan 2024 07:45:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240131074524eusmtrp2d04cb51eeb6703dcfc4aa71a004d5475~vXuW8Rbn62737027370eusmtrp2R; Wed, 31 Jan 2024 07:45:24 +0000 (GMT) X-AuditID: cbfec7f5-853ff70000002550-a4-65b9fa9515fd Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id CF.4A.09146.49AF9B56; Wed, 31 Jan 2024 07:45:24 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240131074524eusmtip1694ad0b825fc3a72818d1342d54a0df0~vXuWeP_tN2658426584eusmtip1X; Wed, 31 Jan 2024 07:45:24 +0000 (GMT) Message-ID: <41f8fab0-f88e-43a5-aa36-d071027c4e0c@samsung.com> Date: Wed, 31 Jan 2024 08:45:23 +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: [PATCH v4 09/10] workqueue: Implement system-wide nr_active enforcement for unbound workqueues Content-Language: en-US To: Tejun Heo , Nathan Chancellor Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, Naohiro.Aota@wdc.com, kernel-team@meta.com From: Marek Szyprowski In-Reply-To: Content-Transfer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EJvgs7GrI/m+7mdViVjr iceUWIozEg21mIuKEwF18FmxPQMAAA== X-CMS-MailID: 20240131074524eucas1p135ce025e8d4ebec1c957b21f124a45ae X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20240130223021eucas1p1172b060d53847b8b77f6455d6257528e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240130223021eucas1p1172b060d53847b8b77f6455d6257528e References: <91eacde0-df99-4d5c-a980-91046f66e612@samsung.com> <20240131041205.GA3517117@dev-arch.thelio-3990X> <20240131042031.GA3946229@dev-arch.thelio-3990X> <20240131044254.GA802495@dev-arch.thelio-3990X> On 31.01.2024 06:01, Tejun Heo wrote: > From: Tejun Heo > Date: Tue, 30 Jan 2024 18:55:55 -1000 > Subject: [PATCH] workqueue: Don't call cpumask_test_cpu() with -1 CPU in > wq_update_node_max_active() > > For wq_update_node_max_active(), @off_cpu of -1 indicates that no CPU is > going down. The function was incorrectly calling cpumask_test_cpu() with -1 > CPU leading to oopses like the following on some archs: > > Unable to handle kernel paging request at virtual address ffff0002100296e0 > .. > pc : wq_update_node_max_active+0x50/0x1fc > lr : wq_update_node_max_active+0x1f0/0x1fc > ... > Call trace: > wq_update_node_max_active+0x50/0x1fc > apply_wqattrs_commit+0xf0/0x114 > apply_workqueue_attrs_locked+0x58/0xa0 > alloc_workqueue+0x5ac/0x774 > workqueue_init_early+0x460/0x540 > start_kernel+0x258/0x684 > __primary_switched+0xb8/0xc0 > Code: 9100a273 35000d01 53067f00 d0016dc1 (f8607a60) > ---[ end trace 0000000000000000 ]--- > Kernel panic - not syncing: Attempted to kill the idle task! > ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]--- > > Fix it. > > Signed-off-by: Tejun Heo > Reported-by: Marek Szyprowski > Reported-by: Nathan Chancellor > Tested-by: Nathan Chancellor > Link: http://lkml.kernel.org/r/91eacde0-df99-4d5c-a980-91046f66e612@samsung.com > Fixes: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues") Tested-by: Marek Szyprowski > --- > Applied to wq/for-6.9. > > Thanks. > > kernel/workqueue.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > index 9221a4c57ae1..31c1373505d8 100644 > --- a/kernel/workqueue.c > +++ b/kernel/workqueue.c > @@ -1510,7 +1510,7 @@ static void wq_update_node_max_active(struct workqueue_struct *wq, int off_cpu) > > lockdep_assert_held(&wq->mutex); > > - if (!cpumask_test_cpu(off_cpu, effective)) > + if (off_cpu >= 0 && !cpumask_test_cpu(off_cpu, effective)) > off_cpu = -1; > > total_cpus = cpumask_weight_and(effective, cpu_online_mask); Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland