Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760514AbXLTTOF (ORCPT ); Thu, 20 Dec 2007 14:14:05 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756749AbXLTTNv (ORCPT ); Thu, 20 Dec 2007 14:13:51 -0500 Received: from mga10.intel.com ([192.55.52.92]:4225 "EHLO fmsmga102.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754276AbXLTTNu (ORCPT ); Thu, 20 Dec 2007 14:13:50 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.24,191,1196668800"; d="scan'208";a="247942571" Message-ID: <476ABE7D.60901@linux.intel.com> Date: Thu, 20 Dec 2007 20:11:57 +0100 From: Arjan van de Ven User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: "Kok, Auke" CC: Stephen Hemminger , parag.warudkar@gmail.com, netdev@vger.kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sky2: Use deferrable timer for watchdog References: <20071220091603.0d69b045@deepthought> <823114761-1198171803-cardhu_decombobulator_blackberry.rim.net-937108990-@bxe019.bisx.prod.on.blackberry> <20071220095121.7859c023@deepthought> <476ABDDF.8080607@intel.com> In-Reply-To: <476ABDDF.8080607@intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2433 Lines: 51 >>> My interpretation of the api is: >>> * round_jiffies() - timer wants to wakeup but isn't precise about when so schedule >>> on next second when system will wake up anyway; >>> e.g why meetings are usually scheduled on the hour >>> >>> * deferrable - timer doesn't have to really wakeup but wants to happen near >>> a particular time. e.g. "I'll meet you at the pub around 8pm" this is not correct. deferrable means "if you're busy wake me up at this time. But if not, don't bother waking up for me, get to it later". The "later" can be a LONG time later, several seconds easily, if not more. (timers are on a per cpu bases, and you may end up with a several-core system where the common timers are all on another cpu than this one) >> If this is the case then the whole usage of round_jiffies() is bogus. All users of round_jiffies() >> should just be converted to deferrable?? I am a bit concerned that if deferrable gets used everywhere >> then a strange situation would occur where all timers were waiting for some other timer to finally >> happen, kind of a wierd timelock situation. Like the old chip/dale cartoon: >> "you first, no you first, after you mister chip, no after you mister dale,..." > > > > that's a dangerous situation indeed and I'd really like to know what the limits > are for deferring deferrable timers.... Arjan, do you know? Anyone? there is NO limit to deferring a timer. Do NOT use a deferrable timer if you can't afford the timer to not happen within.. 10 to 100 seconds! (or more) They are really meant for things where you CAN afford for it to not happen when you're idle.... > > I don't see a danger just yet on normal systems - I get something like 10 wakeups > per second from just the kernel (acpi, ahci, usb) on most my systems which > guarantees that the watchdog runs often enough, but for embedded systems and > critical timers in other drivers this may be an issue quickly on my work desktop test box the average time between cpu wakeups is 1.4 seconds (and that's single core). It would be higher if it wasn't for some hpet limit issues. -- 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/