From: Davidlohr Bueso <dave@stgolabs.net>
To: Prakash Sangappa <prakash.sangappa@oracle.com>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
akpm@linux-foundation.org, peterz@infradead.org,
manfred@colorfullife.com
Subject: Re: [PATCH v3] ipc: Update semtimedop() to use hrtimer
Date: Thu, 28 Apr 2022 13:50:01 -0700 [thread overview]
Message-ID: <20220428205001.hiuzwpn5emxtrh4s@offworld> (raw)
In-Reply-To: <1651178767-447-1-git-send-email-prakash.sangappa@oracle.com>
On Thu, 28 Apr 2022, Prakash Sangappa wrote:
>semtimedop() should be converted to use hrtimer like it has been done
>for most of the system calls with timeouts. This system call already
>takes a struct timespec as an argument and can therefore provide finer
>granularity timed wait.
>
>Signed-off-by: Prakash Sangappa <prakash.sangappa@oracle.com>
>Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
>---
>v1->v2:
> - Use timespec64_valid() to validate timeout
> and other changes as suggested by Thomas Gleixner
>v2-v3 Added Reviewed by tag
>---
The second '---' is not necesary, it's the first one that counts.
>@@ -2166,10 +2167,8 @@ long __do_semtimedop(int semid, struct sembuf *sops,
> sem_unlock(sma, locknum);
> rcu_read_unlock();
>
>- if (timeout)
>- jiffies_left = schedule_timeout(jiffies_left);
>- else
>- schedule();
>+ timed_out = !schedule_hrtimeout_range(exp,
>+ current->timer_slack_ns, HRTIMER_MODE_ABS);
I'm wondering if the slack parameter instead of passing the timer_slack_ns
value immediately, we should do a rt_task() check and pass zero if so.
And the opposite for the posix mqueue case: bit a little more lenient when
!rt_task() and pass current->timer_slack_ns instead of zero. Of course mq
is a lot more rt aware than sysv semaphores, but that doesn't mean both forms
of ipc are not seen used with or without RT constraints.
Thanks,
Davidlohr
next prev parent reply other threads:[~2022-04-28 21:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 20:46 Prakash Sangappa
2022-04-28 20:50 ` Davidlohr Bueso [this message]
2022-04-28 22:02 ` Thomas Gleixner
2022-04-28 22:23 ` Prakash Sangappa
2022-04-28 22:41 ` Thomas Gleixner
2022-04-29 17:53 ` Davidlohr Bueso
2022-04-28 22:50 ` Davidlohr Bueso
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=20220428205001.hiuzwpn5emxtrh4s@offworld \
--to=dave@stgolabs.net \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=peterz@infradead.org \
--cc=prakash.sangappa@oracle.com \
--cc=tglx@linutronix.de \
/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®