From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [RFC][PATCH -mm 1/5] PM: Make freeze_processes SMP-safe Date: Mon, 27 Nov 2006 11:50:51 +0100 Message-ID: <20061127105051.GF13648@elf.ucw.cz> References: <200611252210.58203.rjw@sisk.pl> <200611261434.18427.rjw@sisk.pl> <20061126194824.GD12535@elf.ucw.cz> <200611270009.56736.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <200611270009.56736.rjw@sisk.pl> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: suspend-devel-bounces@lists.sourceforge.net Errors-To: suspend-devel-bounces@lists.sourceforge.net To: "Rafael J. Wysocki" Cc: suspend-devel@lists.sourceforge.net, pm list List-Id: linux-pm@vger.kernel.org Hi! > > > @@ -61,10 +60,13 @@ static inline void freeze_process(struct > > > unsigned long flags; > > > > > > if (!freezing(p)) { > > > - freeze(p); > > > - spin_lock_irqsave(&p->sighand->siglock, flags); > > > - signal_wake_up(p, 0); > > > - spin_unlock_irqrestore(&p->sighand->siglock, flags); > > > + rmb(); > > > > If frozen is atomic_t, do we need memory barrier? > > I think so. For example on x86-64 atomic_read() is just a read. Sorry for one more change, but /* set thread flags in other task's structures * - see asm/thread_info.h for TIF_xxxx flags available */ static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag) { set_ti_thread_flag(task_thread_info(tsk), flag); } ...could we use set_tsk_thread_flag and friends to avoid enlarging task struct? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV