[roll] Roll fuchsia [kernel][thread] Fix misplaced ()s in PreemptSetPending

PreemptSetPending is a function which takes a cpu-mask of CPUs for
which to pend a preempt.  If, at the end of the function, the current
CPU is a member of the set of CPUs to preempt, we also want to
evaluate our thread's current timeslice extension (if any).

Code to do this had its heart in the right place, but some ()s in the
wrong place, leading to situations where we might end up doing this
when we don't need to, or (worse) not doing it when we do.

The timeslice extension mechanism is mostly an optimization, and I
_think_ that the worst case here is that we skip the evaluation when
we should not have, causing an extension to run slightly longer than
it should have, but I have not done a rigorous analysis and don't have
100% confidence in that statement.

At any rate, the code had the following form:

```
if (resched_mask & cpu_mask_from_id(cur_cpu_id == 0)) {
  // Our current CPU is not in the reschedule mask, we can return
  // early and do not have to evaluate our timeslice.
  return;
}
```

The mistake here is in: `cpu_mask_from_id(cur_cpu_id == 0))`.  We
_want_ to compute the current-cpu-mask, bitwise AND that with the
reschedule mask, and compare the result to 0.  Instead, we are
comparing the current cpu ID to zero, and using the 0/1 result of that
operation to compute the current CPU mask, which is incorrect.

Adjusting the ()s just slightly to be:

```
if (resched_mask & cpu_mask_from_id(cur_cpu_id) == 0) {
```

fixes this issue.  That said, I went a bit further with this patch and
added some intermediate variables in an attempt to make things just a
bit easier to read (I hope).

Original-Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1647054
Original-Original-Revision: 26231e1fc918906c8cbb9d3a64f890ade20eb965
GitOrigin-RevId: d436fe51a7ebfcfebc5e0d12d6dce93fdd0e254e
Change-Id: Ifcc2eb92b0a5658ccfb9f53d5a3e7c5be2beedff
Reviewed-on: https://fuchsia-review.googlesource.com/c/integration/+/1645860
Cr-Commit-Position: refs/heads/main@{#194485}
1 file changed
tree: 1fb2b46e4daf9f439b950268684c52366d2bb4fa
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. cobalt
  6. flower
  7. jiri.lock
  8. MILESTONE
  9. minimal
  10. prebuilts
  11. README.md
  12. stem
  13. test_durations
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 in one of the communication channels documented at get involved.

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.