Carl-Daniel Hailfinger wrote:
v2 has / used to have working locking code since it was first ported to opteron. It may be that it broke while adding 5 more printks but it is there somewhere.
Any hints on where to look are appreciated. I'd like to use locking inside printk ASAP.
Where does the locking algorithm fail? My guess is, it's in romcc or CAR code. Where we are out of luck with all approaches of synchronization so far.
do_printk is defined in src/console/printk.c as:
int do_printk(int msg_level, const char *fmt, ...) { va_list args; int i;
if (msg_level >= console_loglevel) { return 0; }
spin_lock(&console_lock);
va_start(args, fmt); i = vtxprintf(console_tx_byte, fmt, args); va_end(args);
console_tx_flush();
spin_unlock(&console_lock);
return i; }
(we should just rename this to printk and use it the v3 way instead of the printk_<loglevel> layers on top, but that's orthogonal, too)
Stefan