Current-Users archive

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

Re: M2 assertion with today's current



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);


best regards
Matthias




-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------



Home | Main Index | Thread Index | Old Index