lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241231202431.GA1009@redhat.com>
Date: Tue, 31 Dec 2024 21:24:31 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Manfred Spraul <manfred@...orfullife.com>,
	WangYuli <wangyuli@...ontech.com>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Christian Brauner <brauner@...nel.org>, 1vier1@....de
Subject: Re: [RESEND PATCH] fs/pipe: Introduce a check to skip sleeping
 processes during pipe read/write

On 12/31, Linus Torvalds wrote:
>
> Oleg's patch to only wake up writers when readers have actually opened
> up a slot may not make any actual difference (because readers in
> *practice* always do big reads),

Yes, yes, that patch is mostly cleanup/simplification. I'll write the
changelog and send it after the holidays. Plus probably another one to fix
the theoretical problem (I need to recheck) in wakeup_pipe_readers/writers.

But let me ask another question right now. what do you think about another
minor change below?

Again, mostly to make this logic more understandable. Although I am not
sure I really understand it...

Oleg.

diff --git a/fs/pipe.c b/fs/pipe.c
index 82fede0f2111..ac3e7584726a 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -661,8 +661,11 @@ pipe_poll(struct file *filp, poll_table *wait)
 	struct pipe_inode_info *pipe = filp->private_data;
 	unsigned int head, tail;
 
+#ifdef CONFIG_EPOLL
 	/* Epoll has some historical nasty semantics, this enables them */
-	WRITE_ONCE(pipe->poll_usage, true);
+	if ((filp->f_mode & FMODE_READ) && filp->f_ep)
+		WRITE_ONCE(pipe->poll_usage, true);
+#endif
 
 	/*
 	 * Reading pipe state only -- no need for acquiring the semaphore.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ