From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from r3-25.sinamail.sina.com.cn (r3-25.sinamail.sina.com.cn [202.108.3.25]) (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 56A15353A64 for ; Thu, 6 Aug 2026 22:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.108.3.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786057178; cv=none; b=uUdofvCcvJjkPRq+6vzDNlpZhNqMPJZw1FyBTTBcbH9G97r8+6ZVpTmyASihvqo8Yo2fUhVgS0wr2SjJt+oT8mg4hmZC22TEGUye43q+uTIF2PQ6nEefgTuEa9qPCAQUxXyjhteG4ucsblemYqef8n8e16sLjJAxbbkCIg03Ve4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786057178; c=relaxed/simple; bh=rWZfdHIWAxgJxAjMuApbyX3mW1dwgP82qI78rv+BXaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DZ36GBOLowDyTS3BqBMmIyIW6+dc4Oz49D+93RfqdQgnM3cFVi0fFppZ0PJ6ImyYZQwXur80WCHYzjSPab1ZVReb+uCXHbo8S5HeTgtMTAqgVGXpf+Xd+G2aAIjOBhRaeES7JnzBh929vrMGJqlWDEAKq3lJzK6bh9KIg4ZOUbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=UOHyR1Lj; arc=none smtp.client-ip=202.108.3.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="UOHyR1Lj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1786057173; bh=uts6c30ubYq/w5YfEYUuTysAwq9SYY7e6xXpQXVBGEo=; h=From:Subject:Date:Message-ID; b=UOHyR1LjWs2WuYi8lrvp5E0yZEZLfEc9/4OsZ7ArQ5IOHANWk9U7EIz2DnfVT7ewI r1z4EGS3jv12rMRA4Fy06HTDBHcre5S21D9wbDm9V3MaezwZu+Va+c7CYChkX31IWJ B1LBWwAuFPPeHr8Jy9Wfl10+YMNTjCl5H2PysoLk= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([221.216.154.155]) by sina.com (10.54.253.31) with ESMTP id 6A75108A00002CA5; Thu, 7 Aug 2026 06:54:05 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 5444526815960 X-SMAIL-UIID: E2579EF5DE334421B4EF4FB0C0FBD5BE-20260807-065405-1 From: Hillf Danton To: Vinicius Costa Gomes Cc: Peter Zijlstra , K Prateek Nayak , Christoph Lameter , linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] sched/fair: decline WF_SYNC stacking when waker LLC is the busier share Date: Fri, 7 Aug 2026 06:53:50 +0800 Message-ID: <20260806225352.981-1-hdanton@sina.com> In-Reply-To: <87mruz2lfx.fsf@intel.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Thu, 06 Aug 2026 10:44:18 -0700 Vinicius Costa Gomes wrote: >Hillf Danton writes: >> On Tue, 04 Aug 2026 16:14:05 -0700 Vinicius Costa Gomes wrote: >>> Since commit 900bbaae67e9 ("epoll: Add synchronous wakeup support for >>> ep_poll_callback"), epoll driven WF_SYNC wakeups have been "too >>> strong" and could cause tasks to stack on a busy NUMA node while other >>> nodes are relatively idle. >>> >>> As commit 900bbaae67e9 ("epoll: Add synchronous wakeup support for >>> ep_poll_callback") improves real workloads a revert is not the answer. >>> The fix is to make the WF_SYNC "stack on waker" shortcut take into >>> account the load on this and prev's LLC, rejecting the shortcut only >>> when the waker (this) LLC is fully loaded and prev's LLC is less >>> loaded than the waker's. >>> >>> Signed-off-by: Vinicius Costa Gomes >>> --- >>> We received a report of a regression on a openresty based >>> workload (the main metric being tail latencies) on a CWF SNC3 single >>> socket system, the main symptom that we could measure was one node >>> being overloaded while the other nodes were relatively idle. >>> >>> Further investigation showed that spreading the NIC RX interrupts over >>> all NUMA nodes helped. Reverting commit 900bbaae67e9 ("epoll: Add >>> synchronous wakeup support for ep_poll_callback") also helped. >>> >> The irq approach is prefered because anything that gets the eevdf offloaded >> is good, you see it is near to the knowall point, needless to say that they >> lie in different layers and from the scheduling-cpu pov irq is a gray rhino >> in the room while WF_SYNC is a tiger mosquito in the corner at best in your >> case where the mosquito failed to understand your workload. > > I don't think irq spreading across NUMA nodes is that good of an idea on > low loads/by default, as it loses the locality that the kernel (even > with irqbalance) try to maintain. I used that as a hackish way of > testing "if I spread tasks, does it improve the tail latencies?". > Can you specify the root cause of the tail latencies, particularly after spending two minutes thinking if changing config in user space to solve the issue is a light year better than adding a couple lines of code in the wakeup path? > Note that the "local-only reproducer" workload (memcached + > memtier_benchmark) runs over loopback (no NIC irqs here), I pin memtier > (the client) to one NUMA node, leave the server unpinned and I am able > to reproduce the issue: with the RFC patch the tail latencies reduce by > 2-3x. (on the customer workload the impact is even higher) > > My expectation was that the scheduler would be able to say: "ugh, even > though respecting WF_SYNC is good most of the cases, this isn't one of No comment before root cause specified, even if I suspect it sounds like that two CPU cores could not provide line speed 24-port 1000MB ether switch before 2010 while 12 cores could. > them". And this is the spirit of the RFC, showing that those cases > exist and their impact. > > >Cheers, >-- >Vinicius