Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934846Ab0BZBJv (ORCPT ); Thu, 25 Feb 2010 20:09:51 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:48585 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934832Ab0BZBJt convert rfc822-to-8bit (ORCPT ); Thu, 25 Feb 2010 20:09:49 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=SxIu9+lr3OXexX4hi/juEgU9BVLFgnj+pS0b6zKUzM4oizCb8LjUkdS34jxzWLuF2N kMRAVWu9du12u+9DwWXFecVR0UgWfcQ4gGvbuv9t/Bth59Ytf/DD9hG+w7KOZVNMQ6oI VhpDorLjxBKipq7NvVWr6mt5ieVAA8Dwf5Bic= MIME-Version: 1.0 In-Reply-To: <1267114634.22519.0.camel@laptop> References: <20100225154549.GA2710@darkstar> <1267114634.22519.0.camel@laptop> Date: Fri, 26 Feb 2010 09:09:47 +0800 Message-ID: Subject: Re: [PATCH 07/07] printk delay per multi lines From: Dave Young To: Peter Zijlstra 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 797 Lines: 26 On Fri, Feb 26, 2010 at 12:17 AM, Peter Zijlstra wrote: > 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() Will fix, thanks > >> +               smp_mb__before_atomic_dec(); >> +               if (atomic_dec_return(&l)) >> +                       return; > > What's that barrier for? Will fix, no memory operation here -- Regards dave -- 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/