From owner-freebsd-hackers Thu Aug 22 6:36: 3 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D7DED37B400 for ; Thu, 22 Aug 2002 06:35:59 -0700 (PDT) Received: from heaven.gigo.com (heaven.gigo.com [64.57.102.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2916443E72 for ; Thu, 22 Aug 2002 06:35:59 -0700 (PDT) (envelope-from lioux@brturbo.com) Received: from 200-193-224-205-bsace7003.dsl.telebrasilia.net.br (200-193-224-205-bsace7003.dsl.telebrasilia.net.br [200.193.224.205]) by heaven.gigo.com (Postfix) with ESMTP id E4573B893 for ; Thu, 22 Aug 2002 06:35:52 -0700 (PDT) Received: (qmail 377 invoked by uid 1001); 22 Aug 2002 12:54:55 -0000 Message-ID: <20020822125455.376.qmail@exxodus.fedaykin.here> Date: Thu, 22 Aug 2002 09:54:33 -0300 From: Mario Sergio Fujikawa Ferreira To: FreeBSD-hackers@FreeBSD.ORG Cc: David Schultz Subject: Re: Creating a sysctl? (mission impossible) References: <20020820180222.927.qmail@exxodus.fedaykin.here> <20020822030842.GA22058@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020822030842.GA22058@HAL9000.homeunix.com> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 4.6-STABLE X-Disclaimer: I hope you find what you are looking for... in life :) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 21, 2002 at 08:08:20PM -0700, David Schultz wrote: > Thus spake Mario Sergio Fujikawa Ferreira : > > I am trying to create one sysctl so that I can read information > > from a lottery scheduler that I am trying to write. > > The sysctl is very very simple. I add a lottery node under kern > > then add a member global_tickets under kern.lottery. Very simple stuff > > that is not working. > > FYI, lottery scheduling has already been implemented at least > twice for FreeBSD. For an example, see I know about the other implementations. However, this is for my graduation course. Therefore, I will be implementing it. It would much better if it was suitable for proper inclusion in the kernel. Besides, since this is for my graduation course, I have avoiding checking similar implementations to avoid design plagiarization. Nevertheless, I might check similar implementations to get some ideas now that I'm reaching the higher level abstractions. [snip] > The code has not been maintained, apparently due to a lack of > interest, and it incurs a high scheduling overhead. Note that the KSE Well, the high overhead has usually been due to the design implementation. It is usually due to the data structure used for holding the processes in the scheduler. Aside from that, the only really expensive call is random(). I am trying to use least expensive design in this code but I am aware of this possible caveat. > work is likely to bring significant changes to scheduling in FreeBSD, > possibly causing you headaches later. You might also be interested in I know. :) But since I need this working in the next week, I can't really risk trying -CURRENT. I'll have to port this to -CURRENT later since I want all of Waldspurger's proportional schedulers eventually merged into the FreeBSD distribution. Of course, if I can convince -arch ppl that this worth it. Also, users that desire lottery scheduler desire it most for the different policy not exactly for less overhead though I'll try to keep the overhead to a minimum. > Luigi's work on a PS scheduler; check the list archives. I will but my current priority is getting lottery scheduler to a working least expensive shape. I think I am going to contact Luigi, he probably has experience with some of the problems I am facing. ps: by the way, for those tracking this from archives. The "solution" for the sysctl problem is o Problem: Although, the sysctl symbols could be found in the kernel through 'nm /kernel', 'sysctl -a' did not show them. o Solution: Add header file which requires o Reason: "SYSCTL_* uses the DATA_SET macro, which is in linker_set.h, which is included by kernel.h. If you didn't have it, DATA_SET was giving weird declaration warnings, but i guess since there was nothing in the file it didn't matter when linked" [1] Submitted by: ah-zeep [1] So a correct example for adding any sysctl has the following template: #include #include #include SYSCTL_NODE(_kern, OID_AUTO, lottery, CTLFLAG_RD, 0, "Lottery scheduling parameters"); SYSCTL_UINT(_kern_lottery, OID_AUTO, global_tickets, CTLFLAG_RD, &global_tickets, 0, "Current global tickets"); -- Mario S F Ferreira - DF - Brazil - "I guess this is a signature." Computer Science Undergraduate | FreeBSD Committer | CS Developer flames to beloved devnull@someotherworldbeloworabove.org feature, n: a documented bug | bug, n: an undocumented feature To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message