Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295535

Re: [patch 3/5] futex: Document pi_state refcounting in requeue code

From Darren Hart <dvhart@infradead.org>
Newsgroups linux.kernel
Subject Re: [patch 3/5] futex: Document pi_state refcounting in requeue code
Date 2015-12-20 08:50 +0100
Message-ID <qHGUG-68Q-15@gated-at.bofh.it> (permalink)
References <qHvZf-7LF-5@gated-at.bofh.it> <qHvZg-7LF-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Dec 19, 2015 at 08:07:39PM -0000, Thomas Gleixner wrote:
> Documentation of the pi_state refcounting in the requeue code is non
> existent. Add it.
> 

OK, one nitpic on this one I guess - 80 characters is pretty narrow as it is in
my humble opinion, could we expand the newly added comment blocks to use all of
the 80 character limit?

> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
>  kernel/futex.c |   36 +++++++++++++++++++++++++++++++++---
>  1 file changed, 33 insertions(+), 3 deletions(-)
> 
> --- a/kernel/futex.c
> +++ b/kernel/futex.c

...

> -				/* We got the lock. */
> +				/*
> +				 * We got the lock. We do neither drop
> +				 * the refcount on pi_state nor clear
> +				 * this->pi_state because the waiter
> +				 * needs the pi_state for cleaning up
> +				 * the user space value. It will drop
> +				 * the refcount after doing so.
> +				 */
>  				requeue_pi_wake_futex(this, &key2, hb2);
>  				drop_count++;
>  				continue;
>  			} else if (ret) {
> -				/* -EDEADLK */
> +				/*
> +				 * rt_mutex_start_proxy_lock()
> +				 * detected a potential deadlock when
> +				 * we tried to queue that waiter. Drop
> +				 * the pi_state reference which we
> +				 * took above and remove the pointer
> +				 * to the state from the waiters
> +				 * futex_q object.
> +				 */

Especially the two paragraphs above ^

-- 
Darren Hart
Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[patch 0/5] futex: Plug a pi_state leak and clarify the refcounting Thomas Gleixner <tglx@linutronix.de> - 2015-12-19 21:10 +0100
  [patch 5/5] futex: Cleanup the goto confusion in requeue_pi() Thomas Gleixner <tglx@linutronix.de> - 2015-12-19 21:10 +0100
    Re: [patch 5/5] futex: Cleanup the goto confusion in requeue_pi() Darren Hart <dvhart@infradead.org> - 2015-12-20 06:20 +0100
      Re: [patch 5/5] futex: Cleanup the goto confusion in requeue_pi() Mike Galbraith <umgwanakikbuti@gmail.com> - 2015-12-20 06:50 +0100
        Re: [patch 5/5] futex: Cleanup the goto confusion in requeue_pi() Darren Hart <dvhart@infradead.org> - 2015-12-20 08:40 +0100
      Re: [patch 5/5] futex: Cleanup the goto confusion in requeue_pi() Darren Hart <dvhart@infradead.org> - 2015-12-20 06:50 +0100
    [tip:locking/core] futex:   Cleanup the goto confusion in requeue_pi() tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2015-12-20 14:30 +0100
  [patch 3/5] futex: Document pi_state refcounting in requeue code Thomas Gleixner <tglx@linutronix.de> - 2015-12-19 21:10 +0100
    Re: [patch 3/5] futex: Document pi_state refcounting in requeue code Darren Hart <dvhart@infradead.org> - 2015-12-20 08:50 +0100
    [tip:locking/core] futex:   Document pi_state refcounting in requeue code tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2015-12-20 14:30 +0100
  [patch 1/5] futex: Drop refcount if requeue_pi() acquired the rtmutex Thomas Gleixner <tglx@linutronix.de> - 2015-12-19 21:10 +0100
    [tip:locking/core] futex: Drop refcount if requeue_pi()   acquired the rtmutex tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2015-12-20 14:30 +0100
  [patch 2/5] futex: Rename free_pi_state() to put_pi_state() Thomas Gleixner <tglx@linutronix.de> - 2015-12-19 21:10 +0100
    [tip:locking/core] futex: Rename free_pi_state() to put_pi_state(  ) tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2015-12-20 14:30 +0100
  [patch 4/5] futex: Remove pointless put_pi_state calls in requeue() Thomas Gleixner <tglx@linutronix.de> - 2015-12-19 21:20 +0100
    [tip:locking/core] futex:   Remove pointless put_pi_state calls in requeue() tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2015-12-20 14:30 +0100

csiph-web