Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 22 Jan 2003 14:25:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 22 Jan 2003 14:25:42 -0500 Received: from bjl1.asuk.net.64.29.81.in-addr.arpa ([81.29.64.88]:65494 "EHLO bjl1.asuk.net") by vger.kernel.org with ESMTP id ; Wed, 22 Jan 2003 14:25:41 -0500 Date: Wed, 22 Jan 2003 19:34:46 +0000 From: Jamie Lokier To: "Randy.Dunlap" Cc: Ed Tomlinson , linux-kernel@vger.kernel.org Subject: Re: {sys_,/dev/}epoll waiting timeout Message-ID: <20030122193446.GA5438@bjl1.asuk.net> References: <20030122132040.GA4752@bjl1.asuk.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Randy.Dunlap wrote: > | > Why assume HZ=1000? Would not: > | > > | > timeout = (unsigned long)(timeout*HZ+(HZ-1))/HZ+1; > | > > | > make more sense? > | > | No, that's silly. Why do you want to multiply by HZ and then divide by HZ? > > OK, I don't get it. All Ed did was replace 1000 with HZ and > 999 with (HZ-1). What's bad about that? Seems to me like > the right thing to do. Much more portable. > > What if HZ changes? Who's going to audit the kernel for changes? You're being dense. The input timeout is measured in milliseconds; see poll(2). The calculated timeout is measured in jiffies. Hence multiply by jiffies and divide by milliseconds. -- Jamie - 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/