From: Eliezer Tamir <eliezer.tamir@linux.intel.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: David Miller <davem@davemloft.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
willemb@google.com, erdnetdev@gmail.com, andi@firstfloor.org,
hpa@zytor.com, devel-lists@codyps.com, eliezer@tamir.org.il
Subject: Re: [PATCH v2 net-next] net: convert lls to use time_in_range()
Date: Wed, 03 Jul 2013 10:00:22 +0300 [thread overview]
Message-ID: <51D3CC06.3080509@linux.intel.com> (raw)
In-Reply-To: <1372797778.1919.17.camel@bwh-desktop.uk.level5networks.com>
On 02/07/2013 23:42, Ben Hutchings wrote:
> On Tue, 2013-07-02 at 23:28 +0300, Eliezer Tamir wrote:
>> On 02/07/2013 23:10, Ben Hutchings wrote:
>>> On Tue, 2013-07-02 at 12:49 +0300, Eliezer Tamir wrote:
>>>> Time in range will fail safely if we move to a different cpu with an
>>>> extremely large clock skew.
>>>> Add time_in_range64() and convert lls to use it.
>>>>
>>>> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
>>>> ---
>>>> v1->v2
>>>> fixed double call to sched_clock() in can_poll_ll(), checkpatchisms
>>
>>>> +#define time_in_range64(a, b, c) \
>>>> + (time_after_eq64(a, b) && \
>>>> + time_before_eq64(a, c))
>>> [...]
>>>
>>> Why not make this an inline function, so the caller doesn't need to
>>> worry about repeated evaluation?
>>
>> I was following the conventions in jiffies.h
>> (well almost, I did add a few spaces to make checkpatch happy)
>
> I see, but now you have a good reason to change that convention.
I'm not sure that an inline function is always a win.
Macros do get evaluated at an earlier stage.
Having just the new function use a different convention is plain
wrong, people are virtually guarantied to not notice until they
introduce a bug.
Are you suggesting we convert all of jiffies.h into inline functions?
Invoking the principle of least astonishment, I think it's best to keep
the changes minimal.
Or would you prefer to risk breaking things all over in subtle ways
that are sure to get Linus to go voodoo on your hamster?
I for one care about hamsters.
-Eliezer
prev parent reply other threads:[~2013-07-03 7:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 12:59 [PATCH net-next 0/2] net: lls cleanup patches Eliezer Tamir
2013-06-28 12:59 ` [PATCH net-next 1/2] net: fix LLS debug_smp_processor_id() warning Eliezer Tamir
2013-06-28 16:51 ` Using sched_clock() for polling time limit Ben Hutchings
2013-06-29 18:50 ` Eliezer Tamir
2013-07-01 19:48 ` Ben Hutchings
2013-06-28 12:59 ` [PATCH net-next 2/2] net: avoid calling sched_clock when LLS is off Eliezer Tamir
2013-06-28 14:38 ` Andi Kleen
2013-06-28 14:54 ` Eliezer Tamir
2013-07-01 21:08 ` [PATCH net-next 0/2] net: lls cleanup patches David Miller
2013-07-02 8:38 ` Eliezer Tamir
2013-07-02 8:45 ` Eliezer Tamir
2013-07-02 9:49 ` [PATCH v2 net-next] net: convert lls to use time_in_range() Eliezer Tamir
2013-07-02 19:56 ` David Miller
2013-07-02 20:10 ` Ben Hutchings
2013-07-02 20:28 ` Eliezer Tamir
2013-07-02 20:42 ` Ben Hutchings
2013-07-03 7:00 ` Eliezer Tamir [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=51D3CC06.3080509@linux.intel.com \
--to=eliezer.tamir@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=devel-lists@codyps.com \
--cc=eliezer@tamir.org.il \
--cc=erdnetdev@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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).