From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765338AbZEAUi4 (ORCPT ); Fri, 1 May 2009 16:38:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763915AbZEAUiq (ORCPT ); Fri, 1 May 2009 16:38:46 -0400 Received: from smtp.ultrahosting.com ([74.213.174.254]:43726 "EHLO smtp.ultrahosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753840AbZEAUip (ORCPT ); Fri, 1 May 2009 16:38:45 -0400 Date: Fri, 1 May 2009 16:28:55 -0400 (EDT) From: Christoph Lameter X-X-Sender: cl@qirst.com To: Mathieu Desnoyers cc: Nick Piggin , Peter Zijlstra , Linux Kernel Mailing List , Yuriy Lalym , ltt-dev@lists.casi.polymtl.ca, Tejun Heo , Ingo Molnar , Linus Torvalds , Andrew Morton Subject: Re: [ltt-dev] [PATCH] Fix dirty page accounting in redirty_page_for_writepage() In-Reply-To: <20090501202400.GA20280@Krystal> Message-ID: References: <20090430065055.GA16277@elte.hu> <20090430141211.GB5922@Krystal> <20090430194158.GB12926@Krystal> <20090430211750.GA19933@Krystal> <20090501192142.GA18339@Krystal> <20090501202400.GA20280@Krystal> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 1 May 2009, Mathieu Desnoyers wrote: > So, back to my original point : do you agree on the usefulness of > separating fallback irq-disabling from the per-cpu atomic construct ? No. Percpu operations are used for statistics and are like atomic operations. Aggregation of these leads to a can of worms that we better leave unopened. > x86 would map : > > percpu_irqsave/restore to "nothing". > percpu_add_return_irq to xadd instruction. It is irq-safe by design. > > Other architectures (fallback) would map > > percpu_irqsave/restore to local_irq_save/restore. > percpu_add_return_irq to var += value; return var; Shudder.... We have explored those types of macros before (while doing fastpath optimization for SLUB) and it significant increases the complexity. People may add additional instructions in between and now interrupts off could be on or off depending on the architecture. Sometimes percpu_irqsave does nothing. Very difficult to ensure that the usage is correct. And we have barely any usage case for such macros.