Date: Thu, 21 Jun 2001 13:12:28 -0700 (PDT) From: John Baldwin <jhb@FreeBSD.org> To: Terry Lambert <tlambert2@mindspring.com> Cc: alfred@FreeBSD.org, current@FreeBSD.org Subject: RE: STARTUP ARCH. (was Re: swap_pager_swap_init()) Message-ID: <XFMail.010621131228.jhb@FreeBSD.org> In-Reply-To: <3B319D07.3E47AD6D@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> -- 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010621131228.jhb>