inconsistent logging results when using atomics #160
nihalpasham
started this conversation in
General
Replies: 1 comment 10 replies
-
I don’t know your EMMC driver, and it is also not part of the tutorials here. To me, this looks more like something races between your emmc driver init and this fat_cache snippet than with the logging. If you have caching enabled anyways then there should be no issue with the atomics. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This seems like an odd issue.
I'm using the log crate to abstract over the (UART-based) logging implementation.
log
uses atomics under the hood to initialize the global logger. In this case, I'm usingset_logger_racy
set_logger_racy
uses an atomic load + store, like in the casepanic_wait
. I presume they are lowered to regular load/store operations onaarch64
. However, initializing the global logger yields inconsistent results.exception
handling andmmu + caching
are enabled in all cases.Case 1:
In theory, this snippet simply caches the fat table and should have no bearing on our global logger but nonetheless, adding this, results in the system-hanging without any exception. What's weird is the call to initialize the global logger is supposed to happen after printing a few more logs. In other words, none of the
info
logs fromkernel_main
get printed. It looks like the system simply hangs right afterkernel_init
.Case 2:
[INFO]
logs.Case 3:
Any idea why this could be happening? Am I missing something specific to the rpi4?
Beta Was this translation helpful? Give feedback.
All reactions