lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.58.0802220832330.15391@gandalf.stny.rr.com>
Date:	Fri, 22 Feb 2008 08:35:14 -0500 (EST)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	gregory.haskins@...il.com
cc:	Gregory Haskins <ghaskins@...ell.com>, mingo@...e.hu,
	a.p.zijlstra@...llo.nl, tglx@...utronix.de,
	linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org,
	bill.huey@...il.com, kevin@...man.org, cminyard@...sta.com,
	dsingleton@...sta.com, dwalker@...sta.com, npiggin@...e.de,
	dsaxena@...xity.net, ak@...e.de, gregkh@...e.de,
	sdietrich@...ell.com, pmorreale@...ell.com, mkohari@...ell.com
Subject: Re: [PATCH [RT] 05/14] rearrange rt_spin_lock sleep


On Fri, 22 Feb 2008, Gregory Haskins wrote:

> Gregory Haskins wrote:
> > @@ -732,14 +741,15 @@ rt_spin_lock_slowlock(struct rt_mutex *lock)
> >
> >  		debug_rt_mutex_print_deadlock(&waiter);
> >
> > -		schedule_rt_mutex(lock);
> > +		update_current(TASK_UNINTERRUPTIBLE, &saved_state);
>
> I have a question for everyone out there about this particular part of
> the code. Patch 6/14 adds an optimization that is predicated on the
> order in which we modify the state==TASK_UNINTERRUPTIBLE vs reading the
> waiter.task below.
>
> My assumption is that the xchg() (inside update_current()) acts as an
> effective wmb().  If xchg() does not have this property, then this code
> is broken and patch 6/14 should also add a:
>
>
> +               smp_wmb();

I believe that the wmb would be needed. I doubt that xchg on all archs
would force any ordering of reads and writes. It only needs to guarantee the
atomic nature of the data exchange. I don't see any reason that it would
imply any type of memory barrier.

-- Steve


>
>
> > +		if (waiter.task)
> > +			schedule_rt_mutex(lock);
> > +		else
> > +			update_current(TASK_RUNNING_MUTEX, &saved_state);
> >
> >  		spin_lock_irqsave(&lock->wait_lock, flags);
> >  		current->flags |= saved_flags;
> >  		current->lock_depth = saved_lock_depth;
> > -		state = xchg(&current->state, TASK_UNINTERRUPTIBLE);
> > -		if (unlikely(state == TASK_RUNNING))
> > -			saved_state = TASK_RUNNING;
>
>
> Does anyone know the answer to this?
>
> Regards,
> -Greg
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ