Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753613AbbETNpM (ORCPT ); Wed, 20 May 2015 09:45:12 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:41218 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070AbbETNpJ (ORCPT ); Wed, 20 May 2015 09:45:09 -0400 Date: Wed, 20 May 2015 15:45:05 +0200 From: Pavel Machek To: "Fu, Zhonghui" Cc: "Rafael J. Wysocki" , len.brown@intel.com, Greg Kroah-Hartman , linux-pm@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] PM / sleep: cancel the synchronous restriction of pm-trace Message-ID: <20150520134505.GA1479@amd> References: <554A297C.2040305@linux.intel.com> <3154303.fma7bByNVc@vostro.rjw.lan> <555C4AC5.4080901@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <555C4AC5.4080901@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1209 Lines: 29 > >> -#define TRACE_DEVICE(dev) do { \ > >> +#define TRACE_DEVICE_START(dev) do { \ > >> if (pm_trace_enabled) \ > >> + mutex_lock(&pt_mutex); \ > >> set_trace_device(dev); \ > >> } while(0) > >> > >> +#define TRACE_DEVICE_END() \ > >> +do { \ > >> + if (pm_trace_enabled) { \ > >> + mutex_unlock(&pt_mutex); \ > >> + } \ > >> +} while (0) > >> + > > Won't this serialize the whole thing again? > Yes, this mutex lock will ultimately serialize all PM operations. But, all device's PM operations are asynchronous each other at first. So, the PM operation order of all devices will vary in multiple suspend/resume. This can be similar to real to an extreme, and helpful to debugging. > I believe the tradeoff here is wrong. Just keep PM_TRACE simple, and use something else for a real tricky failures.. 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/