Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp370212rdb; Thu, 8 Feb 2024 08:12:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFG1rW6pmCm7kD6eVZzdu7dk/J9KL3DZGNHvtF/FDzL2O1FtlEIx7h65D+HMFMFFHfMAijE X-Received: by 2002:a17:903:8c7:b0:1d7:3121:ffd1 with SMTP id lk7-20020a17090308c700b001d73121ffd1mr11594937plb.13.1707408736114; Thu, 08 Feb 2024 08:12:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707408736; cv=pass; d=google.com; s=arc-20160816; b=uwrH2kLFr13DbJSMwXJwKoiabNRiFlgvloTFqnqG63xzeHf5koL/g0AVTSyEnFdVEw zoKmknYm4AtvtVouumsLmwllxKorTNw9IUuhqX7R/Zwg5huJPJCO5pYT5fcHPXgEswKu M9cWNdHo+NVbWxtBjdQw/Yia+oj6JpLxfaQQFKWyTdLY8hOx8iHMQbN13zkb3GojgxRH T5L2lcmpXJVqRWYwy3/DjRnWin4kEgCNuJWbtxGeYRXFtrzqs8PmG0gymB7v36EqvRFE ahN/R5W/wGOtTZyr/Fa0FEmmdGAXHbCxPMu6XiX46wOR+vFbBP/a7JsbM04kvtfEV621 4XEQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/Xu6Dy+LgyMX67Ta0NVKivdXcqKGVmjFkpKpX1QNbOE=; fh=Wkv8pFjyQlwuqBGrHT6TJUg4eXPZKxChTfcLdvnHM1I=; b=ftvawAfCnxDtlpB45kAoqiSF3rO5SH3Cb8uQKyPngEXtM6hned6415y4wCkk4SW3bf DJwfvhuFHK9VGIMuoarMpsR3Vr18L5f7OZoGTlVOPFU/yxrgdmCzfFzy9CrYSIa2bTV8 73DICv+FfalRlv+i3XXUBgK3UbxU9stXUy/2Lb+z/SBQj710fKg2flI4VLZ0nfGMOl9S muf59ZkdFJCJFnESgPN3vwddvwiGFvlRlN4b0m1PKWyJGCo+qxWy1F8AVomFVfV5r8Li W+iE4hy6BCpPW1lvU6CsjE9it90ope7MRtc6NYkfSoH1wMA7yFFPFazuwvsfGGsBk0ca oP8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MTHnVcTX; 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-58330-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCV0bb5dCZYOnVaCUD1DVh6KS0b2o/UZ7OwjIyIud/R0RClwDcjA7GpX/gB2nDbXs1V/iWeOYQvLHaTHuy+1hLLCv/QXxdTzmhKhvg6HRA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u10-20020a17090282ca00b001d94282ecacsi4130898plz.443.2024.02.08.08.12.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 08:12:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58330-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=@redhat.com header.s=mimecast20190719 header.b=MTHnVcTX; 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-58330-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58330-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D555B28A9F5 for ; Thu, 8 Feb 2024 16:10:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FE057EEEB; Thu, 8 Feb 2024 16:10:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MTHnVcTX" 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 AE82E7D413 for ; Thu, 8 Feb 2024 16:10:31 +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=1707408633; cv=none; b=g4gdJt8e7GUffiIXlufjrU24bUbYQ6BTv4iMyK5W02mXOtS0dOlzk/XShDWqesOL55Ns61ubRn3D6XanoN/RvboeXCf6Rqre1yZ3Fg3wI1CQ2hIMAaXIFClttGiTjgozJKEN5knNyA6nA/vMnBh8voqa0h5uxFiJDhbHCQaqcWA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707408633; c=relaxed/simple; bh=jtcRfS7FK70oPiJGDW4/0HuF2nzmDdtB4If+8e4T7MQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RI16iIiXbxNG4YWZ/K2KtaiCFk1v5tcjMfm3WgJFN0xSgpXayuQakgC/NxK0tS5wvgkbZ5waTO2iMx4fTulDErDPe/XKxKo7oKAtpg+2Q6YrPv6ZwCWmjZOPRWffsI1bxIU85NSCwZTUyGZhFLCFJzDr/0ykzqFYR3gdi+TiPvI= 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=MTHnVcTX; 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=1707408630; 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: in-reply-to:in-reply-to:references:references; bh=/Xu6Dy+LgyMX67Ta0NVKivdXcqKGVmjFkpKpX1QNbOE=; b=MTHnVcTXT//xsWX7usokCHK0FS4aLrXml0ki6SiEikeplu1opSBl1oD6YHy6Fs9AEHVgs+ F+X5uMSZbUVT57gXJZyeNwRVhoC102dV0Yos18Z1mBjh2XX7ZpSsaMzOoKEU6ZnwDaHTyE Qq44S2YnZJQ3k2/+6ppumrbwL/irdEM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-3Fv6xqkQNByRzOKeLgBVHw-1; Thu, 08 Feb 2024 11:10:26 -0500 X-MC-Unique: 3Fv6xqkQNByRzOKeLgBVHw-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 EF068381644E; Thu, 8 Feb 2024 16:10:25 +0000 (UTC) Received: from llong.com (unknown [10.22.32.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C130492BC8; Thu, 8 Feb 2024 16:10:25 +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/for-6.9 v5 1/4] workqueue: Link pwq's into wq->pwqs from oldest to newest Date: Thu, 8 Feb 2024 11:10:11 -0500 Message-Id: <20240208161014.1084943-2-longman@redhat.com> In-Reply-To: <20240208161014.1084943-1-longman@redhat.com> References: <20240208161014.1084943-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 Add a new pwq into the tail of wq->pwqs so that pwq iteration will start from the oldest pwq to the newest. This ordering will facilitate the inclusion of ordered workqueues in a wq_unbound_cpumask update. Signed-off-by: Waiman Long --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index cf514ba0dfc3..fa7bd3b34f52 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4804,7 +4804,7 @@ static void link_pwq(struct pool_workqueue *pwq) pwq->work_color = wq->work_color; /* link in @pwq */ - list_add_rcu(&pwq->pwqs_node, &wq->pwqs); + list_add_tail_rcu(&pwq->pwqs_node, &wq->pwqs); } /* obtain a pool matching @attr and create a pwq associating the pool and @wq */ -- 2.39.3