From patchwork Tue Jan 30 18:33:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 19680 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1419762dyb; Tue, 30 Jan 2024 10:34:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/Kh3rdjq0rsFY+QDLE25Ob5MH3x0m3cQ8MjsEE3Z9Oh4UU5PCYUap+96tf5Imz2dEGD0D X-Received: by 2002:a05:622a:90:b0:42a:5fae:fe75 with SMTP id o16-20020a05622a009000b0042a5faefe75mr10029261qtw.40.1706639681713; Tue, 30 Jan 2024 10:34:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706639681; cv=pass; d=google.com; s=arc-20160816; b=xncYTdTnWz2CCX8JzaUZCEn31Xi7XWl6k1pu+SY9l+0Kk6COZEpLH1noLjKvoY2Owo XsnytI4NYg2yD0zM5YHWXuaiQOz5cgv3N1dHjx0hhSt2C6fstX5svbW0u/P9R4POlbui 4wsu8PclqSAgQOfwXfFlt4OlPQSd8bKqxtyu5+a8MC2UEAVibwca4CmcZ1V98HN9D3uc T7IzpKVYmOJBknJ9lECvtGjZxYZ2ubIe+51p9SzAwQht73Vwgy5xCDmkjc5VipAZJchW DDeN9fM051298bEufg9h8pcxW1SIrthsaIKORtjxdUBsFTHzYdEtCdClt8w2jcjqhKBQ C0QQ== 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=0Ij0fUh99sNPGQIuhuaIyYnTfjT0QFXCH+1kvsJ6p4E=; fh=lt2js4+oSVfpbDjw8gm9/JJoU0YKcT6Mty9go3Ytfy0=; b=arrlnqVicRyd0n3f87TaRkdytMuCHoSRvAoOEXLBu+cjqfkAnB4EruyqF32hKFFRV4 c1LlZbU10Ft1/BBYA1kqj2xeipKcVapJbqaCANgh1NOIbWvZNzQV7YFDk2nTpn0ugB05 sPRXp67492ledXYtyP12fbElBQ/fGyA+Dc0QWjH6BQ95nkV9YT0/hYgAx9Oa4/Ub2HvK M8dr9XCcW3QjaP1mHSA+4OKYxS8K1gU3oWvluglkREG5oPy+moychnT3S4bEywSe4wdy 1O3hTAJE0C/834Tab5qrqZNWm8tH9J70tL3bVaIhQSRGNGAGGJz45fGqvnYfj94dClgh WFnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=btSLtLni; 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-45113-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45113-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t10-20020a05622a148a00b0042aa94859a0si4202261qtx.738.2024.01.30.10.34.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 10:34:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45113-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=btSLtLni; 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-45113-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45113-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 815321C23D40 for ; Tue, 30 Jan 2024 18:34:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AF6378B44; Tue, 30 Jan 2024 18:34:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="btSLtLni" 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 1FE97762C7 for ; Tue, 30 Jan 2024 18:34:00 +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=1706639642; cv=none; b=fkyBKsGt918SjjkpBMlBk4JD1v9I13oLYmQbRjUZZpsR8o5EL5ePMx6LuNwr3KRF7rV0N/4bR4FE5tFE3KNfoUexFUlxgN4XA7Ng+EaD8jpr3oS6FTtq91Yeil7b46BUwCz2CDdRXXt7Dp/g7YRbLgJ0SPBLRfhQtGtDMF3Q+NE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706639642; c=relaxed/simple; bh=eC7+OI6/+9wto86uJj8ssIpbqkS2aO7JFeCrcZQgCgw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=N8MVIr/xMyHg/MIXmmmSqQC/XeFHdlHstFfV4161UULKz3Gu9oeOTS+NAraQuwD9oKsqKXNCZxf1cYIU3RoA3K1PPTXuwti9UBCBAeZHnbMoaUnn0vvr1NTKuKfR9Zu9X+UAUXaMl+gkkQYUdMWgskiP1+d0SLuzdSF3UEiEvIA= 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=btSLtLni; 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=1706639640; 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=0Ij0fUh99sNPGQIuhuaIyYnTfjT0QFXCH+1kvsJ6p4E=; b=btSLtLninwegMg6AIWGJtY+TAqaHX9qI1ZgNuSNyFvEu1peg1u2cZ+cx4pfw1ixCUBpauR qtwZOkxeH0bjUWFR1Ouj31HUcOQCBN8C/JJtA1dn3JIRg3/3w3DAoQS/0XLrkn06h4Gtql rFBGa7zm9/BNRy0/JWBVnRGEbEn8/OE= 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-653-e8NJ87b1OLq84HdCPEafQw-1; Tue, 30 Jan 2024 13:33:56 -0500 X-MC-Unique: e8NJ87b1OLq84HdCPEafQw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 1B768881EA5; Tue, 30 Jan 2024 18:33:56 +0000 (UTC) Received: from llong.com (unknown [10.22.8.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E83E40C122E; Tue, 30 Jan 2024 18:33:55 +0000 (UTC) From: Waiman Long To: Tejun Heo , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Juri Lelli , Cestmir Kalina , Alex Gladkov , Waiman Long Subject: [RFC PATCH 0/3] workqueue: Enable unbound cpumask update on ordered workqueues Date: Tue, 30 Jan 2024 13:33:33 -0500 Message-Id: <20240130183336.511948-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789541411024418352 X-GMAIL-MSGID: 1789541411024418352 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 saving the work items in an internal queue until the old pwq has been properly flushed and to be freed. At that point, those work items, if present, are queued back to the new pwq to be executed. Waiman Long (3): workqueue: Skip __WQ_DESTROYING workqueues when updating global unbound cpumask workqueue: Break out __queue_work_rcu_locked() from __queue_work() workqueue: Enable unbound cpumask update on ordered workqueues kernel/workqueue.c | 217 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 183 insertions(+), 34 deletions(-)