Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261186AbUCZSut (ORCPT ); Fri, 26 Mar 2004 13:50:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261496AbUCZSut (ORCPT ); Fri, 26 Mar 2004 13:50:49 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.102]:40326 "EHLO e2.ny.us.ibm.com") by vger.kernel.org with ESMTP id S261186AbUCZSuo (ORCPT ); Fri, 26 Mar 2004 13:50:44 -0500 Date: Fri, 26 Mar 2004 10:49:15 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: Edgar Toernig cc: davem@redhat.com, jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] Consolidate multiple implementations of jiffies-msecs conversions. In-Reply-To: <20040326014403.39388cb8.froese@gmx.de> Message-ID: References: <20040326014403.39388cb8.froese@gmx.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1736 Lines: 49 On Fri, 26 Mar 2004, Edgar Toernig wrote: > Sridhar Samudrala wrote: > > > > The following patch to 2.6.5-rc2 consolidates 6 different implementations > > of msecs to jiffies and 3 different implementation of jiffies to msecs. > > All of them now use the generic msecs_to_jiffies() and jiffies_to_msecs() > > that are added to include/linux/time.h > >[...] > > -#define MSECS(ms) (((ms)*HZ/1000)+1) > > -return (((ms)*HZ+999)/1000); > > +return (msecs / 1000) * HZ + (msecs % 1000) * HZ / 1000; > > Did you check that all users of the new version will work correctly > with your rounding? Explicit round-up of delays is often required, > especially when talking to hardware... I don't see any issues with the 2.6 default HZ value of 1000 as they become no-ops and there is no need for any rounding. I guess you are referring to cases when HZ < 1000(ex: 100) and msecs is less than 10. In those cases, the new version returns 0, whereas some of the older versions return 1. If i am not mistaken, Jeff Garjik/David Miller are the maintainers for most of the users of these routines and i have got an OK from them. drivers/block/carmel.c drivers/net/tulip/de204x.c include/linux/libata.h include/net/irda/irda.h drivers/atm/fore200e.c include/net/sctp/sctp.h The only other place where the older version is different is drivers/char/watchdot/shwdt.c Dave, Jeff Do you see any issues with the new generic versions of these routines? Thanks Sridhar > > Ciao, ET. > - 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/