From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id C13F8200681 for ; Fri, 4 May 2012 08:11:45 -0700 (PDT) Received: by wejx9 with SMTP id x9so3387030wej.16 for ; Fri, 04 May 2012 08:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Q5T6x4c3WoiZ8PlCVUBq/sEYF4Iu8ptye4mZbe4Aos4=; b=VS2pLIAtjYg0yLJkxpjNWVnzxDLMdeFE2B6AeMvjbW6/CexGyNsCR4a+BdVHYv5Goy DM8bZTYK8A5JxOGgj1x9cai6YoITuuFQUS6rgGkMIs282JYVqfBoW7qa4rKEWHnolXux kd5muIFG5tmVL3WhOyar+DARrU0OZXSiHFgTwQjiIsj4/01CokHi/5MJbolb2HsvC0Uo cBJweLKELd7WPF2pLAKDj0y4GmpD64H1UeI31gzrPLdo5asuZZrGwlvmxLueuDY1D6Po I0m5c80ohfND2iMeQ4WErUahJGktMZmDbpp2ros3UugRms2cp3yRBkFgQBV8WULb88w9 wshg== MIME-Version: 1.0 Received: by 10.180.94.7 with SMTP id cy7mr15817793wib.3.1336144301734; Fri, 04 May 2012 08:11:41 -0700 (PDT) Received: by 10.223.112.66 with HTTP; Fri, 4 May 2012 08:11:41 -0700 (PDT) Date: Fri, 4 May 2012 08:11:41 -0700 Message-ID: From: Dave Taht To: codel@lists.bufferbloat.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Codel] fp sqrt vis int sqrt? X-BeenThere: codel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: CoDel AQM discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2012 15:11:46 -0000 The linux kernel has no floating point in it, so I'd substituted the internal int_sqrt as a substitute, just to get something to work. static inline ktime_t control_law(const struct codel_sched_data *q, ktime_t= t) { return ktime_add_ns(t, q->interval / int_sqrt(q->count)); } Often ns2 models use floating point. Having not seen the model I don't know that for sure. The series for an integer sqrt is far more 'chunky' than a fp one. int sqrt 1,2,3,4 =3D 1 1 1 2 fp sqrt 1 2 3 4 =3D 1 1.4.1 1.73 2 and gets even more chunky as you get larger values, eg, sqrt(36 through 48) =3D 6, sqrt(49) =3D 7 So we could precalculate the interval/sqrt(count) using floating point in the control law calculation, early, during qdisc setup, thus neatly avoiding both the divide and sqrt in the control law path. Or we could do fixed point. Kathie: In the sim, in various simulations, what is the dynamic range of count? And is it floating point sqrt? --=20 Dave T=E4ht SKYPE: davetaht US Tel: 1-239-829-5608 http://www.bufferbloat.net