Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932857Ab0BYQRv (ORCPT ); Thu, 25 Feb 2010 11:17:51 -0500 Received: from casper.infradead.org ([85.118.1.10]:54412 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932810Ab0BYQRt (ORCPT ); Thu, 25 Feb 2010 11:17:49 -0500 Subject: Re: [PATCH 07/07] printk delay per multi lines From: Peter Zijlstra To: Dave Young Cc: Randy Dunlap , Ingo Molnar , Andrew Morton , Jiri Kosina , Martin Schwidefsky , Hans-Joachim Picht , Simon Kagstrom , David Woodhouse , James Morris , "Eric W. Biederman" , Catalin Marinas , "Paul E. McKenney" , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org In-Reply-To: <20100225154549.GA2710@darkstar> References: <20100225154549.GA2710@darkstar> Content-Type: text/plain; charset="UTF-8" Date: Thu, 25 Feb 2010 17:17:14 +0100 Message-ID: <1267114634.22519.0.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 590 Lines: 17 On Thu, 2010-02-25 at 23:45 +0800, Dave Young wrote: > + if (!atomic_read(&l)) > + atomic_set(&l, printk_delay_lines); That's racy, use atomic_cmpxchg() > + smp_mb__before_atomic_dec(); > + if (atomic_dec_return(&l)) > + return; What's that barrier for? -- 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/