From: Eliezer Tamir <eliezer.tamir@linux.intel.com>
To: Daniel Borkmann <dborkman@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
David Miller <davem@davemloft.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
jesse.brandeburg@intel.com, donald.c.skidmore@intel.com,
e1000-devel@lists.sourceforge.net, willemb@google.com,
erdnetdev@gmail.com, bhutchings@solarflare.com,
andi@firstfloor.org, hpa@zytor.com, eilong@broadcom.com,
or.gerlitz@gmail.com, amirv@mellanox.com, eliezer@tamir.org.il
Subject: Re: [PATCH net-next 1/2] net: remove NET_LL_RX_POLL config menue
Date: Thu, 13 Jun 2013 13:09:36 +0300 [thread overview]
Message-ID: <51B99A60.6010605@linux.intel.com> (raw)
In-Reply-To: <51B97C1A.8000302@redhat.com>
On 13/06/2013 11:00, Daniel Borkmann wrote:
> On 06/13/2013 04:13 AM, Eliezer Tamir wrote:
>> On 13/06/2013 05:01, Stephen Hemminger wrote:
>>> On Wed, 12 Jun 2013 15:12:05 -0700 (PDT)
>>> David Miller <davem@davemloft.net> wrote:
>>>
>>>> From: Eliezer Tamir <eliezer.tamir@linux.intel.com>
>>>> Date: Tue, 11 Jun 2013 17:24:28 +0300
>>>>
>>>>> depends on X86_TSC
>>>>
>>>> Wait a second, I didn't notice this before. There needs to be a better
>>>> way to test for the accuracy you need, or if the issue is lack of a
>>>> proper
>>>> API for cycle counter reading, fix that rather than add ugly arch
>>>> specific dependencies to generic networking code.
>>>
>>> This should be sched_clock(), rather than direct TSC access.
>>> Also any code using TSC or sched_clock has to be carefully audited to
>>> deal with
>>> clocks running at different rates on different CPU's. Basically value
>>> is only
>>> meaning full on same CPU.
>>
>> OK,
>>
>> If we covert to sched_clock(), would adding a define such as
>> HAVE_HIGH_PRECISION_CLOCK to architectures that have both a high
>> precision clock and a 64 bit cycles_t be a good solution?
>>
>> (if not any other suggestion?)
>
> Hm, probably cpu_clock() and similar might be better, since they use
> sched_clock() in the background when !CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
> (meaning when sched_clock() provides synchronized highres time source from
> the architecture), and, quoting ....
I don't think we want the overhead of disabling IRQs
that cpu_clock() adds.
We don't really care about precise measurement.
All we need is a sane cut-off for busy polling.
It's no big deal if on a rare occasion we poll less,
or even poll twice the time.
As long as it's rare it should not matter.
Maybe the answer is not to use cycle counting at all?
Maybe just wait the full sk_rcvtimo?
(resched() when proper, bail out if signal pending, etc.)
This could only be a safe/sane thing to do after we add
a socket option, because this can't be a global setting.
This would of course turn the option into a flag.
If it's set (and !nonblock), busy wait up to sk_recvtimo.
Opinions?
next prev parent reply other threads:[~2013-06-13 10:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-11 14:24 [PATCH net-next 0/2] net: low latency sockets follow ups Eliezer Tamir
2013-06-11 14:24 ` [PATCH net-next 1/2] net: remove NET_LL_RX_POLL config menue Eliezer Tamir
2013-06-12 22:12 ` David Miller
2013-06-13 2:01 ` Stephen Hemminger
2013-06-13 2:13 ` Eliezer Tamir
2013-06-13 8:00 ` Daniel Borkmann
2013-06-13 10:09 ` Eliezer Tamir [this message]
2013-06-11 14:24 ` [PATCH net-next 2/2] net:add socket option for low latency polling Eliezer Tamir
2013-06-11 14:45 ` Eric Dumazet
2013-06-11 15:37 ` Eliezer Tamir
2013-06-11 15:58 ` Eric Dumazet
2013-06-11 20:24 ` Ben Hutchings
2013-06-12 6:39 ` Eliezer Tamir
2013-06-11 14:26 ` [PATCH] sockperf: add SO_LL socketop support Eliezer Tamir
2013-06-12 8:36 ` Amir Vadai
2013-06-12 8:45 ` Eliezer Tamir
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=51B99A60.6010605@linux.intel.com \
--to=eliezer.tamir@linux.intel.com \
--cc=amirv@mellanox.com \
--cc=andi@firstfloor.org \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=donald.c.skidmore@intel.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=eilong@broadcom.com \
--cc=eliezer@tamir.org.il \
--cc=erdnetdev@gmail.com \
--cc=hpa@zytor.com \
--cc=jesse.brandeburg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=or.gerlitz@gmail.com \
--cc=stephen@networkplumber.org \
--cc=willemb@google.com \
/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).