[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
1 file changed
tree: a710283453103701f9fedb891e933159a0e0a3db
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. cts
  6. firmware
  7. flower
  8. jiri.lock
  9. MILESTONE
  10. minimal
  11. prebuilts
  12. README.md
  13. stem
  14. test_durations
  15. toolchain
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

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.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.