Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756771AbYKKNtV (ORCPT ); Tue, 11 Nov 2008 08:49:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755954AbYKKNtL (ORCPT ); Tue, 11 Nov 2008 08:49:11 -0500 Received: from viefep18-int.chello.at ([213.46.255.22]:54468 "EHLO viefep18-int.chello.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755317AbYKKNtK (ORCPT ); Tue, 11 Nov 2008 08:49:10 -0500 X-SourceIP: 213.46.9.244 Subject: Re: [Bug #11989] Suspend failure on NForce4-based boards due to chanes in stop_machine From: Peter Zijlstra To: Vegard Nossum Cc: Ingo Molnar , "Rafael J. Wysocki" , Heiko Carstens , Linux Kernel Mailing List , Kernel Testers List , Rusty Russell , Oleg Nesterov , Dmitry Adamushko , Andrew Morton In-Reply-To: <19f34abd0811110536i71994436q4aa78a99d201c478@mail.gmail.com> References: <20081110120401.GA15518@osiris.boeblingen.de.ibm.com> <200811101547.21325.rjw@sisk.pl> <200811102355.42389.rjw@sisk.pl> <20081111105214.GA15645@elte.hu> <19f34abd0811110536i71994436q4aa78a99d201c478@mail.gmail.com> Content-Type: text/plain Date: Tue, 11 Nov 2008 14:49:01 +0100 Message-Id: <1226411341.7685.1779.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1338 Lines: 46 On Tue, 2008-11-11 at 14:36 +0100, Vegard Nossum wrote: > On Tue, Nov 11, 2008 at 11:52 AM, Ingo Molnar wrote: > > [ Cc:-ed workqueue/locking/suspend-race-condition experts. ] > > Heh. I am not expert, but I looked at the code. The obvious suspicious > thing to see is the use of unpaired barriers? Maybe like this: > > 47 static void set_state(enum stopmachine_state newstate) > 48 { > 49 /* Reset ack counter. */ > 50 atomic_set(&thread_ack, num_threads); > 51 smp_wmb(); > > + /* force ordering between thread_ack/state */ > > 52 state = newstate; > 53 } > 54 > 55 /* Last one to ack a state moves to the next state. */ > 56 static void ack_state(void) > 57 { > 58 if (atomic_dec_and_test(&thread_ack)) > > Maybe > + /* force ordering between thread_ack/state */ > + smp_rmb(); > here? all atomic ops that have return values imply a full barrier, iirc > 59 set_state(state + 1); > 60 } > 61 > > Or maybe I am wrong. But Documentation/memory-barriers.txt is rather > explicit on this point. > > > Vegard > -- 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/