Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758591Ab3FMKJp (ORCPT ); Thu, 13 Jun 2013 06:09:45 -0400 Received: from mga09.intel.com ([134.134.136.24]:12265 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758491Ab3FMKJm (ORCPT ); Thu, 13 Jun 2013 06:09:42 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,857,1363158000"; d="scan'208";a="352778122" Message-ID: <51B99A60.6010605@linux.intel.com> Date: Thu, 13 Jun 2013 13:09:36 +0300 From: Eliezer Tamir User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Daniel Borkmann CC: Stephen Hemminger , David Miller , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jesse.brandeburg@intel.com, donald.c.skidmore@intel.com, e1000-devel@lists.sourceforge.net, willemb@google.com, erdnetdev@gmail.com, bhutchings@solarflare.com, andi@firstfloor.org, hpa@zytor.com, eilong@broadcom.com, or.gerlitz@gmail.com, amirv@mellanox.com, eliezer@tamir.org.il Subject: Re: [PATCH net-next 1/2] net: remove NET_LL_RX_POLL config menue References: <20130611142415.17879.75569.stgit@ladj378.jer.intel.com> <20130611142428.17879.33582.stgit@ladj378.jer.intel.com> <20130612.151205.1822920389019274346.davem@davemloft.net> <20130612190103.1545e310@nehalam.linuxnetplumber.net> <51B92ACE.7000307@linux.intel.com> <51B97C1A.8000302@redhat.com> In-Reply-To: <51B97C1A.8000302@redhat.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: 2370 Lines: 62 On 13/06/2013 11:00, Daniel Borkmann wrote: > On 06/13/2013 04:13 AM, Eliezer Tamir wrote: >> On 13/06/2013 05:01, Stephen Hemminger wrote: >>> On Wed, 12 Jun 2013 15:12:05 -0700 (PDT) >>> David Miller wrote: >>> >>>> From: Eliezer Tamir >>>> Date: Tue, 11 Jun 2013 17:24:28 +0300 >>>> >>>>> depends on X86_TSC >>>> >>>> Wait a second, I didn't notice this before. There needs to be a better >>>> way to test for the accuracy you need, or if the issue is lack of a >>>> proper >>>> API for cycle counter reading, fix that rather than add ugly arch >>>> specific dependencies to generic networking code. >>> >>> This should be sched_clock(), rather than direct TSC access. >>> Also any code using TSC or sched_clock has to be carefully audited to >>> deal with >>> clocks running at different rates on different CPU's. Basically value >>> is only >>> meaning full on same CPU. >> >> OK, >> >> If we covert to sched_clock(), would adding a define such as >> HAVE_HIGH_PRECISION_CLOCK to architectures that have both a high >> precision clock and a 64 bit cycles_t be a good solution? >> >> (if not any other suggestion?) > > Hm, probably cpu_clock() and similar might be better, since they use > sched_clock() in the background when !CONFIG_HAVE_UNSTABLE_SCHED_CLOCK > (meaning when sched_clock() provides synchronized highres time source from > the architecture), and, quoting .... I don't think we want the overhead of disabling IRQs that cpu_clock() adds. We don't really care about precise measurement. All we need is a sane cut-off for busy polling. It's no big deal if on a rare occasion we poll less, or even poll twice the time. As long as it's rare it should not matter. Maybe the answer is not to use cycle counting at all? Maybe just wait the full sk_rcvtimo? (resched() when proper, bail out if signal pending, etc.) This could only be a safe/sane thing to do after we add a socket option, because this can't be a global setting. This would of course turn the option into a flag. If it's set (and !nonblock), busy wait up to sk_recvtimo. Opinions? -- 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/