mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ed Cashin <ed.cashin@acm.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, y2038@lists.linaro.org,
	Tina Ruchandani <ruchandani.tina@gmail.com>
Subject: Re: [PATCH] aoe: Use 64-bit timestamp in frame
Date: Mon, 11 May 2015 11:59:04 -0400	[thread overview]
Message-ID: <3cc42168-676a-49da-880f-aacd904e5b31@email.android.com> (raw)
In-Reply-To: <2958316.132LBl1X80@wuerfel>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 2039 bytes --]

I would like to see some performance measurements for this patch on a system with fast storage and multiple 10 GbE links. 

If not, at least a good analysis of the expected performance impact the patch will have on major architectures. 

Tonight I will think about whether the 2038 thing even matters or whether we just need a comment explaining why it's safe.

On May 11, 2015 11:38 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Monday 11 May 2015 08:05:05 Tina Ruchandani wrote: 
> > 'struct frame' uses two variables to store the sent timestamp - 'struct 
> > timeval' and jiffies. jiffies is used to avoid discrepancies caused by 
> > updates to system time. 'struct timeval' uses 32-bit representation for 
> > seconds which will overflow in year 2038. 
> > This patch does the following: 
> > - Replace the use of 'struct timeval' and jiffies with ktime_t, which 
> > is a 64-bit timestamp and is year 2038 safe. 
> > - ktime_t provides both long range (like jiffies) and high resolution 
> > (like timeval). Using ktime_get (monotonic time) instead of wall-clock 
> > time prevents any discprepancies caused by updates to system time. 
> > 
> > Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com> 
>
> Very nice! 
>
> > @@ -499,32 +497,15 @@ resend(struct aoedev *d, struct frame *f) 
> >  static int 
> >  tsince_hr(struct frame *f) 
> >  { 
> > - struct timeval now; 
> > + ktime_t now; 
> >  int n; 
> >  
> > - do_gettimeofday(&now); 
> > - n = now.tv_usec - f->sent.tv_usec; 
> > - n += (now.tv_sec - f->sent.tv_sec) * USEC_PER_SEC; 
> > + now = ktime_get(); 
> > + n = ktime_to_us(ktime_sub(now, f->sent)); 
> >  
>
> I would cut four extra lines by writing this as 
>
> return ktime_us_delta(ktime_get(), f->sent)); 
>
> but the effect is exactly the same. 
>
> With that change, please add 
>
> Reviewed-by: Arnd Bergmann <arnd@arndb.de> 
>
> Arnd 
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2015-05-11 16:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11  2:35 Tina Ruchandani
2015-05-11 15:38 ` Arnd Bergmann
2015-05-11 15:59   ` Ed Cashin [this message]
2015-05-12  1:00 ` Ed Cashin
2015-05-12  9:44   ` Arnd Bergmann
2015-05-12 11:14     ` [Y2038] " Arnd Bergmann
2015-05-13  1:23       ` Ed Cashin
2015-05-13  8:04         ` Arnd Bergmann
2015-05-14  0:47           ` Ed Cashin
2015-05-12 11:21     ` Ed Cashin
2015-05-13  1:26     ` Ed Cashin

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=3cc42168-676a-49da-880f-aacd904e5b31@email.android.com \
    --to=ed.cashin@acm.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruchandani.tina@gmail.com \
    --cc=y2038@lists.linaro.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

all inboxes | Powered by JetHome®