Prior to changeset:mainline,791 vprintf() (uspace/lib/c/generic/io/vprintf.c) guarded the call to printf_core() with async_serialize(). Now it uses a global fibril mutex.
This is slightly better, but still not good enough. Mutual exclusion, if any, should only be done per stream. The global lock incurs unnecessary (and potentially dangerous) dependencies between fibrils writing to completely different streams (e.g. to console and to a network socket, when we have sockfs).
Actually, do we really want to ensure mutual exclusion for printf (on a specific stream)? AFAICT this is just a workaround for the fact that stream I/O functions are not fibril-safe.
If we add the missing locking to stream I/O functions, we can drop the mutex from vprintf() altogether. The worst that could happen when multiple fibrils called printf() in parallel would be that the outputs would be intermixed, which is, IMO, acceptable.
If an application needs to ensure that output of different fibrils is not intermixed, it should employ its own locking.
Haven't actually gotten to this yet. Unassigning for now.