Commit Graph

274 Commits

Author SHA1 Message Date
danny couture
2222619119 [Scheduler]
- Fix DoNotRunInsideBusyWait tasks that ended up being picked up during busy waiting anyway.
  - Change internal API of ExecuteTask to make it evident it can actually return a new task.
  - Make sure that busy wait will dequeue tasks from local/global queue in priority order.
  - Remove unused local queue functions.

#jira UE-199870
#rb JeanFrancois.Dube

[CL 29908002 by danny couture in ue5-main branch]
2023-11-23 07:04:09 -05:00
danny couture
f0d2935d27 [Scheduler]
- Remove costly insight trace that should not have been submitted

[CL 29880057 by danny couture in ue5-main branch]
2023-11-21 19:44:40 -05:00
danny couture
deb6fca216 [Scheduler]
- Fix deadlock and indeterminism caused by not always signaling a thread after launching a task
- Fix deadlock that happened when trying to launch blocking tasks on all workers
- Use a PreWait/CancelWait/CommitWait semantic to close the gap where a drowsing thread could pick a task without the signaling thread knowing about it.
- Deprecate TryLaunchAffinity workaround now that the deadlocks above have been fixed
- Get rid of task stealing throttling as stealing to reduce latency as it is only involved when searching work before going to sleep
- Less spurious wake-ups as a worker will only wake-up another one when picking up a task if CancelWait has consumed a signal
- Workers will now honor task priorities between local and global queues
- Add blocked workers benchmark test

#jira UE-199959
#rb JeanFrancois.Dube
#tests TSAN / UnitTests / StressTests / ReplayRuns

[CL 29744016 by danny couture in ue5-main branch]
2023-11-15 08:20:09 -05:00
jared cotton
936c3772e6 SOL-4839 - Use free bits in VCell header to create mutex's in subclasses which require them instead of them having their own mutex members.
- Add UE::FTwoBitMutex which takes a pointer to an external-state of which it only uses its two LSBs.
- Adds tests for FMutex and FExternalMutex

#rb devin.doucette
#rb yiliang.siew

[CL 29024883 by jared cotton in ue5-main branch]
2023-10-23 19:30:12 -04:00
louisphilippe seguin
6a0e046774 Fix missing include
#jira UE-197898

[CL 28990108 by louisphilippe seguin in ue5-main branch]
2023-10-20 19:42:24 -04:00
dpull
628190e29d Allow OnlineSubsystemNull and ReserveScheduler to start threads in a forked multithread environment
#jira UE-197898
#10979 tag
#rnx

[CL 28986073 by dpull in ue5-main branch]
2023-10-20 18:20:06 -04:00
andriy tylychko
0f84b2f46f removed a member that is not used anywhere, a remnant of old versions
#rb cosmetic
[FYI] danny.couture

[CL 28449088 by andriy tylychko in ue5-main branch]
2023-10-04 06:45:08 -04:00
andriy tylychko
58db28f5d2 "any task" support
#rb luke.thatcher, danny.coutrue

[CL 28232583 by andriy tylychko in ue5-main branch]
2023-09-26 12:17:47 -04:00
ionut matasaru
f476922a6e Fixed usage of CpuProfiler trace in TaskTrace.
FCpuProfilerTrace::OutputEventType() and FCpuProfilerTrace::OutputBeginDynamicEvent() needs to be called only if the CpuChannel is enabled, otherwise the "spec" trace event is not emitted, so it will result in "<unknown>" cpu timers. The issue can be easily reproduced with -trace=tasks (i.e. without enabling cpu channel).

#jira UE-196134
#rb Andriy.Tylychko

[CL 28185939 by ionut matasaru in ue5-main branch]
2023-09-25 09:26:45 -04:00
andriy tylychko
bf42c10569 disable reserve scheduler by default as it seems to be causing deadlocks on low-core windows
#rb francis.hurteau

[CL 27598266 by andriy tylychko in ue5-main branch]
2023-09-05 11:41:26 -04:00
andriy tylychko
a0b79d2c56 removed tasks LLM instrumentation because they are not useful and steal data from other tags. tasks are a low-level thing that shouldn't be represented in a high-level mem usage overview
#rb trivial

[CL 27380009 by andriy tylychko in ue5-main branch]
2023-08-25 12:25:28 -04:00
andriy tylychko
8d1ba56905 TaskGraph: fixed a race reported by TSAN - StartWorkers() adds to ReserveEvents array while a just created worker accessed it in CreateWorker() via EventStack
#rb danny.couture

[CL 26635216 by andriy tylychko in ue5-main branch]
2023-07-27 05:35:47 -04:00
andriy tylychko
ab120cd9e3 adjusted LLM tracing for tasks
#rb francis.hurteau

[CL 26230373 by andriy tylychko in ue5-main branch]
2023-06-26 06:01:47 -04:00
Devin Doucette
ed92f77023 ParkingLot: Gracefully support waiting even after FThreadLocalData is destroyed
#jira none
#preflight 64652cd3f033744ae6a9cca1
#rb Zousar.Shaker
#rnx

[CL 25514848 by Devin Doucette in ue5-main branch]
2023-05-17 15:55:21 -04:00
Andriy Tylychko
28e264700e LLM tags for tasks
#preflight 645cd2872c180971eefa0322
#rb none

[CL 25424808 by Andriy Tylychko in ue5-main branch]
2023-05-11 07:52:16 -04:00
Andriy Tylychko
623986fd4d TaskGraph: fixed tracing of standalone graph events that don't have nested tasks at the moment of dispatching subsequents. because of this issue a lot of graph events weren't shown in TasksInsights
This is a rather "hacky" fix. The old task implementation (TaskGraph API) is on a life support so there's no point of spending too much time for this
#preflight 644be99f1c2846595c45a4f2
#rb danny.couture

[CL 25235003 by Andriy Tylychko in ue5-main branch]
2023-04-28 13:09:16 -04:00
Andriy Tylychko
ca5066d381 disabled "System.Core.LowLevelTasks.PerfTests" until I have time to look at it. it wasn't changed recently and was working for a long time. I suspect the issue with the test itself. it could start failing because an update to toolchain or something similar could cause different code generation
#preflight trivial
#jira FORT-591285

[CL 25143680 by Andriy Tylychko in ue5-main branch]
2023-04-21 07:09:40 -04:00
devin doucette
f496775c20 ParkingLot: Use memory from FPlatformMemory to avoid GMalloc
ParkingLot cannot be used to synchronize allocator implementations if ParkingLot itself depends on those allocators.

#preflight 6441575673470c177c178ce2
#rb Zousar.Shaker
#rnx

[CL 25131053 by devin doucette in ue5-main branch]
2023-04-20 13:25:54 -04:00
devin doucette
3c3f2f50c2 Optimized code generation for FMutex and FRecursiveMutex
Avoiding duplicate conditions, restructuring loops, and using LIKELY/UNLIKELY allows the compiler to generate shorter and faster code.

#rb Zousar.Shaker
#rnx

[CL 24995086 by devin doucette in ue5-main branch]
2023-04-11 14:27:08 -04:00
devin doucette
8309f566d6 Deleted experimental FLazyEvent
The experimental UE::FLazyEvent has been superceded by UE::FManualResetEvent and UE::FEventCount.

#preflight 6434218041783dc3d0706df5
#rb none
#rnx

[CL 24978662 by devin doucette in ue5-main branch]
2023-04-10 12:08:36 -04:00
devin doucette
3a49eb5231 ParkingLot: Undo CL 24976983
#rb none
#rnx

[CL 24977714 by devin doucette in ue5-main branch]
2023-04-10 11:05:09 -04:00
devin doucette
ee76394648 ParkingLot: Use memory from FPlatformMemory to avoid GMalloc
ParkingLot cannot be used to synchronize allocator implementations if ParkingLot itself depends on those allocators.

#rb Zousar.Shaker
#rnx

[CL 24977705 by devin doucette in ue5-main branch]
2023-04-10 11:04:56 -04:00
devin doucette
fe6b602e32 Moved FRecursiveMutex implementation details out of the header
#rb none
#rnx

[CL 24876592 by devin doucette in ue5-main branch]
2023-03-31 15:19:00 -04:00
devin doucette
c490ca95eb Added FRecursiveMutex
This is an 8-byte unfair recursive mutex built on top of ParkingLot.
Provides the same API as FCriticalSection which allows it to be used as a drop-in replacement.

#preflight 6422fde4803cb466e85619b0
#rb Andriy.Tylychko, Phil.Pizlo

[CL 24873014 by devin doucette in ue5-main branch]
2023-03-31 12:05:51 -04:00
devin doucette
0ffce57d11 ParkingLot: Moved Wait and WaitFor out of the header
#rb Zousar.Shaker
#rnx

[CL 24811680 by devin doucette in ue5-main branch]
2023-03-27 18:51:41 -04:00