[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131210173250.GA25934@redhat.com>
Date: Tue, 10 Dec 2013 18:32:51 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org,
laijs@...fujitsu.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
josh@...htriplett.org, niv@...ibm.com, tglx@...utronix.de,
peterz@...radead.org, rostedt@...dmis.org, dhowells@...hat.com,
edumazet@...gle.com, darren@...art.com, fweisbec@...il.com,
sbw@....edu, Linux-Arch <linux-arch@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH v5 tip/core/locking 6/7] locking: Add an
smp_mb__after_unlock_lock() for UNLOCK+LOCK barrier
On 12/10, Paul E. McKenney wrote:
>
> On Tue, Dec 10, 2013 at 06:04:04PM +0100, Oleg Nesterov wrote:
> >
> > I am wondering, perhaps smp_mb__after_unlock() makes more sense?
> >
> > Note that it already has the potential user:
> >
> > --- x/kernel/sched/wait.c
> > +++ x/kernel/sched/wait.c
> > @@ -176,8 +176,9 @@ prepare_to_wait(wait_queue_head_t *q, wa
> > spin_lock_irqsave(&q->lock, flags);
> > if (list_empty(&wait->task_list))
> > __add_wait_queue(q, wait);
> > - set_current_state(state);
> > + __set_current_state(state);
> > spin_unlock_irqrestore(&q->lock, flags);
> > + smp_mb__after_unlock();
> > }
> > EXPORT_SYMBOL(prepare_to_wait);
> >
> > @@ -190,8 +191,9 @@ prepare_to_wait_exclusive(wait_queue_hea
> > spin_lock_irqsave(&q->lock, flags);
> > if (list_empty(&wait->task_list))
> > __add_wait_queue_tail(q, wait);
> > - set_current_state(state);
> > + __set_current_state(state);
> > spin_unlock_irqrestore(&q->lock, flags);
> > + smp_mb__after_unlock();
> > }
> > EXPORT_SYMBOL(prepare_to_wait_exclusive);
> >
> >
> > Assuming it can also be used "later", after another LOCK, like in
> > your example in 5/7.
>
> I am fine either way. But there was an objection to tying this to the
> unlock because it costs more on many architectures than tying this to
> the lock.
OK, I see, thanks.
> But if you are saying "in addition to" rather than "instead of" that
> would be a different conversation.
Yes, please forget for now.
Oleg.
--
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