Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757660AbcLOJ3M (ORCPT ); Thu, 15 Dec 2016 04:29:12 -0500 Received: from 92-243-34-74.adsl.nanet.at ([92.243.34.74]:52522 "EHLO mail.osadl.at" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1755483AbcLOJ3J (ORCPT ); Thu, 15 Dec 2016 04:29:09 -0500 Date: Thu, 15 Dec 2016 09:28:30 +0000 From: Nicholas Mc Guire To: Jani Nikula Cc: Nicholas Mc Guire , Daniel Vetter , Shashank Sharma , David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/i915: use udelay for very short delays Message-ID: <20161215092830.GA25458@osadl.at> References: <1481776147-23041-1-git-send-email-hofrat@osadl.org> <87wpf1pnj2.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wpf1pnj2.fsf@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: 1245 Lines: 27 On Thu, Dec 15, 2016 at 11:08:49AM +0200, Jani Nikula wrote: > On Thu, 15 Dec 2016, Nicholas Mc Guire wrote: > > Even on fast systems a 2 microsecond delay is most likely more efficient > > as a busy-wait loop. The overhead of a hrtimer does not seem warranted - > > change this to a udelay(2). > > Similar concerns as in [1]. We don't need the accuracy of udelay() here, > so this boils down to which is the better use of CPU. We could probably > relax the max delay more if that was helpful. But I'm not immediately > sold on "is most likely more efficient" which sounds like a gut feeling. > > I'm sorry it's not clear in my other reply that I do appreciate > addressing incorrect/silly use of usleep_range(); I'm just not (yet) > convinced udelay() is the answer. if the delay is not critical and all that is needed is an assurance that it is greater than X us then usleep_range is fine with a relaxed limit. So from what you wrote my patch proposal is wrong - the udelay() is not the way to got. My intent is to get rid of very small usleep_range() cases so if usleep_range(20,50) causes no issues with this driver and does not induce any performance penalty then that would be the way to go I think. thx! hofrat