Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp44697rdh; Tue, 6 Feb 2024 18:44:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGg5Q+ScR1FCgg1+3Fmo+0OhQz+KAywYUTZuXjS569LzL1srWA6m2xBgs4byDTNFgRX3lbG X-Received: by 2002:a05:6a20:1f11:b0:19c:a82c:18fb with SMTP id dn17-20020a056a201f1100b0019ca82c18fbmr2706786pzb.40.1707273880073; Tue, 06 Feb 2024 18:44:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707273880; cv=pass; d=google.com; s=arc-20160816; b=fSiptBybsIyJIx1NMhHgkDg4FDmShYa+g7ewvjGcezTysUFYucun/I/80TKtzHStKf ZrS3X1Ce2STayUKSq1ZAF9RilErSx8zJz+xwytNcgR+DgAFoSOqRddDjOxxaZ4tW6Q85 2R7LmQQFqZ8EFmxsgKXMdIH9agKe/SoolLWgGc1aMRrBib/QYY9ZNzBzg14Yxm387Bgy Cs1ipGU+4hjYs9CLtHMnNtOHel+TCLpB4sloDU5jVAJRvUHvZUTOgk2kkk6hjsW1zx44 HpdHBK4MLV7sg2QUNGorr1QXZOnQDO3h+0ilFQCzD+TgcwxO0xRZ1wRKQffKwPaf7ve/ HEww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Z+tb6IdasDYJTSSzqfl5+8dC3ryjBsl7LBjRRJfQivk=; fh=XIwzVa3HG4nJ501SbArbtAH/K1lcapgWaML5Tz3g3Hc=; b=NQFnPVdzyNWmMlGRIWHX5Mf1kqqbiyu9lb0JpYkznFmDjjV7UyzNowYHVoklmslBW5 RQ1a2K1I9ksj3CYNfVcd8e1996cQNsOZ4mpybn+OS1tC/6e+4jEdiE5SA5yTQcLAu+Py CB90faUJLO3FvKR7SLV/FB+FxNwYYhxrhlKN7W8cErJ5/z7/OeCrrRlx9HgSx33k05K0 5Vvr5bD2O3ZQtovSkFUPCYX2nyBZZV4SPKMXSY6krBPqEg1gho6dQYPoUWViSH0mm916 MiNzNQag/9ACTuvKby1pRK7ypt5SiELf79zEd+PAOyYQmUIJaTKLuV8LNMxFNr8FV+xF uYVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FHfoD17M; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-55835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCWkutDvkSP6qeG+cVsv7kJ97izDXbAnvSp5SOvJVpA5sBHDxKqyiYZw4WJQBZiSFWOfx4n3pdMQ/tEQqd+iWDDjuA2HokdWWBXH6M/NaQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t9-20020a62d149000000b006e04633bffbsi400782pfl.262.2024.02.06.18.44.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 18:44:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FHfoD17M; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-55835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CC743B27119 for ; Wed, 7 Feb 2024 02:07:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 523EFFBEB; Wed, 7 Feb 2024 02:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FHfoD17M" Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AEAEFBE9 for ; Wed, 7 Feb 2024 02:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707271630; cv=none; b=LdGtM9OHeJFVr468kx+0lCPSeNwSkjXsHOWUGu1oN5b1C/NFnxJYq5ZdLwOWpru9lXl8Eex33tyijV4BedE8IHjfSrs60rvDMBugcu78UO1+YlNhx2y0PFDfK3wA4rjhETc/N2EGd6t4th6ThoYI8OOrzcQPe1x107E3tqZhA1w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707271630; c=relaxed/simple; bh=0UZS3TR3mgeInQ4tWMsJT0XhO0RJsIL8p3otmu3nU20=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ra4X9hHlYXapTAxncRujdNiMnXmsV/Gw+ZL1sZYsxsdY4X3vYaL6Foix40Jptzq4fimgVd6mxMv3yG+PDiSUW9wn7eydkdVeATAhdWLyx6trhyV/UmTN5Sb3mkJ3dYHkQwd/lk/rwRc2IOWVzpnq7DxYMgzqbh5UfIBTeMniqz8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FHfoD17M; arc=none smtp.client-ip=209.85.161.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-59a45d8ec91so32519eaf.3 for ; Tue, 06 Feb 2024 18:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707271628; x=1707876428; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Z+tb6IdasDYJTSSzqfl5+8dC3ryjBsl7LBjRRJfQivk=; b=FHfoD17MH839fkc8G2BUaPZfbVckg0pm/6N5rMpJk+DL7nelABg/GVOzDL8ttBIMrS otxOPJaYJ00J0mYPkm75lo5QJ2MQ5XOF7fT64r3WUEL7tFyGF6covE83Bzy+0PBfhkI9 2hVN79vygFLDjWHWHL81aeJ6z7KLjFNC+UYzxch3Nqe44CZySPeoAerAJMenLEsoUqix A9qcm39s953/Um0wJYAq2fe2Wby4KO45EywLUuiXjHuio8LVca1UHEujpfPzFqX7/Y86 DXO63/1Va9PqUOJDfrFcFfJ9fDQyvNeRugfSvhVooMFcXIU8Rfela7lnmOixjOaR4iK6 hfig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707271628; x=1707876428; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z+tb6IdasDYJTSSzqfl5+8dC3ryjBsl7LBjRRJfQivk=; b=kBmwE5p/P0yK4Z2ewaxsWE2Q6u9+J4sGrNIEOvMRvCoNl/WdCDWgW5rGWeb2KJZS8y P82ezCTx9FTd7aFCLwnGKNu/Xz8z2i4qm15WsoK4uLUE6YJKUyLHjgKRfS5yPXDdx0sR jtrQ0yor1qNvJj/665LrCQ08LMqfdlG1rCe3U84M2gy4HFTmv2q0SFBBxDzWE9/tmhWi uSAvz5cY0Jvk4tDjLH/H6m4Q+2+EJ2yAcFuL27c4AxMSnS4A7910NweeRUZstqnDmAju 4yjoujcEgXDF/0/JOdEuGg/0MMCkj/uK/hyl7I5k3fpWy49UY3WKoVIT4SGYyekLSZaz rjMw== X-Gm-Message-State: AOJu0YybWXp1NyZ89OKBxhKma2STaL98GS/Tgq89uSy8uoyG/6LS59sF amX0zWi20vEXXe6lsR0hu+0fJms1zillF3hZIhX22IilaITcuPShyEqeexHrBHxpt1hFp9tWBW2 X9BhkKLnJmMAkEYG1DWFbKI0/ZIg9RAoyS5Q= X-Received: by 2002:a4a:7614:0:b0:59c:b0e2:c147 with SMTP id t20-20020a4a7614000000b0059cb0e2c147mr3634718ooc.3.1707271627608; Tue, 06 Feb 2024 18:07:07 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240206080024.2373490-1-yunlong.xing@unisoc.com> In-Reply-To: From: yunlong xing Date: Wed, 7 Feb 2024 10:06:56 +0800 Message-ID: Subject: Re: [PATCH] workqueue: Fix pool->nr_running type back to atomic To: Tejun Heo Cc: Yunlong Xing , jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, hongyu.jin@unisoc.com, zhiguo.niu@unisoc.com, zhengxu.zhang@unisoc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 7, 2024 at 12:52=E2=80=AFAM Tejun Heo wrote: > > Hello, > > On Tue, Feb 06, 2024 at 04:00:24PM +0800, Yunlong Xing wrote: > > In CPU-hotplug test, when plug the core, set_cpus_allowed_ptr() restori= ng > > the cpus_mask of the per-cpu worker may fail, the cpus_mask of the work= er > > remain wq_unbound_cpumask until the core hotpluged next time. so, worke= rs > > in the same per-cpu pool can run concurrently and change nr_running at = the > > same time, atomic problem occur. > > How would set_cpus_allowed_ptr() fail? That should trigger WARN_ON, right= ? > If set_cpus_allowed_ptr() fails, nr_running getting desynchronized is onl= y a > part of the problem. We will end up running per-cpu work items which must > execute on the same CPU on foreign CPUs. Hi tejun=EF=BC=8C Yes, WARN_ON is triggered. The reason of set_cpus_allowed_ptr() fail stil= l needs to be further investigated. I was originally planning to inquire workqueue whether or not allows the wo= rker that associated with one cpu running on the other cpus=EF=BC=9FFrom your re= ply=EF=BC=8Cthe answer of my question is not allow=EF=BC=8Cright=EF=BC=9F > > Thanks. > > -- > tejun