On Wed, Mar 21, 2001 at 08:19:54PM +1100, Keith Owens wrote: > Ouch. What about all the per cpu structures in the kernel, how do you > handle them if a preempted task can be rescheduled on another cpu? > > int count[NR_CPUS], *p; > p = count+smp_processor_id(); /* start on cpu 0, &count[0] */ > if (*p >= 1024) { > /* preempt here, reschedule on cpu 1 */ > *p = 1; /* update cpu 0 count from cpu 1, oops */ > } > > Unless you find every use of a per cpu structure and wrap a spin lock > around it, migrating a task from one cpu to another is going to be a > source of wierd and wonderful errors. Since the main use of per cpu > structures is to avoid locks, adding a spin lock to every structure > will be a killer. Or have I missed something? That's why Linus suggested it for UP only. Andrea - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Re: [PATCH for 2.5] preemptible ker... Rusty Russell
- Re: [PATCH for 2.5] preemptible ker... Nigel Gamble
- Re: [PATCH for 2.5] preemptible ker... Dipankar Sarma
- Re: [PATCH for 2.5] preemptible kernel Keith Owens
- Re: [PATCH for 2.5] preemptible ker... David S. Miller
- Re: [PATCH for 2.5] preemptible ker... Andrew Morton
- Re: [PATCH for 2.5] preemptible ker... Nigel Gamble
- Re: [PATCH for 2.5] preemptible ker... David S. Miller
- Re: [PATCH for 2.5] preemptible ker... Nigel Gamble
- Re: [PATCH for 2.5] preemptible ker... Rusty Russell
- Re: [PATCH for 2.5] preemptible ker... Andrea Arcangeli
- Re: [PATCH for 2.5] preemptible kernel Dipankar Sarma
- Re: [PATCH for 2.5] preemptible ker... george anzinger
- Re: [PATCH for 2.5] preemptible ker... Dipankar Sarma
- Re: [PATCH for 2.5] preemptible ker... Keith Owens
- Re: [PATCH for 2.5] preemptible kernel Nigel Gamble
- Re: [PATCH for 2.5] preemptible kernel Nigel Gamble
- Re: [PATCH for 2.5] preemptible kernel Rusty Russell
- Re: [PATCH for 2.5] preemptible kernel george anzinger
- Re: [PATCH for 2.5] preemptible kernel Nigel Gamble
- Re: [PATCH for 2.5] preemptible ker... george anzinger