Re: [PATCH for 2.5] preemptible kernel

From: Andrew Morton (andrewm@uow.edu.au)
Date: Wed Mar 21 2001 - 05:05:23 EST


"David S. Miller" wrote:
>
> Keith Owens writes:
> > Or have I missed something?
>
> Nope, it is a fundamental problem with such kernel pre-emption
> schemes. As a result, it would also break our big-reader locks
> (see include/linux/brlock.h).
>
> Basically, anything which uses smp_processor_id() would need to
> be holding some lock so as to not get pre-empted.
>

It's a problem for uniprocessors as well.

Example:

#define current_cpu_data boot_cpu_data
#define pgd_quicklist (current_cpu_data.pgd_quick)

extern __inline__ void free_pgd_fast(pgd_t *pgd)
{
        *(unsigned long *)pgd = (unsigned long) pgd_quicklist;
        pgd_quicklist = (unsigned long *) pgd;
        pgtable_cache_size++;
}

Preemption could corrupt this list.

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 23 2001 - 21:00:15 EST