From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 99A12261588 for ; Fri, 7 Nov 2025 14:38:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762526327; cv=none; b=iZ+tUEfqxqWLprAx3lDscIewZvW+4lWvwTXhBn1D9lJQOiwMu15oxwJzkUQKx0BgBZgQxzB655WqMUkzC2c2nYiR+yqzTuos4fLQ0oCG1GThwhrRgvQ7O4RDd68gwv5PNih5415RZBF6Vqw/x5fH5qkOcplS5IkuhduimE1Sbcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762526327; c=relaxed/simple; bh=9Eu3yarqsEXMS8lVYC67u2tBOt3nsWm7YB99GQ+qa3E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Jd+pfR9NDrLQch16NkvfZ1uRs/8ERJMQCMuuJuvDR3Wr94i0FDKS9iZl4NYirMsC1rYCcbvJEQ4j2aXpzP1ftADWyu+f5EjawSNzKdrFWzydmY3EofVRl6+0u0a1kl2m/WdE3yF3D2qNor+4Pvg6JMdGrF6Jp8I8EewgNgtipn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=VDlLkj9U; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="VDlLkj9U" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-4298b865f84so421847f8f.3 for ; Fri, 07 Nov 2025 06:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1762526324; x=1763131124; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+M2nfWocWAp3mZ4tDZ/NECiHNbUMiwpyH/iW4S7LXgE=; b=VDlLkj9UEgiEtajcShLdJTpoKnYWzuUjxXIPD2/ybqpP2LkrNFPbLuMLSgjR7zqLe7 vFB+6XP/BIdeQrBXihiAPWkja1sbzWv33bpYoKxo6V/0Zdow5aPeSkX8cGX5SJrV4Cl9 Vylq+dKMT0HaEWDgI6KqYMEhb6BpLN28ZxZrjS3G3e1QOpQGK4s0eFqnkvq4zUrGpqJt Rl0Ikqs5Tko2p599W+2BqXaerA2xsZH1o2PAHqidKN7vRKkdn6Fyn7tvNqLtq+iaCFBM OXca6hTOA5HBoWfX+5yg1IlwbgQkm1ckkapK5PGyuN3zibdlnJGkOPxQXabOVlxgdFqq GAaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762526324; x=1763131124; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+M2nfWocWAp3mZ4tDZ/NECiHNbUMiwpyH/iW4S7LXgE=; b=nYaIkllSuH0xKwJQg9g8QW0/A18fi9nFL3IG+371XU1vyQOmMfv4It/amVJF4Rx9s8 KzNIDFB6Sv1ZVqrkPBpP5nhfVZtcjXmcOWsD6BkKMEQL8oZqru540qPQWl+xWN0Z54rz Vira7k0XkzG0p9nRnlJ9ulMxslQrtpmep6bW3/SL0dBCnIoqF7YVXzAIjnMak1JY1AaV Ni+IoM23ar8yrFZW0LwLXCSsRrpscALfzMB2pIspx8zkEWXPN69oeY9+c/uNt27sxvZN ydYEsmUJl5vVAs4piwZaA2aIPFBqBo89+qXB1pWNynb7Wmb4wMQ3eDcpkl7BDbCoAIcQ 2Zlw== X-Forwarded-Encrypted: i=1; AJvYcCUgzW8IdP3XVGNKeGzH8jxjIBbwXhgUfskNHnx0uNV2e3l8txB05BQ7ppSU0QXxAIWhm+CzIPUPwiod5EHUuFXrFNTl@vger.kernel.org X-Gm-Message-State: AOJu0YxZVLRY/O196+F+8of5DQm00+QE0fLCdnfrHHZHTdDN5DpqlNs7 VFANZctGgKZcnQqqGeMxDGqA/gUTb3L2ZlwRjg2lrGNVMmquEaBkG4RwUUCeh0Cj3XY= X-Gm-Gg: ASbGncuBtKFP4+i6TyHLTkp+Q8IwcxFw6DouuCAnyupMNMf4XrPsKX9iZKO03XYob+v rgXU8/vMEtCcyT3cQ4+uDfcHL8sdaDrRpwrnQDAk/ECguVHunAmSR6JOcjQIpO3fkdnWxXTk2AU 326XVoDvzRsErl8StzZXB/2ob7qAZPZ/x22k3Tus5dq0YdV9/QcMjvwhbprRd7cHDPDwERELCSf TAjDg1cVq7pxdhFpjv/EXacrA/So1qn1wu9nSDv6zDfBaUfrZDxvOozT52UZNKE7qedsBixbvUC WvDrJncciciXsJf3fwbFF0xv9SRl439Ma4Rhh+k6YJNZiukahOz6mZXh+kUV0Jtb5WGLhmMOSS+ nHYQY4Hc5FPzl2Nc+QI3a1VSFr+BXRb9CJTQ9qempEL39uCZzzih1KQ+IuhdWr/yL+m93AxYWl2 94K7LQQr88STsDyP2ygya+KU7M X-Google-Smtp-Source: AGHT+IErAG7umGXc3Q32btkC2X/NwPm9eeE2SBi6Qlb6E6Dsctm3C4mBATHE2WTygUj7Gi1bpdmGng== X-Received: by 2002:a05:6000:178b:b0:426:dbee:3d06 with SMTP id ffacd0b85a97d-42adce35cffmr2917437f8f.22.1762526323850; Fri, 07 Nov 2025 06:38:43 -0800 (PST) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42abe63df69sm5798411f8f.13.2025.11.07.06.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 06:38:43 -0800 (PST) From: Marco Crivellari To: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Maximilian Luz , Hans de Goede , Ilpo Jarvinen Subject: [PATCH] platform/surface: acpi-notify: add WQ_PERCPU to alloc_workqueue users Date: Fri, 7 Nov 2025 15:38:37 +0100 Message-ID: <20251107143837.247085-1-marco.crivellari@suse.com> X-Mailer: git-send-email 2.51.1 Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently if a user enqueues a work item using schedule_delayed_work() the used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to schedule_work() that is using system_wq and queue_work(), that makes use again of WORK_CPU_UNBOUND. This lack of consistency cannot be addressed without refactoring the API. alloc_workqueue() treats all queues as per-CPU by default, while unbound workqueues must opt-in via WQ_UNBOUND. This default is suboptimal: most workloads benefit from unbound queues, allowing the scheduler to place worker threads where they’re needed and reducing noise when CPUs are isolated. This continues the effort to refactor workqueue APIs, which began with the introduction of new workqueues and a new alloc_workqueue flag in: commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq") commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag") This change adds a new WQ_PERCPU flag to explicitly request alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified. With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND), any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND must now use WQ_PERCPU. Once migration is complete, WQ_UNBOUND can be removed and unbound will become the implicit default. Suggested-by: Tejun Heo Signed-off-by: Marco Crivellari --- drivers/platform/surface/surface_acpi_notify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/surface/surface_acpi_notify.c b/drivers/platform/surface/surface_acpi_notify.c index 3b30cfe3466b..a9dcb0bbe90e 100644 --- a/drivers/platform/surface/surface_acpi_notify.c +++ b/drivers/platform/surface/surface_acpi_notify.c @@ -862,7 +862,7 @@ static int __init san_init(void) { int ret; - san_wq = alloc_workqueue("san_wq", 0, 0); + san_wq = alloc_workqueue("san_wq", WQ_PERCPU, 0); if (!san_wq) return -ENOMEM; ret = platform_driver_register(&surface_acpi_notify); -- 2.51.1