From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 B77EC25D1E9 for ; Thu, 30 Apr 2026 09:08:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777540112; cv=none; b=itfcrrUv+CJnkXlbh7lTcZXIoVj310ERj4U4N1S7BujGEYAybqgTfzRq6vyAVw+vT3tJvQj7cjVdayaooXhW5xB/CO0IvTdwEY012R3CE8jXTRiNO94e0zHLbzeSWVOgyE4X7jj65e+XdQfCBv1HcZ+qNrhy+zEh2d80zTs5D1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777540112; c=relaxed/simple; bh=HRJDgSRMk1/mLWOWqNAm3NCi7RhOWDugO+fdOmMWTpo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BfunA/o+PT30HALZXBlGGT9X4q57r5htfCU0uIKOF72FUxWTfpp2RHGF6HaLiSBJheECIIQBy/BYhkO7mXjNLZV6mLZti+RWLsmxSwkDvfMR7uBBKta9vBnYp/C1Ve7YS2UmWGdbTDHFBYHUijYp8ZRyH/p0SSZymx8LfCZOeQ8= 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=FDXLmice; arc=none smtp.client-ip=209.85.221.51 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="FDXLmice" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-43d6fbd0954so522745f8f.1 for ; Thu, 30 Apr 2026 02:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1777540109; x=1778144909; 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=77MMcrPtjjHJtpvk4YyZWJja9SciHKl/Y+JyJ79gGCM=; b=FDXLmiceonDVntNkfBBEcgqyzOjtDVE57LYp72QTbVHCVs1WxEjRqFyaZt/oO7++xW 5/DEY8LOa+RNsuay7z7ZPM4Nbld3tq1H05Rn4ew+ITastn3DON/cwXFKNPVKxvcKchQx NbeJyQFTOQMwDY8T/13dAbpvmWkt/I2WlfdJif3zHBR6IiCKZlKV2FvxKfdGK97jEji8 eQNwDDMvCqKqeCIW0roowAxj4rL6EIBbO69xVvfFQSJMzV6AvOUSboPefAJ4KSsIHo36 A1szMlYPM8msAXpma/eRpNypXtpcx28ahbO3nEzXY87mHc89lpSNu5un7aLWzOCMEikp rOyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777540109; x=1778144909; 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=77MMcrPtjjHJtpvk4YyZWJja9SciHKl/Y+JyJ79gGCM=; b=ovqicnlzFgJ3nNeDaHbECEvntUlj48xLULiQHVWadLZWlDJORgX6WPz3WftKQdJBH1 cSVcF3YYhIJayP4OZYFENI+hbum3E6fwWaL8zN4ZWuWka6ZoTGfVU1KTucckspYXVRbS 0MeH1yw60vK4v22BiXd3qovO5XBZLMXbF/hJkNyMAMVMpFpLOjA7xs+V55wy04BMsQ8j gH6b+dK1OygSKn8LOkyYA5hlp3zjNdKqlWxgf4RlrDu4C+8bOr/UBYzfLBV8qTPlcs/g tm0QRjHq4libJO2os+fd9tOXvpPogLeZfou20s+QR5F9JQuVO4qDzzZuh/iof9zwUnuy 1zWA== X-Gm-Message-State: AOJu0YwJ9OTay49GfxEEbjtaVjmQ7e3Lvx1Um4gOT/Kt1jM0lhsJWTIn ElesP9M0LBhYThctnOYx7FpYYhqEgFV+Jy3Vkukp8mUW28iO63fkC79zTsKiSMd18mJ15dTUtNj qolr7/vs= X-Gm-Gg: AeBDieu47oJcGM2sJj2DNQA+01NgtZu0uwDOUmIEQTBJTftOiPZVtIAp0h9/7dDk3af 8xNu0oDZyuvvcngE6hDEYh9zFQlzsDa7U7MEuHqSHFICVXD5Sg973UrhpQkD1qdEeSED4Hsxycm fvETeZrPiIMS8CIrZp8OTdgArXzOiZ4e0nxG92+x6WCbE2ieO8GUHnHYM6DTfSTdnX1VuZE4JFl rdMMMY6cvI1/hjc3YKhPYtbzP7n7i/hJZbRBvFeH63kwzIKptN/pWYsDQx951FK0cgl4gOjFS37 7zO6bfljyOyLsTxPMejWSt2C/rHr5xsSvp+Oo65mEWyeDno7zfwL7nXjCBw+TeqxUx90kMjZiRT wOQP1s6gFPCjc4AnxJleoJFDsuDUFzZg4itZRowWQkxQe5byiDWz6aDf98ur7CRK0rsCFiRjorx O8UDsBqwRMtICRes1U4rk/4SUCb7bM5c+9GwC+f3znz8EIVmmMLBiAF9uJuw== X-Received: by 2002:a05:6000:2f8a:b0:43f:e266:4c9c with SMTP id ffacd0b85a97d-4493cb42f8emr3236680f8f.3.1777540108716; Thu, 30 Apr 2026 02:08:28 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-447b3d47f56sm11936287f8f.2.2026.04.30.02.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 02:08:27 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Wolfram Sang Subject: [RFC PATCH] i2c: testunit: Replace system_long_wq with system_dfl_long_wq Date: Thu, 30 Apr 2026 11:08:10 +0200 Message-ID: <20260430090810.109232-1-marco.crivellari@suse.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently the code enqueue work items using {queue|mod}_delayed_work(), using system_long_wq. This workqueue should be used when long works are expected, but it is a per-cpu workqueue. This is important because queue_delayed_work() queue the work using: queue_delayed_work_on(WORK_CPU_UNBOUND, ...); Note that WORK_CPU_UNBOUND = NR_CPUS. This would end up calling __queue_delayed_work() that does: if (housekeeping_enabled(HK_TYPE_TIMER)) { // [....] } else { if (likely(cpu == WORK_CPU_UNBOUND)) add_timer_global(timer); else add_timer_on(timer, cpu); } So when cpu == WORK_CPU_UNBOUND the timer is global and is not using a specific CPU. Later, when __queue_work() is called: if (req_cpu == WORK_CPU_UNBOUND) { if (wq->flags & WQ_UNBOUND) cpu = wq_select_unbound_cpu(raw_smp_processor_id()); else cpu = raw_smp_processor_id(); } Because the wq is not unbound, it takes the CPU where the timer fired and enqueue the work on that CPU. The consequence of all of this is that the work can run anywhere, depending on where the timer fired. Recently, a new unbound workqueue specific for long running work has been added: c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works") So change system_long_wq with system_dfl_long_wq so that the work may benefit from scheduler task placement. Signed-off-by: Marco Crivellari --- drivers/i2c/i2c-slave-testunit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-slave-testunit.c b/drivers/i2c/i2c-slave-testunit.c index 6de4307050dd..c6582ca86c7d 100644 --- a/drivers/i2c/i2c-slave-testunit.c +++ b/drivers/i2c/i2c-slave-testunit.c @@ -124,7 +124,7 @@ static int i2c_slave_testunit_slave_cb(struct i2c_client *client, case I2C_SLAVE_STOP: if (tu->reg_idx == TU_NUM_REGS) { set_bit(TU_FLAG_IN_PROCESS, &tu->flags); - queue_delayed_work(system_long_wq, &tu->worker, + queue_delayed_work(system_dfl_long_wq, &tu->worker, msecs_to_jiffies(10 * tu->regs[TU_REG_DELAY])); } -- 2.53.0