Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754237AbdCXBYs (ORCPT ); Thu, 23 Mar 2017 21:24:48 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33698 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbdCXBYp (ORCPT ); Thu, 23 Mar 2017 21:24:45 -0400 Message-ID: <1490318682.9687.22.camel@edumazet-glaptop3.roam.corp.google.com> Subject: Re: [net-next PATCH v2 5/8] net: Track start of busy loop instead of when it should end From: Eric Dumazet To: Alexander Duyck Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sridhar.samudrala@intel.com, edumazet@google.com, davem@davemloft.net, linux-api@vger.kernel.org Date: Thu, 23 Mar 2017 18:24:42 -0700 In-Reply-To: <20170323213742.12615.85793.stgit@localhost.localdomain> References: <20170323211820.12615.88907.stgit@localhost.localdomain> <20170323213742.12615.85793.stgit@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 713 Lines: 20 On Thu, 2017-03-23 at 14:37 -0700, Alexander Duyck wrote: > From: Alexander Duyck > > The last bit I changed is to move from using a shift by 10 to just using > NSEC_PER_USEC and using multiplication for any run time calculations and > division for a few compile time ones. This should be more accurate and > perform about the same on most architectures since modern CPUs typically > handle multiplication without too much overhead. busy polling thread can be preempted for more than 2 seconds. Using usec instead of nanoseconds gave us 3 orders of magnitude cushion. We do not need nsec accuracy for busy polling users, if this restricts range and usability under stress.