From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 46F27421A18 for ; Tue, 26 May 2026 18:08:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779818897; cv=none; b=b1orY6Wa5hqnqkRrFRMOwtl0jo0aTAFIVLTA4NSbfJsgdlghQc3lmDsO3ShyCA3twpd82nIRGsAzHY/Z1K8JgYhzNtciJbeif8GYjKQTDuEiaxbwE6RbIpvMxfG33goZzxNmdPeh8/UqP/WvcOz+v/NvCTlkDkS40hyu5AD1Vjo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779818897; c=relaxed/simple; bh=c2/v1A7hUQnM2bjaGZkqNI3FkAUY/2Pyot9azWyg99Q=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=G4IBCoRlsvDMqGmfZFadPY4A3nmCQfjU/FVIC4hEheR/Y9U1JupcV/4SgvmeomuLnHjYzPRxqe1vo/ptEatcs+NUXFqqnwqXCaIgJhoQfqlN6bU9rS4C6RCY5Wd5bp4D5kDoQMetMm/VsKgnyasGj8NAqN4lqy47UPrVikjkbVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=KdEV6KLR; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="KdEV6KLR" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:From:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=uDwEJ0MyhTT5OEi3N5C+RYUjpTUbLNPZGrkJsMvuMSQ=; b=KdEV6KLRdsl96ttKnx9WKfP+9J tRIUWLa2QxRLYnYXA8OdVHPbmR0qyQnXy4/4d5WmLgKx4Fh0uLeDk5PJnqjGfc4SepELRbWn2qF9l W8b/5t2jHK61eHcJlSl7Y3r+U+7Ph3nFRxwSZxxJljjoYcROllyCevEkOaSV23p/IyPeE++XPrNs7 p0SUaYx06SSUasQ7wcBnZjfI37I8R7pp6bSNiW0oPR2XqFw8aqGKtNox1Y8C3jNgO+1VkwCBSHfXd M1IkfLhsP8JGZPSL+47U7FfWpuAlQuac/oxy+rvmphGY1NLjTFQW4Mw/ga8hIGxzTaCWKwBblbhjy HJO7XcQg==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wRwCH-002Wtq-06; Tue, 26 May 2026 18:08:09 +0000 From: Breno Leitao Subject: [PATCH 0/2] workqueue: Shrink the lock time Date: Tue, 26 May 2026 14:08:04 -0400 Message-Id: <20260526-fastwake-v1-0-e69ad86923e6@debian.org> 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: 7bit X-B4-Tracking: v=1; b=H4sIAIThFWoC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDUyMz3bTE4pLyxOxUXQMjSwujtBQzM2NDIyWg8oKi1LTMCrBR0bEQfnF pUlZqcglIv1JtLQBO5QGHbAAAAA== X-Change-ID: 20260526-fastwake-02982fd66312 To: Tejun Heo , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, marco.crivellari@suse.com, frederic@kernel.org, bigeasy@linutronix.de, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-d5d98 X-Developer-Signature: v=1; a=openpgp-sha256; l=1069; i=leitao@debian.org; h=from:subject:message-id; bh=c2/v1A7hUQnM2bjaGZkqNI3FkAUY/2Pyot9azWyg99Q=; b=owEBbQKS/ZANAwAKATWjk5/8eHdtAcsmYgBqFeGH6B2nhb830X6UXYyx9iMNR35UOSoPZDusA eoECqTOJD2JAjMEAAEKAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCahXhhwAKCRA1o5Of/Hh3 bTIQEACfj5BPlQDaELo4WXDTDcCwQhVtxyxlr+N1+MvsboQY7DpO69uH8JRw1Ibyae32fGtE86X ER1hAm5AUKQLj2v7o73fBMZ3vmbkJtDJdzKC/XEHM3/gGnULNKhewMBh491ye4/xG+djTFCMQCp rt7a7LhtY17HC7RJx+XqQVC7XT5mbTsO9TRBrT5TyQxaTBt7bUJS8+iUS/1hOQILpDUgTHUub4f Eo6WKA6SDYsiLHszpghMhuKdjasCOeELi3gDGVDJtBWGGBITmj9w27YOCBgRDpgrDYH6JfXRh2e OHn09BPeYOpWx63PR2u8mgFouWs4sWVqAcdwitvFdAXD7rARKW5yg6N1BE4RkdwghNZFieIpBpc XwJ4EBCSzsSmyNXkFxFGoV93dU3JoN04FXYMPYZu6rRdWxeDEES3OCROlMWf6XAWpxGy2VLlxcK SnEuVAMlK239WvAFQHeICfjLHmqN/qdtig1AMmas4+MfEPRMgwdoMItqHBD/0KU/nUx0laUs5+0 syZWyn1C0mXTwSe1bkV4wQR4dVXfql/zOXsbEo8x/TmG1iVrKL7Tssjk2kt4Q0ToN8iHsmS1tPE ksKfe9yeMKVqfXZMTEIT4FXtLHdipsM7Msgc4HiSZKaUQW1MmYKweNkGmFWniJFdGxDcWZbDO5C qDUF4lwibCWlWgA== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao The goal of this patchset is to decrease the time spent on the workqueue pool->lock. Currently, the worker process is woken up inside the lock, which can be expensive on some architectures. On arm64, the wake-up issues an IPI when the target CPU is in idle (wfi on arm64), which requires an interrupt to wake it. And also, the rq lock, which will be nested in this case. This series decreases the time spent under pool->lock by waking up the process outside of the lock. This improves the microbenchark we have in lib/ by up to 10%. Signed-off-by: Breno Leitao --- Breno Leitao (2): workqueue: split kick_pool() into kick_pool_pick() + wake_up_process() workqueue: defer wake_up_process() outside pool->lock on hot paths kernel/workqueue.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 8 deletions(-) --- base-commit: c1ecb239fa3456529a32255359fc78b69eb9d847 change-id: 20260526-fastwake-02982fd66312 Best regards, -- Breno Leitao