From owner-freebsd-current Thu Jun 21 11:27:22 2001 Delivered-To: freebsd-current@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 1549337B401; Thu, 21 Jun 2001 11:27:18 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.3/8.11.2) with ESMTP id f5LIR4I48899; Thu, 21 Jun 2001 11:27:04 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3B319D07.3E47AD6D@mindspring.com> Date: Thu, 21 Jun 2001 13:12:28 -0700 (PDT) From: John Baldwin To: Terry Lambert Subject: RE: STARTUP ARCH. (was Re: swap_pager_swap_init()) Cc: alfred@FreeBSD.org, current@FreeBSD.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 21-Jun-01 Terry Lambert wrote: > John Baldwin wrote: >> >> The swap pager getpages/putpages routines depend on >> swap_pager_swap_init() being called before they are >> called. However, swap_pager_swap_init() isn't called >> until the pagedaemon starts up. Granted, it should >> always be run before init has a chance to exec swapon >> via /etc/rc, however, would it be more correct to >> instead let swap_pager_swap_init() be run by a SI_SUB_VM >> SYSINIT (SI_ORDER_ANY, with the other VM sysinit's bumped >> up to be less than ANY). The race is incredibly small, >> but I'd feel better if it was more correct. Comments? > > This heavy a change probably belongs on -arch; I will > tell you what I think, and why, and let consensus sort > it out. > > > I don't think there is a race; the stuff is not really > started until the scheduler is run, and that is the > last thing; before that, it is merely on a run queue. The race would be between pagedaemon calling this second swap pager init function and the swap pager being used to get or put pages for an object. Since swapon isn't usually started until after the pagedaemon is started, it is mostly infinitesimally small to nonexistent, but the swap pager should be functional when we kick off the scheduler IMO. > A serious monkey-wrench in your plan is that the proc > structure for the thing is allocated out of a zone, and > the VM system is not really up at that point, sp doing it > that early is not really an option. Erm. I think you misunderstood me. I'm not proposing that we start the pagedaemon earlier. I'm proposing that we move swap_pager_swap_init() out of the pageout daemon and into a separate SYSINIT. Your comments about zalloc() are relevent in that swap_pager_swap_init() calls zinit -> malloc, so the zone allocator and malloc both need to be up and running. For those reasons, SI_SUB_VM is too early. It appears malloc is up and running after SI_SUB_KMEM, but waiting until after SI_SUB_VM_CONF would probably be good. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message