Commit Graph

24 Commits

Author SHA1 Message Date
ad feb4783fdf Replace use of CACHE_LINE_SIZE in some obvious places. 2008-03-27 18:30:15 +00:00
martin d8788e7fd7 Use cpu index instead of the machine dependend, not very expressive
cpuid when naming user-visible kernel entities.
2008-03-10 22:20:14 +00:00
ad 598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
yamt 69aa06cd40 don't bother to set thread's priority by ourselves,
as kthread_create does it for us now.  from Andrew Doran.
2007-08-07 12:50:26 +00:00
yamt e3fe8e011e - don't assume the order of cpus in a CPU_INFO_FOREACH loop.
- remove unused structure members.
- simplify.
2007-08-07 10:42:22 +00:00
ad 5b2aca96b9 Current convention is to name/number objects after ci->ci_cpuid, so do
that when creating the kthreads. We may want to change this.
2007-08-05 13:47:25 +00:00
rmind c8c024369c Improve per-CPU support for the workqueue(9):
- Make structures CPU-cache friendly, as suggested and explained
   by Andrew Doran.  CACHE_LINE_SIZE definition is invented.
 - Use current CPU if NULL is passed to the workqueue_enqueue().
 - Implemented MI CPU index, which could be used as an index of array.
   Removed linked-lists usage for work queues.

The roundup2() function avoids division, but works only with power of 2.

Reviewed by: <ad>, <yamt>, <tech-kern>
2007-08-05 01:19:17 +00:00
yamt 4b7209cf60 hide internals of struct work. 2007-07-20 12:43:25 +00:00
ad d3b878ab59 workqueue_destroy: fix a use-after-free. 2007-07-18 18:17:03 +00:00
rmind 8c2097ad8d Make MP parts friendly with various ports (especially UP):
- #ifdef code parts, which uses CPU_INFO_FOREACH/CPU_INFO_ITERATOR
 - use ci_cpuid only in MP case
 - include machine/cpu.h
2007-07-13 07:21:31 +00:00
rmind 20bbb87e34 Implementation of per-CPU work-queues support for workqueue(9) interface.
WQ_PERCPU flag for workqueue and additional argument for workqueue_enqueue()
to assign a CPU might be used. Notes:
 - For now, the list is used for workqueue_queue, which is non-optimal,
   and will be changed with array, where index would be CPU ID.
 - The data structures should be changed to be cache-friendly.

Reviewed by: <yamt>, <tech-kern>
2007-07-12 20:39:56 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
yamt c574bfa378 typedef pri_t and use it instead of int and u_char. 2007-02-27 15:07:28 +00:00
yamt f39831ee99 workqueue_exit: update a comment. 2007-02-11 15:37:20 +00:00
yamt be27733fd7 use cv_signal rather than cv_broadcast where appropriate. 2007-02-11 15:36:35 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
yamt 8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
yamt 1a7bc55dcc remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
yamt 14cd84c266 add workqueue_destroy(). 2006-09-16 11:15:00 +00:00
yamt 466a92def9 workqueue_create: use kmem_alloc rather than malloc. 2006-09-16 11:14:36 +00:00
rpaulo 69ade2726c Use for in a forever loop as per KNF. 2006-05-02 13:26:07 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt 54f971f435 add a simple "do it in thread context" framework. 2005-10-29 11:10:37 +00:00