From owner-freebsd-current@FreeBSD.ORG Tue Dec 18 09:03:52 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D8F5459E; Tue, 18 Dec 2012 09:03:52 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by mx1.freebsd.org (Postfix) with ESMTP id 09EF18FC17; Tue, 18 Dec 2012 09:03:51 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id dr13so157694wgb.13 for ; Tue, 18 Dec 2012 01:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=jUmn3xQGBB1Ucfa2lVNrmWszs0brmWUzyg2wEgyTH1w=; b=N3sA2gvIxnW1tXnkv0FYd6Rf+XOWCI3/kIkXIE0doJcNmouw3l0h+Z4k7Wcq1a9Ser 92Gr+GuHd5Nn02vWTeWpBVHwwnfG0E/ZN58n2uuR9XIjLnVvpquSutpEBDZ5V4YQ/VSE pxv8R47rUs52C5MkJlco+IA6+6ymffz3BJooXGkJjEG2g3mHeq8Q9U1HUvzoKa4P21kE 4DYVnaf19GBOadDebwT1/31SnQ9MkOPSDGKN8KV4m8S/ke2lILnWBbtX5z+WJl4eajOB fUGp2r6O7qTaYJ48/ZJLkNNR41Ebv3q+obKytua9Szp8dPqRs1RVnmFchbXW4v0zPYGh H80Q== X-Received: by 10.194.57.206 with SMTP id k14mr2559373wjq.26.1355821430972; Tue, 18 Dec 2012 01:03:50 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id hg17sm14947309wib.1.2012.12.18.01.03.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Dec 2012 01:03:49 -0800 (PST) Sender: Alexander Motin Message-ID: <50D03173.9080904@FreeBSD.org> Date: Tue, 18 Dec 2012 11:03:47 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: FreeBSD Current , freebsd-arch@freebsd.org Subject: Re: [RFC/RFT] calloutng References: <50CCAB99.4040308@FreeBSD.org> <50CE5B54.3050905@FreeBSD.org> In-Reply-To: <50CE5B54.3050905@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Davide Italiano X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2012 09:03:52 -0000 Experiments with dummynet shown ineffective support for very short tick-based callouts. New version fixes that, allowing to get as many tick-based callout events as hz value permits, while still be able to aggregate events and generating minimum of interrupts. Also this version modifies system load average calculation to fix some cases existing in HEAD and 9 branches, that could be fixed with new direct callout functionality. http://people.freebsd.org/~mav/calloutng_12_17.patch With several important changes made last time I am going to delay commit to HEAD for another week to do more testing. Comments and new test cases are welcome. Thanks for staying tuned and commenting. On 17.12.2012 01:37, Alexander Motin wrote: > Here is one more version. Unless something new will be found/reported > this may be the last one, because me and Davide are quite satisfied with > the results. If everything will be fine, I think we could commit it to > HEAD closer to the end of the week: > http://people.freebsd.org/~mav/calloutng_12_16.patch > > Changes in this version: > -- Removed couple of redundant variables in callout implementation, > that reduced sizeof(struct callout) by two pointers and simplified some > internal code. > -- syscons driver was made to schedule only 1-2 callouts per second > instead of 20-30 before when console is in graphical mode and there are > few other things to do. Now my laptop has only about 30 interrupts per > second total during idle periods with X running. > -- i8254 eventtimer driver was optimized to work faster in disabled by > default one-shot mode. > -- Few kernel functions were added to make KPIs more complete. > -- Man pages were updated. > -- Some style fixes were made. > > On 15.12.2012 18:55, Alexander Motin wrote: >> I'm sorry to interrupt review, but as usual good ideas came during the >> final testing, causing another round. :) Here is updated patch for >> HEAD, that includes several new changes: >> http://people.freebsd.org/~mav/calloutng_12_15.patch >> >> The new changes are: >> -- Precision and event aggregation code was reworked. Instead of >> previous -prec/+prec representation, precision is now single-sided -- >> -0/+prec. It allowed to significantly improve precision on long time >> intervals for APIs which imply that event should not happen before the >> specified time. Depending on CPU activity, mistake for long time >> intervals now will never be more then 1-500ms, even if specified >> precision allows more. >> -- Some minor optimizations were made to reduce callout overhead and >> latency by 1.5-2us. Now on Core2Duo amd64 system with LAPIC eventtimer >> and TSC timecounter usleep(1) call from user-level executes in just >> 5-6us, instead of 7-8us before. Now it can do 180K cycles per second on >> single CPU with only partial CPU load. >> -- Number of kernel subsystems (dcons, syscons, yarrow, led, atkbd, >> setrlimit) were modified to reduce number of interrupts, also with event >> aggregation by explicit specification of the acceptable events >> precision. Now my Core2Duo test system has only 30 interrupts per second >> in idle. If not remaining syscons events, it could easily be 15. My >> IvyBridge ultrabook first time in its history shown 5.5 hours of battery >> time with full screen brightness and 10 hours with lid closed. >> -- Some kernel functions were added to make KPIs more complete. >> >> I've successfully tested this patch on amd64 and arm. -- Alexander Motin