Date: Thu, 28 Jun 2007 18:04:27 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: Jeff Roberson <jroberson@chesapeake.net> Cc: arch@freebsd.org Subject: Re: Add wakeup_with() before 7.0? Message-ID: <20070629010427.GB22054@elvis.mu.org> In-Reply-To: <20070628123314.W552@10.0.0.1> References: <20070628123314.W552@10.0.0.1>
next in thread | previous in thread | raw e-mail | index | archive | help
This would be very useful, if you have time it might make sense to do this for condvars as well. At the minimum you should fix the comment for WAKEUP_ONE to be "Only wakeup _one_ thread". * Jeff Roberson <jroberson@chesapeake.net> [070628 12:40] wrote: > I propose to add a new api for wakeup before 7.0. This new api would > accept a wait channel and a flags argument. here's the relevant part of > the diff: > > +void wakeup_with(void *chan, int flags) __nonnull(1); > +#define WAKEUP_ONE 0x00001 /* Only wakeup on thread. > */ > +#define WAKEUP_ALL 0x00002 /* Wake-up all waiters. */ > +#define WAKEUP_LOCAL 0x00004 /* Wake-up on the local > cpu. */ > +#define WAKEUP_TAIL 0x00008 /* Wake-up the newest > waiter. */ > > This allows wakeup callers to hint the scheduler about various > information. WAKEUP_LOCAL would allow us to prefer affinity for the > waking cpu. I have patches to use this in pipe code and socket buffer > code that improve performance in some workloads. WAKEUP_TAIL could be > used for accept() which I have heard can significantly improve webserver > performance. > > To implement this change sched_wakeup() and setrunnable() need the flags > plummed all the way through. I would like feedback on whether people > think the api breakage should go in now to enable these optimizations for > 7.0, potentially without committing users of these flags right away. > Alternatively we could break the api later or just skip it until 8.0. > > Thanks, > Jeff > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" -- - Alfred Perlstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070629010427.GB22054>