Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754093Ab1DOQ5l (ORCPT ); Fri, 15 Apr 2011 12:57:41 -0400 Received: from ksp.mff.cuni.cz ([195.113.26.206]:58866 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752947Ab1DOQ5j (ORCPT ); Fri, 15 Apr 2011 12:57:39 -0400 Date: Fri, 15 Apr 2011 18:57:37 +0200 From: Pavel Machek To: Mike Frysinger Cc: Alan Stern , uclinux-dist-devel@blackfin.uclinux.org, linux-pm@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [uclinux-dist-devel] [linux-pm] freezer: should barriers be smp ? Message-ID: <20110415165737.GA23812@elf.ucw.cz> References: <20110415162938.GA11454@atrey.karlin.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1302 Lines: 30 > >> The existing code is correct but it isn't optimal. > >> > >> wmb() and rmb() are heavy-duty operations, and you don't want to call > >> them when they aren't needed. ?That's exactly what smp_wmb() and > >> smp_rmb() are for -- they call wmb() and rmb(), but only in SMP > >> kernels. > >> > >> Unless you need to synchronize with another processor (not necessarily > >> a CPU, it could be something embedded within a device), you should > >> always use smp_wmb() and smp_rmb() rather than wmb() and rmb(). > > > > Maybe; but this code is not performance critical and I believe being > > obvious here is better... > > isnt it though ? especially when we talk about suspending/resuming on > embedded systems to get more savings over just cpu idle ? we want > that latency to be as low as possible. Feel free to measure the difference. I bet it is lost in noise, freezer just is not _that_ hot path. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- 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/