Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1476157rdb; Sat, 3 Feb 2024 07:44:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeHn/TNM7GyAQPXubAc7H0PpdsZhmjJB0eEt8cVvDteJfbxEt64scYS2lBNaGmpJfuI7up X-Received: by 2002:a17:906:3182:b0:a37:260a:82f4 with SMTP id 2-20020a170906318200b00a37260a82f4mr2221129ejy.11.1706975052737; Sat, 03 Feb 2024 07:44:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706975052; cv=pass; d=google.com; s=arc-20160816; b=o+Jj935g15wzq7MCKNGZR+wSJ3r1shcq519ErYcjprIP4CXizRtSvYiRmpUiwu4DPA sTLO3fH+l5XscyoN/dM0uTW+Du0L6kQVjw5ldoZ0sTJzH9EIJHfIDqB7s7BAatwYqgln xemeNzCTPizUI5ExvAlWCE8b67cXGz3dWTC05Wsv8i/tPu7QZko/XbcImPUG0J6PZs5g 0/dMZLyv5AaCbX6Mvw7/ox/wBNEPjPtXRHZjM5PKJaju0rjVoqFy7DxaZzCgrjFe7aTG bNc0zX6WDjXW2iHmwXxH/2A45D0cWwT7Z/G/Lhn9pYuCdO1uUyKMt78HUkGCXbE7sL22 SJYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=etw5f6ek7q4zMVxUU4qrG6lMZPsjA2+up4LCm7bLvnM=; fh=wvipdwLkmNg5iPlnqrtt4QGHrzimvLuzwblazFV2yJ8=; b=ppFV9D9Q0ZU6rGjL9vDiAy+fNoNP/xEkVpFOxSaivaYg80iW8ZaOmFIQUZsC41uYqU bQn3igxDb8H4mDG2udyCwGaFkX2+Y09QiRbHmJGNfmhy+S/mUsb9hhthFkqWLOWo5Z11 QhqzcBdkt42DByEEBnUeLC2occvx50Ufuy7gkcr9ArJobZYyxDb6vFoRoD1EqNmfUi/4 UBFSvtEugW3TAj44rbS7iZ99LXUAEQnnhbiMS0Z6DJJ9YK9bJo0/fsSQSmov1IAPXair mRdh6kkoVsoTuQ2TR60UVGL30MTgi1qoGBcRneRB+55QItfU4xh6nGmuBxxgppjga4PH qxkQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IPVxTK5h; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-51155-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51155-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCW5Rgg4BBEJ5ShN7DTK5wqJJPJ1IGbz63iRRrs1Tn4rd3qXiQvls3H4lXWLnZ7doB5mELUCMWKWT7t8YgicsArF6H+6Cw89sdqPbYdEcw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ch12-20020a170906c2cc00b00a34934589dasi2015077ejb.212.2024.02.03.07.44.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 07:44:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51155-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IPVxTK5h; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-51155-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51155-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7AEA81F220B8 for ; Sat, 3 Feb 2024 15:44:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9375D5F558; Sat, 3 Feb 2024 15:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IPVxTK5h" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 CF7EF5F541 for ; Sat, 3 Feb 2024 15:44:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706975043; cv=none; b=i9sesHyYV69Zrsl7mgS2Ji7nQYzbU7gWJkGBoiANV9MxQpu7trUIvff+zDA9tsSRgS0lcpmooDcDx5fZPlxH05ywAmlmP6rHBOpdv8svGy81LX8kwlAqQWJYcOypeWrfhJ7Xxkyi/iC8xcxlomqYSeKoeiyujBnX41YLvwuV6Kc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706975043; c=relaxed/simple; bh=d6cLCt9ayHSlBADDrlW6Zy6tCMiM/CqdbjAmopbqEqc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=BX8drzwplhaxw2cWNWOX//Etl4UJGnzQLoyFgXkx42FJrLQk+WYsUsRFaxjc5eg+9qtj5MVdVM93HqJ1SFMzs+eMC8Z4MtPEL+IhQZ16de6l+pjka//007v84as8YCesKMFUohczn5ACpbCE5afnpTNKCN3ufXw/dXKHhD6Jxv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IPVxTK5h; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706975040; 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=etw5f6ek7q4zMVxUU4qrG6lMZPsjA2+up4LCm7bLvnM=; b=IPVxTK5h+QRIH51DWzTZxjorEbq6uKHy1Q2Q+37kGpdZHtYsa4PWZ7eIVDW4gbYKVFHluW OdTlYNsut5CRucrMHzElFjixaneH6kTrw79wNI7Qr06IvzMEzmAcpYwQ4vBZm2PTjryl5z rf78o9cHeNnlcsZZWK8ga7avFjxId1w= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-437-T_OwaJzYO1CLoD68Phcd5A-1; Sat, 03 Feb 2024 10:43:59 -0500 X-MC-Unique: T_OwaJzYO1CLoD68Phcd5A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7A3985A589; Sat, 3 Feb 2024 15:43:58 +0000 (UTC) Received: from llong.com (unknown [10.22.32.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2497D492BC6; Sat, 3 Feb 2024 15:43:58 +0000 (UTC) From: Waiman Long To: Tejun Heo , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Juri Lelli , Cestmir Kalina , Alex Gladkov , Phil Auld , Costa Shulyupin , Waiman Long Subject: [PATCH-wq v2 0/5] workqueue: Enable unbound cpumask update on ordered workqueues Date: Sat, 3 Feb 2024 10:43:29 -0500 Message-Id: <20240203154334.791910-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 v2: - [v1] https://lore.kernel.org/all/20240130183336.511948-1-longman@redhat.com/ - Rebased on top of wq's for-v6.9 branch. - Use the new pwq_tryinc_nr_active() mechanism to freeze the new pwq of an ordered workqueue until the old pwq has been properly drained to maintain ordering. - Make rescuer follow changes in workqueue unbound cpumask as well as its sysfs cpumask, if available. Ordered workqueues does not currently follow changes made to the global unbound cpumask because per-pool workqueue changes may break the ordering guarantee. IOW, a work function in an ordered workqueue may run on a cpuset isolated CPU. This series enables ordered workqueues to follow changes made to the global unbound cpumask by temporaily freeze the newly allocated pool_workqueue by using the new frozen flag to freeze execution of newly queued work items until the old pwq has been properly flushed. The cpumask of the rescuer task of each workqueue is also made to follow changes in workqueue unbound cpumask as well as its sysfs cpumask, if available. Juri Lelli (1): kernel/workqueue: Let rescuers follow unbound wq cpumask changes Waiman Long (4): workqueue: Skip __WQ_DESTROYING workqueues when updating global unbound cpumask workqueue: Enable unbound cpumask update on ordered workqueues workqueue: Thaw frozen pwq in workqueue_apply_unbound_cpumask() workqueue: Bind unbound workqueue rescuer to wq_unbound_cpumask kernel/workqueue.c | 128 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 113 insertions(+), 15 deletions(-) -- 2.39.3