public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Arve Hjønnevåg" <arve@android.com>, NeilBrown <neilb@suse.de>,
	LKML <linux-kernel@vger.kernel.org>,
	"Jiri Slaby" <jirislaby@gmail.com>,
	"Linux PM list" <linux-pm@vger.kernel.org>
Subject: Re: [-next regression] TCP window full with EPOLLWAKEUP
Date: Mon, 21 May 2012 15:55:18 +0200	[thread overview]
Message-ID: <4FBA4946.8080905@suse.cz> (raw)
In-Reply-To: <201205202034.24541.rjw@sisk.pl>

On 05/20/2012 08:34 PM, Rafael J. Wysocki wrote:
> On Sunday, May 20, 2012, Rafael J. Wysocki wrote:
>> On Sunday, May 20, 2012, Rafael J. Wysocki wrote:
>>> On Sunday, May 20, 2012, Jiri Slaby wrote:
>>>> Hi,
>>>>
>>>> a bisection shows that with the following commit from -next:
>>>> commit 4d7e30d98939a0340022ccd49325a3d70f7e0238
>>>> Author: Arve Hjønnevåg <arve@android.com>
>>>> Date:   Tue May 1 21:33:34 2012 +0200
>>>>
>>>>     epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll
>>>> events are ready
>>>>
>>>> ====
>>>>
>>>> one of mono programs I use stops receiving data from the network.
>>>> Wireshark shows that the TCP window of a connection is filled. This
>>>> means the program does not read the data fast enough after requesting
>>>> the data.
>>>>
>>>> If I revert that commit on the top of -next (20120518), everything works
>>>> as expected.
>>>
>>> Hmm.  I suppose that the failing program doesn't set EPOLLWAKEUP by mistake,
>>> does it?
>>
>> If it doesn't, we can assume that epi-ws is always NULL and all of the added
>> overhead comes from the function calls.  So, I wonder if the appended patch
>> makes any difference?
> 
> Having thought more about this I have to say this doesn't seem to make much
> sense, because in that case you'd see some progress, although probably a bit
> slower than before.
> 
> So, I think what happens is that the application tries to set EPOLLWAKEUP,
> but doesn't have the capability, so the entire operation fails for it, but
> it doesn't check the return value.
> 
> I wonder if the following helps, then.
> 
> Thanks,
> Rafael
> 
> 
> ---
>  fs/eventpoll.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux/fs/eventpoll.c
> ===================================================================
> --- linux.orig/fs/eventpoll.c
> +++ linux/fs/eventpoll.c
> @@ -1711,7 +1711,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, in
>  
>  	/* Check if EPOLLWAKEUP is allowed */
>  	if ((epds.events & EPOLLWAKEUP) && !capable(CAP_EPOLLWAKEUP))
> -		goto error_tgt_fput;
> +		epds.events &= ~EPOLLWAKEUP;

Yes, this fixed the issue.

thanks,
-- 
js
suse labs



  reply	other threads:[~2012-05-21 13:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-19 22:06 [-next regression] TCP window full with EPOLLWAKEUP Jiri Slaby
2012-05-20 12:23 ` Rafael J. Wysocki
2012-05-20 12:53   ` Rafael J. Wysocki
2012-05-20 18:34     ` Rafael J. Wysocki
2012-05-21 13:55       ` Jiri Slaby [this message]
2012-05-21 19:11         ` Rafael J. Wysocki
2012-05-21 19:28           ` [PATCH] epoll: Fix user space breakage related to EPOLLWAKEUP (was: Re: [-next regression] TCP window full with EPOLLWAKEUP) Rafael J. Wysocki
2012-05-21 22:11             ` Arve Hjønnevåg
2012-05-22 15:56               ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FBA4946.8080905@suse.cz \
    --to=jslaby@suse.cz \
    --cc=arve@android.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox