From: Eric Dumazet <eric.dumazet@gmail.com>
To: Johannes Lundberg <jlundberg@llnw.com>,
Eric Dumazet <edumazet@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
David Ahern <dsahern@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Florian Westphal <fw@strlen.de>,
Alexander Aring <aahringo@redhat.com>,
Tonghao Zhang <xiangxia.m.yue@gmail.com>,
Yangbo Lu <yangbo.lu@nxp.com>,
Thomas Gleixner <tglx@linutronix.de>,
netdev <netdev@vger.kernel.org>,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH] fs: eventpoll: add empty event
Date: Mon, 27 Sep 2021 14:33:53 -0700 [thread overview]
Message-ID: <dc5ddf13-b524-42a8-ed7a-5db91aaee4ef@gmail.com> (raw)
In-Reply-To: <c675343d-a5bc-dce0-bcde-8a952682e698@llnw.com>
On 9/27/21 2:17 PM, Johannes Lundberg wrote:
>
> On 9/27/21 1:47 PM, Eric Dumazet wrote:
>> On Mon, Sep 27, 2021 at 1:30 PM Johannes Lundberg <jlundberg@llnw.com> wrote:
>>> The EPOLLEMPTY event will trigger when the TCP write buffer becomes
>>> empty, i.e., when all outgoing data have been ACKed.
>>>
>>> The need for this functionality comes from a business requirement
>>> of measuring with higher precision how much time is spent
>>> transmitting data to a client. For reference, similar functionality
>>> was previously added to FreeBSD as the kqueue event EVFILT_EMPTY.
>>
>> Adding yet another indirect call [1] in TCP fast path, for something
>> (measuring with higher precision..)
>> which is already implemented differently in TCP stack [2] is not desirable.
>>
>> Our timestamping infrastructure should be ported to FreeBSD instead :)
>>
>> [1] CONFIG_RETPOLINE=y
>>
>> [2] Refs :
>> commit e1c8a607b28190cd09a271508aa3025d3c2f312e
>> net-timestamp: ACK timestamp for bytestreams
>> tools/testing/selftests/net/txtimestamp.c
>
> Hi Eric
>
> Thanks for the feedback! If there's a way to achieve the same thing with current Linux I'm all for it. I'll look into how to use timestamps for this.
>
You are welcome !
Note that timestamping allows to trigger many events, even if write queue is not empty.
This is particularly useful when an application does not want a write queue to be drained,
since this would add transmit stalls.
Also, since the events are time stamped exactly when the relevant ACK are processed,
they are more accurate than something based on epoll, since I guess you would
get timestamps after a thread wakeup.
prev parent reply other threads:[~2021-09-27 21:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 20:29 [PATCH] fs: eventpoll: add empty event Johannes Lundberg
2021-09-27 20:47 ` Eric Dumazet
2021-09-27 21:17 ` Johannes Lundberg
2021-09-27 21:33 ` Eric Dumazet [this message]
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=dc5ddf13-b524-42a8-ed7a-5db91aaee4ef@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=aahringo@redhat.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=jlundberg@llnw.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tglx@linutronix.de \
--cc=willemb@google.com \
--cc=xiangxia.m.yue@gmail.com \
--cc=yangbo.lu@nxp.com \
--cc=yoshfuji@linux-ipv6.org \
/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;
as well as URLs for NNTP newsgroup(s).