From: Thomas Gleixner <tglx@linutronix.de>
To: Prakash Sangappa <prakash.sangappa@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"peterz@infradead.org" <peterz@infradead.org>
Subject: Re: [PATCH] ipc: Update semtimedop() to use hrtimer
Date: Thu, 28 Apr 2022 09:47:06 +0200 [thread overview]
Message-ID: <878rrpwsxx.ffs@tglx> (raw)
In-Reply-To: <B8775ABA-892E-40FE-BA0D-A72B635D33A9@oracle.com>
On Wed, Apr 27 2022 at 23:42, Prakash Sangappa wrote:
>> On Apr 27, 2022, at 3:06 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> Converting to ktime first makes this cheaper:
>>
>> expires = ktime_get() + timespec64_to_ns(timeout);
>
> Since user provided timespec is added to current time, shouldn’t it check for overflow?
>
> So, perhaps
>
> expires = ktime_add_safe(ktime_get(), timespec64_to_ns(timeout));
Of course. This was just for illustration and I assumed you figure it
out, which you did. :)
Thanks,
tglx
prev parent reply other threads:[~2022-04-28 7:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 1:51 [PATCH] ipc: Update semtimedop() to use hrtimer Prakash Sangappa
2022-04-25 19:38 ` Prakash Sangappa
2022-04-25 20:50 ` Andrew Morton
2022-04-27 22:06 ` Thomas Gleixner
2022-04-27 23:42 ` Prakash Sangappa
2022-04-28 7:47 ` Thomas Gleixner [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=878rrpwsxx.ffs@tglx \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=prakash.sangappa@oracle.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.