From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755227Ab3ADRAe (ORCPT ); Fri, 4 Jan 2013 12:00:34 -0500 Received: from mail-da0-f43.google.com ([209.85.210.43]:53901 "EHLO mail-da0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755119Ab3ADRA2 (ORCPT ); Fri, 4 Jan 2013 12:00:28 -0500 Subject: Re: [PATCH v2 net-next] softirq: reduce latencies From: Eric Dumazet To: Joe Perches Cc: Ben Hutchings , David Miller , Andrew Morton , netdev , "linux-kernel@vger.kernel.org" , Tom Herbert In-Reply-To: <1357290721.5452.55.camel@joe-AO722> References: <1357216132.21409.24107.camel@edumazet-glaptop> <1357250880.2685.29.camel@bwh-desktop.uk.solarflarecom.com> <1357252816.21409.26384.camel@edumazet-glaptop> <1357285780.21409.28416.camel@edumazet-glaptop> <1357287351.5452.44.camel@joe-AO722> <1357287786.1678.87.camel@edumazet-glaptop> <1357290721.5452.55.camel@joe-AO722> Content-Type: text/plain; charset="UTF-8" Date: Fri, 04 Jan 2013 09:00:24 -0800 Message-ID: <1357318824.1678.1678.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2013-01-04 at 01:12 -0800, Joe Perches wrote: > On Fri, 2013-01-04 at 00:23 -0800, Eric Dumazet wrote: > > On Fri, 2013-01-04 at 00:15 -0800, Joe Perches wrote: > > > Perhaps MAX_SOFTIRQ_TIME should be > > > #define MAX_SOFTIRQ_TIME msecs_to_jiffies(2) > > > though it would be nicer if it were a compile time constant. > > > > If you send a patch to convert msecs_to_jiffies() to an inline function > > when HZ = 1000, I will gladly use it instead of (2*HZ/1000) > > > > Right now, max(1, msecs_to_jiffies(2)) uses way too many instructions, > > while it should be the constant 2, known at compile time. > > Something like this might work. > > This is incomplete, it just does msecs_to_jiffies, > and it should convert usecs_to_jiffies and the > jiffies_to_ types too. > > Maybe it's worthwhile. > > It does reduce object size by 16 bytes per call site > (x86-32) when the argument is a constant. There are > about 800 of these jiffies conversions in kernel sources. > > What do you think? > I think this is something to discuss in another thread, and definitely worth to do, at least for msecs_to_jiffies() We have many HZ references everywhere that could be cleaned up using this.