[roll] Roll fuchsia [kernel][thread] Fix timeslice extension bug

This commit fixes a bug with timeslice extensions where a thread with
a timeslice extension may become preempted prior to even activating
its extension.

The logic flaw is that once the program saw the preempt count was zero
and that there was no active extension it called FlushPending and
relied on there being no local preempts_pending_.  The flawed
reasoning was that preempts_pending_ can't possibly contain the local
CPU at this point because we just observed that there's no active
extension and setting a local preempts_pending_ will always activate
any inactive extension.  The problem with this reasoning is that it
does not take into account the fact that a call to PreemptReenable may
be interrupted and set a local preempts_pending_ after the check for
an active extension, but before the call to FlushPending.

The commit updates PreemptReenable, PreemptReenableDelayFlush, and
EagerReschedReenable, adds DEBUG_ASSERTs, and in-kernel unit tests.

Rename ExpireActiveTimesliceExtension to
ClearActiveTimesliceExtensionIfExpired to improve clarity.

Original-Bug: 104468
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/704422
Original-Revision: cb073543ca53fdc7b2f81f5427864f141ec0a7b2
GitOrigin-RevId: 66f02415f5993b707c5d4df43444802fa76384fe
Change-Id: I688e1d20f6293e17cb7ae753b10459fc515acf29
1 file changed
tree: b5eab0688f5e6a4a616346ee2659e0592e2f04fb
  1. infra/
  2. third_party/
  3. cts
  4. firmware
  5. flower
  6. jiri.lock
  7. minimal
  8. prebuilts
  9. README.md
  10. stem
  11. test_durations
  12. 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.