Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964836AbbLHKtc (ORCPT ); Tue, 8 Dec 2015 05:49:32 -0500 Received: from www.linutronix.de ([62.245.132.108]:45797 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932537AbbLHKta (ORCPT ); Tue, 8 Dec 2015 05:49:30 -0500 Date: Tue, 8 Dec 2015 11:48:39 +0100 (CET) From: Thomas Gleixner To: Aniroop Mathur cc: John Stultz , a.mathur@samsung.com, "linux-kernel@vger.kernel.org" Subject: Re: Ques: [kernel/time/*] Is there any disadvantage in using sleep_range for more than 20ms delay ? In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1448 Lines: 34 On Tue, 8 Dec 2015, Aniroop Mathur wrote: > On Tue, Dec 8, 2015 at 12:07 AM, Thomas Gleixner wrote: > > The real question is how precise must your delay be? If the delay > > needs to be precise within the min/max sleep time limits, then > > usleep_range() is probably the way to go. If the delay can be > > imprecise then using msleep() is the right way because that lets the > > kernel batch timers for power saving purposes. > > Thank you for the answer ! > Normally, we insert delays in driver while enabling the chip. > So here usleep_range seems to service better as we do not want to delay > the initialisation process of chip and make it ready to generate data, > especially for faster devices like sensor. The initialization process is hardly something critical, so why would the delay need to be precise? What's the point of having data 10ms earlier? > One last thing, > Considering HZ=100, would the power saving be same if we set the > range in usleep_range equivalent to msleep ? > For example: msleep (33) and usleep_range(33000, 40000) > So for such case, would both have same impact on power saving ? Probably, but what's the point of doing that? Thanks, tglx -- 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/