From owner-freebsd-net@FreeBSD.ORG Fri Jun 20 01:29:00 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1D61CCC for ; Fri, 20 Jun 2014 01:29:00 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55D8E2F65 for ; Fri, 20 Jun 2014 01:29:00 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id x13so2984079wgg.3 for ; Thu, 19 Jun 2014 18:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=GzFo7RoHeXv4okTtkyQzy2SJIafz45mEpx0vPXT9tqs=; b=t45xddb0IrJ6Skg1LD6l8RPqQ49Ei65xMKnCPJ2Hlo1jPZhWMeEkip07mEvJ+cZY3H 13acKImDFYBOK/rxuh7MvNfGvA2s8+vCcpolwwtB7jN6Vpnoo6x6M76mJeS8T8/QP7Ku 9ancdEh201P4iMPGuu48LjeOkUX8K2M8SHm+X8OqvFJJBU4LH0IQvRu77hzB9Cm4vBch Jyz1kft+ba1iBg7LBHRzSTw80461HHcKnmVJqMT532u9X37xPlrV4/XH6+2gOLlLgGwM S99sMpGron4EdWJ9XH5IF+Te8HVDxq+/V3h5rPlPKlGTLzzoa/tBv5eW9dNaf03pACUp KPuw== X-Received: by 10.180.72.15 with SMTP id z15mr211159wiu.46.1403227738725; Thu, 19 Jun 2014 18:28:58 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id r9sm38143280wia.17.2014.06.19.18.28.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Jun 2014 18:28:58 -0700 (PDT) Date: Fri, 20 Jun 2014 03:28:55 +0200 From: Mateusz Guzik To: =?utf-8?B?5byg5pmX?= Subject: Re: =?utf-8?B?5Zue5aSN?= =?utf-8?B?77ya?= pow function in kernel space Message-ID: <20140620012855.GB5830@dft-labs.eu> References: <20140619200625.GB3631@server.rulingia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-net , Peter Jeremy X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 01:29:00 -0000 On Fri, Jun 20, 2014 at 08:59:49AM +0800, 张晗 wrote: > Hi: > > I am doing a research on D2TCP(http://dl.acm.org/citation.cfm?id=2342388), I just want to implement it into the linux kernel. When calculating the penalty function, it is p = a^d, where 0< a < 1 and 0< d < 1. Since the kernel only offers integer, so in my code, so I let a multiply 2^10. But I have no idea of calculating a^d when 0< d < 1. May be I want a approximate algorithm or other methods. Can you help me ? > thanks~ > First of all this is a FreeBSD list and FreeBSD is not Linux. It is possible to use FPU in kernel mode, but it requires some additional work. Both FreeBSD and Linux kernels provide functions for this purpose, see kernel_fpu_begin and kernel_fpu_end on Linux. I suggest you send further questions to some Linux-related resource, although I can't recommend any in particular. -- Mateusz Guzik