All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eliezer Tamir <eliezer.tamir@linux.intel.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Don Skidmore <donald.c.skidmore@intel.com>,
	e1000-devel@lists.sourceforge.net,
	Willem de Bruijn <willemb@google.com>,
	Ben Hutchings <bhutchings@solarflare.com>,
	Andi Kleen <andi@firstfloor.org>, HPA <hpa@zytor.com>,
	Eilon Greenstien <eilong@broadcom.com>,
	Or Gerlitz <or.gerlitz@gmail.com>,
	Amir Vadai <amirv@mellanox.com>,
	Alex Rosenbaum <alexr@mellanox.com>,
	Avner Ben Hanoch <avnerb@mellanox.com>,
	Or Kehati <ork@mellanox.com>,
	sockperf-dev@googlegroups.com,
	Eliezer Tamir <eliezer@tamir.org.il>
Subject: Re: [PATCH v4 net-next 2/4] net: convert low latency sockets to sched_clock()
Date: Fri, 14 Jun 2013 09:14:49 +0300	[thread overview]
Message-ID: <51BAB4D9.2020803@linux.intel.com> (raw)
In-Reply-To: <1371179569.3252.120.camel@edumazet-glaptop>

On 14/06/2013 06:12, Eric Dumazet wrote:
> On Fri, 2013-06-14 at 04:57 +0300, Eliezer Tamir wrote:
>> Use sched_clock() instead of get_cycles().
>> We can use sched_clock() because we don't care much about accuracy.
>> Remove the dependency on X86_TSC
>>
>> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
>> ---
>
>>
>> -static inline bool can_poll_ll(cycles_t end_time)
>> +static inline bool can_poll_ll(u64 end_time)
>>   {
>> -	return !time_after((unsigned long)get_cycles(),
>> +	return !time_after((unsigned long)sched_clock(),
>>   			    (unsigned long)end_time);
>>   }
>
> I do not really understand why you bother to have 64bit wide values,
> and then use these "unsigned long" casts here.
>
> On 32bit arches, this will really limit to 2^31 ns range.
>
> You should instead either :
> - use time_after_64() or
> - explicitly limit sysctl_net_ll_poll range

OK

WARNING: multiple messages have this Message-ID (diff)
From: Eliezer Tamir <eliezer.tamir@linux.intel.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Willem de Bruijn <willemb@google.com>,
	Or Kehati <ork@mellanox.com>, Or Gerlitz <or.gerlitz@gmail.com>,
	e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	HPA <hpa@zytor.com>, Amir Vadai <amirv@mellanox.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Alex Rosenbaum <alexr@mellanox.com>,
	linux-kernel@vger.kernel.org, sockperf-dev@googlegroups.com,
	Avner Ben Hanoch <avnerb@mellanox.com>,
	Andi Kleen <andi@firstfloor.org>,
	Eliezer Tamir <eliezer@tamir.org.il>,
	Ben Hutchings <bhutchings@solarflare.com>,
	Eilon Greenstien <eilong@broadcom.com>,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCH v4 net-next 2/4] net: convert low latency sockets to sched_clock()
Date: Fri, 14 Jun 2013 09:14:49 +0300	[thread overview]
Message-ID: <51BAB4D9.2020803@linux.intel.com> (raw)
In-Reply-To: <1371179569.3252.120.camel@edumazet-glaptop>

On 14/06/2013 06:12, Eric Dumazet wrote:
> On Fri, 2013-06-14 at 04:57 +0300, Eliezer Tamir wrote:
>> Use sched_clock() instead of get_cycles().
>> We can use sched_clock() because we don't care much about accuracy.
>> Remove the dependency on X86_TSC
>>
>> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
>> ---
>
>>
>> -static inline bool can_poll_ll(cycles_t end_time)
>> +static inline bool can_poll_ll(u64 end_time)
>>   {
>> -	return !time_after((unsigned long)get_cycles(),
>> +	return !time_after((unsigned long)sched_clock(),
>>   			    (unsigned long)end_time);
>>   }
>
> I do not really understand why you bother to have 64bit wide values,
> and then use these "unsigned long" casts here.
>
> On 32bit arches, this will really limit to 2^31 ns range.
>
> You should instead either :
> - use time_after_64() or
> - explicitly limit sysctl_net_ll_poll range

OK

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

  reply	other threads:[~2013-06-14  6:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14  1:56 [PATCH v4 net-next 0/4] net: low latency sockets follow ups Eliezer Tamir
2013-06-14  1:56 ` Eliezer Tamir
2013-06-14  1:56 ` [PATCH v4 net-next 1/4] net: change sysctl_net_ll_poll into an unsigned int Eliezer Tamir
2013-06-14  1:56   ` Eliezer Tamir
2013-06-14  3:03   ` Eric Dumazet
2013-06-14  1:57 ` [PATCH v4 net-next 2/4] net: convert low latency sockets to sched_clock() Eliezer Tamir
2013-06-14  1:57   ` Eliezer Tamir
2013-06-14  3:12   ` Eric Dumazet
2013-06-14  3:12     ` Eric Dumazet
2013-06-14  6:14     ` Eliezer Tamir [this message]
2013-06-14  6:14       ` Eliezer Tamir
2013-06-14  1:57 ` [PATCH v4 net-next 3/4] net: remove NET_LL_RX_POLL config menue Eliezer Tamir
2013-06-14  1:57   ` Eliezer Tamir
2013-06-14  1:57 ` [PATCH v4 net-next 4/4] net: add socket option for low latency polling Eliezer Tamir
2013-06-14  1:57   ` Eliezer Tamir
2013-06-14  1:58 ` [PATCH v2 sockperf] sockperf: add SO_LL socketop support 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=51BAB4D9.2020803@linux.intel.com \
    --to=eliezer.tamir@linux.intel.com \
    --cc=alexr@mellanox.com \
    --cc=amirv@mellanox.com \
    --cc=andi@firstfloor.org \
    --cc=avnerb@mellanox.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=donald.c.skidmore@intel.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=eilong@broadcom.com \
    --cc=eliezer@tamir.org.il \
    --cc=eric.dumazet@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=ork@mellanox.com \
    --cc=sockperf-dev@googlegroups.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.