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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 14 Nov 2018 17:04:15 -0800
From:   Davidlohr Bueso <dave@...olabs.net>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     jbaron@...mai.com, viro@...iv.linux.org.uk,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH 2/2] fs/epoll: deal with wait_queue only once

On Wed, 14 Nov 2018, Andrew Morton wrote:

>Why was this moved to before the ep_reset_busy_poll_napi_id() call?
>That movement placed the code ahead of the block comment which serves
>to explain its function.

Yikes, that was a brain fart.

>
>
>This?  Which also fixes that comment and reflows it to use 80 cols.

Looks good, thanks.

>
>--- a/fs/eventpoll.c~fs-epoll-deal-with-wait_queue-only-once-fix
>+++ a/fs/eventpoll.c
>@@ -1787,15 +1787,6 @@ fetch_events:
> 	if (eavail)
> 		goto send_events;
>
>-	if (!waiter) {
>-		waiter = true;
>-		init_waitqueue_entry(&wait, current);
>-
>-		spin_lock_irq(&ep->wq.lock);
>-		__add_wait_queue_exclusive(&ep->wq, &wait);
>-		spin_unlock_irq(&ep->wq.lock);
>-	}
>-
> 	/*
> 	 * Busy poll timed out.  Drop NAPI ID for now, we can add
> 	 * it back in when we have moved a socket with a valid NAPI
>@@ -1804,10 +1795,18 @@ fetch_events:
> 	ep_reset_busy_poll_napi_id(ep);
>
> 	/*
>-	 * We don't have any available event to return to the caller.
>-	 * We need to sleep here, and we will be wake up by
>-	 * ep_poll_callback() when events will become available.
>+	 * We don't have any available event to return to the caller.  We need
>+	 * to sleep here, and we will be woken by ep_poll_callback() when events
>+	 * become available.
> 	 */
>+	if (!waiter) {
>+		waiter = true;
>+		init_waitqueue_entry(&wait, current);
>+
>+		spin_lock_irq(&ep->wq.lock);
>+		__add_wait_queue_exclusive(&ep->wq, &wait);
>+		spin_unlock_irq(&ep->wq.lock);
>+	}
>
> 	for (;;) {
> 		/*
>_
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ