Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: M2 assertion with today's current



On Wed, 30 Jan 2008 23:04:48 +0100
Matthias Drochner <M.Drochner%fz-juelich.de@localhost> wrote:

> 
> M.Drochner%fz-juelich.de@localhost said:
> > That address gets overwritten about where cpu1 is attached, 
> 
> OK, that one is solved: the address calculation in sched_cpuattach()
> of sched_m2 didn't work as expected. It uses the roundup()
> macro with a signed argument which leads to unexpected results
> for addresses >2G.
> Since CACHE_LINE_SIZE is a power-of-two roundup() is too expensive
> here anyway -- something doing simple bitmasks would be better,
> but for not this one fixes it:
> 
> --- sys/kern/sched_m2.c 3d17ab6d545ac64a17596ee7683fb4344a3f7614
> +++ sys/kern/sched_m2.c 63c81b1e61dc24d37990345a6288e99bdd9fe5d2
> @@ -221,7 +221,7 @@ sched_cpuattach(struct cpu_info *ci)
>                 panic("scheduler: could not allocate the runqueue");
>         }
>         /* XXX: Save the original pointer for future.. */
> -       ci_rq = (void *)(roundup((intptr_t)(rq_ptr), CACHE_LINE_SIZE));
> +       ci_rq = (void *)(roundup((uintptr_t)(rq_ptr), CACHE_LINE_SIZE));
> 
>         /* Initialize run queues */
>         mutex_init(&ci_rq->r_rq_mutex, MUTEX_DEFAULT, IPL_SCHED);

Nice catch! with this patch I'm able to use M2 again, and that explains why
my other system with 1GB didn't suffer that problem. This machine has 3GB of 
RAM.

-- 
Juan Romero Pardines             The NetBSD Project
http://plog.xtrarom.org/         NetBSD/pkgsrc news in Spanish
http://mklivecd.xtrarom.org/     Make your own NetBSD Live CD/DVD!



Home | Main Index | Thread Index | Old Index