From: Thomas Gleixner <tglx@linutronix.de>
To: Darren Hart <dvhltc@us.ibm.com>
Cc: linux-kernel@vger.kernel.org,
Sripathi Kodi <sripathik@in.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
John Stultz <johnstul@us.ibm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Dinakar Guniguntala <dino@in.ibm.com>,
Ulrich Drepper <drepper@redhat.com>,
Eric Dumazet <dada1@cosmosbay.com>, Ingo Molnar <mingo@elte.hu>,
Jakub Jelinek <jakub@redhat.com>,
Sripathi Kodi <sripathik@in.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
John Stultz <johnstul@us.ibm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Dinakar Guniguntala <dino@in.ibm.com>,
Ulrich Drepper <drepper@redhat.com>,
Eric Dumazet <dada1@cosmosbay.com>, Ingo Molnar <mingo@elte.hu>,
Jakub Jelinek <jakub@redhat.com>
Subject: Re: [tip PATCH v6 1/8] RFC: futex: futex_wait_queue_me()
Date: Tue, 31 Mar 2009 08:44:45 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.0903310836500.12916@localhost.localdomain> (raw)
In-Reply-To: <20090330213739.606.85804.stgit@Aeon>
On Mon, 30 Mar 2009, Darren Hart wrote:
> +
> + /* add_wait_queue is the barrier after __set_current_state. */
> + __set_current_state(TASK_INTERRUPTIBLE);
> + add_wait_queue(&q->waiter, &wait);
> + /*
> + * NOTE: we don't remove ourselves from the waitqueue because
> + * we are the only user of it.
> + */
This comment, while correct is at an odd place.
> + /* Arm the timer */
> + if (timeout) {
> + hrtimer_start_expires(&timeout->timer, HRTIMER_MODE_ABS);
> + if (!hrtimer_active(&timeout->timer))
> + timeout->task = NULL;
> + }
> +
> + /*
> + * !plist_node_empty() is safe here without any lock.
> + * q.lock_ptr != 0 is not safe, because of ordering against wakeup.
> + */
> + if (likely(!plist_node_empty(&q->list))) {
> + /*
> + * If the timer has already expired, current will already be
> + * flagged for rescheduling. Only call schedule if there
> + * is no timeout, or if it has yet to expire.
> + */
> + if (!timeout || likely(timeout->task))
Remove the likely(). It does not make sense
> + schedule();
> + }
> + __set_current_state(TASK_RUNNING);
> +}
> +
> static int futex_wait(u32 __user *uaddr, int fshared,
> u32 val, ktime_t *abs_time, u32 bitset, int clockrt)
> {
> - struct task_struct *curr = current;
> + struct hrtimer_sleeper timeout, *to = NULL;
> struct restart_block *restart;
> - DECLARE_WAITQUEUE(wait, curr);
> struct futex_hash_bucket *hb;
> struct futex_q q;
> u32 uval;
> int ret;
> - struct hrtimer_sleeper t;
> - int rem = 0;
>
> if (!bitset)
> return -EINVAL;
>
> q.pi_state = NULL;
> q.bitset = bitset;
> +
> + if (abs_time) {
> + unsigned long slack;
missing new line
> + to = &timeout;
> + slack = current->timer_slack_ns;
> + if (rt_task(current))
> + slack = 0;
Hmm. I thought we would use current->timer_slack_ns ?
Thanks,
tglx
next prev parent reply other threads:[~2009-03-31 6:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-30 21:37 [tip PATCH v6 0/8] requeue pi implementation Darren Hart
2009-03-30 21:37 ` [tip PATCH v6 1/8] RFC: futex: futex_wait_queue_me() Darren Hart
2009-03-31 6:44 ` Thomas Gleixner [this message]
2009-03-31 14:58 ` Darren Hart
2009-03-30 21:37 ` [tip PATCH v6 2/8] RFC: futex: futex_top_waiter() Darren Hart
2009-03-30 21:37 ` [tip PATCH v6 3/8] RFC: futex: futex_lock_pi_atomic() Darren Hart
2009-03-31 6:49 ` Thomas Gleixner
2009-03-31 15:00 ` Darren Hart
2009-03-30 21:38 ` [tip PATCH v6 4/8] RFC: futex: finish_futex_lock_pi() Darren Hart
2009-03-30 21:38 ` [tip PATCH v6 5/8] RFC: rt_mutex: add proxy lock routines Darren Hart
2009-03-30 21:38 ` [tip PATCH v6 6/8] RFC: futex: Add FUTEX_HAS_TIMEOUT flag to restart.futex.flags Darren Hart
2009-03-30 21:40 ` Eric Dumazet
2009-03-30 22:40 ` Darren Hart
2009-03-30 21:38 ` [tip PATCH v6 7/8] RFC: futex: Add requeue_futex() call Darren Hart
2009-03-30 21:38 ` [tip PATCH v6 8/8] RFC: futex: add requeue_pi calls Darren Hart
2009-03-30 21:47 ` Eric Dumazet
2009-03-30 22:44 ` Darren Hart
2009-03-30 23:31 ` Darren Hart
2009-03-31 7:30 ` Thomas Gleixner
2009-03-31 18:16 ` Darren Hart
2009-03-30 21:55 ` glibc hacks for requeue_pi Darren Hart
2009-03-31 2:09 ` [tip PATCH v6 0/8] requeue pi implementation Steven Rostedt
2009-03-31 4:48 ` Darren Hart
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=alpine.LFD.2.00.0903310836500.12916@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=dada1@cosmosbay.com \
--cc=dino@in.ibm.com \
--cc=drepper@redhat.com \
--cc=dvhltc@us.ibm.com \
--cc=jakub@redhat.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sripathik@in.ibm.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
all inboxes | Powered by JetHome®