commit | 2cf4340c85ad61f37efbc0248383a656f0003528 | [log] [tgz] |
---|---|---|
author | Nick Maniscalco <maniscalco@fuchsia.infra.roller.google.com> | Sat May 11 01:08:58 2024 +0000 |
committer | Copybara-Service <copybara-worker@google.com> | Fri May 10 18:10:31 2024 -0700 |
tree | a710283453103701f9fedb891e933159a0e0a3db | |
parent | 1a02a5bb79e563f3d44c8ed4e54f46df37ee3b9f [diff] |
[roll] Roll fuchsia [kernel][dlog] Use a Timer to allow printing from within the scheduler This change resolves an issue that prevented printf from working within the scheduler, and more generally, whenever there was an active chainlock transaction. printf bottoms out in DLog::Write, which places a record in a buffer and then calls Event::Signal to unblock the notifier thread. Prior to this change, if DLog::Write was called from a context with an existing active chainlock transaction (e.g. from within the scheduler), calling Event::Signal would trigger an assert (can't start a new transaction when you've already got one in progress). To resolve the issue, we update DLog::Write to check for an active chainlock transaction. If there is none, it calls Event::Signal as usual. If there one, DLog::Write will instead set a Timer that will immediately fire once the current CPU has re-enabled interrupts after finishing the current transaction (or during the period in which interrupts are re-enabled during backoff). The Timer callback simply calls Event::Signal on Write's behalf. ~DLog now cancels the Timer to ensure there is no use-after-free. As a small optimization, DLog tracks whether there is a pending Timer (pending_deferred_signal_). Of course, this tracking is not 100% accurate as the Timer callback could be racing with the write. However, because the observation is made in a critical section guarded by the same lock that the dumper thread must ultimately acquire, there is no risk of a "lost wakeup". Original-Fixed: 339440805 Original-Fixed: 331847876 Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1045567 Original-Revision: 0bc3bcab25532535b793e767a763b3e73e249d79 GitOrigin-RevId: 0562996fa0f27a6a8332e9e4711baff04877c8db Change-Id: I7c74be9358dd6cf33498beb8fb31944bec9542b9
This repository contains Fuchsia's Global Integration manifest files.
All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.
Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia
on Freenode.
First install Jiri.
Next run:
$ jiri init $ jiri import minimal https://fuchsia.googlesource.com/integration $ jiri update
Third party projects should have their own subdirectory in ./third_party
.