Re: [PATCH v3] eventpoll: Fix priority inversion problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 10, 2025 at 05:47:57PM +0800, Xi Ruoyao wrote:
> It didn't work :(.

Argh :(

Another possibility is that you are running into event starvation problem.

Can you give the below patch a try? It is not the real fix, the patch hurts
performance badly. But if starvation is really your problem, it should
ameliorate the situation:

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 895256cd2786..0dcf8e18de0d 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1764,6 +1764,8 @@ static int ep_send_events(struct eventpoll *ep,
 		__llist_add(n, &txlist);
 	}
 
+	struct llist_node *shuffle = llist_del_all(&ep->rdllist);
+
 	llist_for_each_entry_safe(epi, tmp, txlist.first, rdllink) {
 		init_llist_node(&epi->rdllink);
 
@@ -1778,6 +1780,13 @@ static int ep_send_events(struct eventpoll *ep,
 		}
 	}
 
+	if (shuffle) {
+		struct llist_node *last = shuffle;
+		while (last->next)
+			last = last->next;
+		llist_add_batch(shuffle, last, &ep->rdllist);
+	}
+
 	__pm_relax(ep->ws);
 	mutex_unlock(&ep->mtx);
 




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux