From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 749483FB7DB for ; Fri, 8 May 2026 15:03:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778252622; cv=none; b=r6N/fgbg86KJktCuXhN3yG0yt0x+yv9kbOSw2WkLx/Lb5AiTprSjPaiass8+otCYHJ/+mzv+OB+oNchno9MtaL1jlzo9a/Infilt/gfxjHTCF2rqdW/cteAaAUzmtDrf/jee1kSwRyrO3o63P78qouzXKNBVwoqCRVPD+yu0itM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778252622; c=relaxed/simple; bh=CmXKNxz6FTs7pNnshTPQTPN/nc6ElnxcOs1MLuWqffc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=p0EYMd/C9RVOjd8lx0+Xcz0yX9L4h4ywKljYFE2hqy9NOedGUwrsvfodgyRMt/RIVXeGrKDaWEy1gVhbi2tniMJTnBZuHcJIT9xvdcVzX3EQzSwhmEBHCg/zwvAgevNN2nVNHkulHa3HWJTQcldY0YHU/k5W5ayyj8rtBCLueVw= 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=YoKHiODu; arc=none smtp.client-ip=209.85.221.43 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="YoKHiODu" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-44a5174670eso1273720f8f.1 for ; Fri, 08 May 2026 08:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1778252620; x=1778857420; 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=Pb9t9V8pd/4iFj22i4TkGprC/oaCqwOf/T25xMBCN4c=; b=YoKHiODufoej/hlF6MX/9xDUc3VuPgZduF/3Kc4uHqUNmb+U6fin9Gh8wynt/PPxAY tqDd2i66vtlBYC+poctSxEAXgRwMMQs10bX3qcrOKsyri52EJ96UCaqbITp3lhUHIiyl zKDBaWdMjegxcYubNjPP2pnA2tOejp0CELGKLECMtthizV+DYSX+oS1YVTyKA74IqWkC AHQgvDS+Mo+BM3T/jX6kK9qC+1S9nQOk9P5JZQWPF11etpJKn/uRXlCJowprpSRzX5EU bKVc5VPaI/9IhiZck2zKLZ77C4P7UcFMQPBixQYO5cuS5cAYPCH7LOWXH9v49lr9MdMm lCDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778252620; x=1778857420; 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=Pb9t9V8pd/4iFj22i4TkGprC/oaCqwOf/T25xMBCN4c=; b=YOfE8VboWwbxC0G4Y52MeflV6jea/G6iWuSCeO8qiZs8pm2H2YOC5bY/Ece0v76T6i P9XzBvXbNhCW3dKH3F6SqUKhpv5kORaKnSIXia906zeWURUjMg4xYASS8UNPpnsMuLFI McRBgNsjAOCh+JH1/2Zut7jaa9msAkDiy2dSgs3vUiTsbagAv6b1Cr9PQa66EadeZoiH f5eUUNGA9/Iyi4SSGVHiQOJ4eYHEtkZGTLbKhNm+W5UfdK/UGahPnq8E5NmeN2eXDs+u 44cguL0jzGTseL4ej6l7yBvtvFq4g6tvGqzy81c26MtNKL+ugoTWQ6eca2OeCfmGQTIr DIGQ== X-Gm-Message-State: AOJu0Ywer5cY50vbDTDNIWk5/ylnXIH83N/wy1D9qgQmMkfUfKKqZufn I2kAeViqeCBXs5EwPGTlep430zoDisWlHUrzdMb1D/CcVbdHzJuI3JaMMXKMRF+bOJfGG1hN3+L 3GkaM+E4= X-Gm-Gg: Acq92OGZZVqSdHXD813gBkNnmEB9w8uE5SziLqzZhuv9Ktlxi4EUJ/TStSQhIAdK2E5 9XtnUgV1s8UqkC756VI9v0RM77VEUb3/RMpz9k5+IHENd00jFjeL69/J21Xv9KFj7koHrm6pbom F7/7oPsx3ckJ38/JD6eHqCK7N1RV9d0mg295RFXzVDBHqegwigrAnPFbzXo3agI1XQh1izfdkTG qAmSm9OPV5/AQJGOuR09LzNvj/xZZX+xaIFaWQC68+NrCd1trrkwESuwH30sTvsIRhiJazFmudx 1SucUNfH9/jX7VrNjyVI5blwZRiQ+ABc5/aPLCrpbrxznHPhLizchPnbPs4sACaglvahMNoswt6 XpI6h9Eoq591vidcfZHMap/cQRI1nrziwKM4Cvn439gpLti2gKYvQfT5V8Sz2aS5oWCrzidQl+H lZn/67x0JT4UzcggUes/2CAtHcMVYoByyH77WoaI0noYJzKmg= X-Received: by 2002:a05:6000:2910:b0:43d:c95c:4259 with SMTP id ffacd0b85a97d-4515d3dc52fmr20283278f8f.30.1778252619480; Fri, 08 May 2026 08:03:39 -0700 (PDT) Received: from localhost.localdomain ([2a00:6d43:105:c401:e307:1a37:2e76:ce91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45491ca2fd6sm5262918f8f.30.2026.05.08.08.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2026 08:03:38 -0700 (PDT) From: Marco Crivellari To: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org Cc: Tejun Heo , Lai Jiangshan , Frederic Weisbecker , Sebastian Andrzej Siewior , Marco Crivellari , Michal Hocko , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , David Rhodes , Oder Chiou , patches@opensource.cirrus.com, Richard Fitzgerald Subject: [RFC PATCH 0/2] ASoC: Move system_long_wq to system_dfl_long_wq Date: Fri, 8 May 2026 17:03:17 +0200 Message-ID: <20260508150327.351779-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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello, Currently the code uses the per-cpu workqueue system_long_wq to schedule long running works. Unbound works could benefit from scheduler task placement, to optimize performance and power consumption. Another good reason to have this unbound, is the "queue_delayed_work()" function, used to enqueue the work item. More details on this will follow in the next section. Recently, a new unbound workqueue specific for long running work has been added: c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works") ~~~ Details about queue_delayed_work ~~~ system_long_wq is a per-cpu workqueue and it is used as a parameter of queue_delayed_work(). This function schedule an item that it will later be enqueued (once the timer will fire). __queue_delayed_work() does the job receiving as "cpu" WORK_CPU_UNBOUND: if (housekeeping_enabled(HK_TYPE_TIMER)) { // [....] } else { if (likely(cpu == WORK_CPU_UNBOUND)) add_timer_global(timer); else add_timer_on(timer, cpu); } The timer is global, so can fire everywhere, and the work item will be enqueued where the timer fired. Since the workqueue work doesn't rely on per-cpu variables, there is no obvious reason that justify the use of a per-cpu workqueue. So change the workqueue with the new system_dfl_long_wq, so that the used workqueue is now unbound and can benefit from scheduler task placement. Thanks! Marco Crivellari (2): ASoC: cs42l43: Move long delayed work on system_dfl_long_wq ASoC: codecs: rt5640: Move long delayed work on system_dfl_long_wq sound/soc/codecs/cs42l43-jack.c | 5 +++-- sound/soc/codecs/rt5640.c | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) -- 2.53.0