After profiling many iterations of several driver operations, the
observed absolute maximum number of queue scheduler messages was 452
during soft AP startup. Typical maximums for this test case are less
than 100, occasionally getting as high as 250. The median for all of
the driver operations in general were in the range of 1-2. Given this
information, a round number around twice the worst case rate was
picked.
Reduce SCHEDULER_CORE_MAX_MESSAGES to 1000, down from 8000 for MCL.
This saves a significant amount of unused statically allocated memory.
Change-Id: I6ef65db84ca524cea68afbc3bb49347c6d996992
CRs-Fixed: 2202692
Part of the scheduler component has been migrated to the new sched_*
logging wrappers, but part of it still remains to be ported. Finish
migrating all of the scheduler logging APIs.
Change-Id: I5065d849a1523d6c27d6c6a27b1ad4605036c3e6
CRs-Fixed: 2201038
Reduced the number of scheduler message buffers for WIN to
2k from 4k since WIN is only using 2 scheduler queues.
Changed the order of two members of scheduler messgae structure
to avoid additional padding on 64bit platform.
Change-Id: Ic74d60878867c45413bc4fbd5c56feb4dd421699
CRs-Fixed: 2157621
A commonly used and robust life-cycle pattern consists of the following
4 steps:
1) create (allocate resources)
2) start (mark resources as safe for use)
3) stop (mark resources as unsafe for use)
4) destroy (deallocate resources)
This pattern effectively prevents access to uninitialized and freed
resources. While the dispatcher psoc life-cycle follows this pattern,
the global life-cycle is condensed into steps 1 and 4. Unsurprisingly,
this led to uninitialized and freed resource access problems, especially
in regards to the scheduler thread.
Split the scheduler init and deinit life-cycle functions into init,
enable, disable, and deinit. Create new global enable and disable
dispatcher functions, and call the new scheduler APIs as appropriate.
This brings the global dispatcher life-cycle in line with the existing
psoc life-cycle, and prevents many scheduler related resource access
issues.
Change-Id: I58b65be0611f48e48354f28c221185f6f490f30c
CRs-Fixed: 2153283
A set of logging helpers for the scheduler component were previously
added to reduce boilerplate logging code. Update scheduler_api.c to use
the new logging helpers.
Change-Id: I45715e40dbdd5a94d064ca4c64290a443cacea34
CRs-Fixed: 2152575
The SYS_MSG_ID_MC_START and SYS_MSG_ID_MC_STOP message IDs are no
longer being used. so remove them.
Change-Id: I8d35a537ac2c2f7436b23033561e5d0ef09895df
CRs-Fixed: 2107075
In scheudler_api.h properly format new line spacing between functions
and include files.
Change-Id: I7960ea7aeec3aef9c50a4a39efcd9db4d6f3951f
CRs-Fixed: 2051329
To reduce boilerplate code, add standard logging macros to the scheduler
module.
Change-Id: I478ec2d16d340f419135101704f0ab3a5bf0b4d8
CRs-Fixed: 2042761
In order to catch long running scheduler messages, start a watchdog
timer before processing each message, and stop the timer after each
message is processed. When the watchdog timer expires, immediately
crash the device in debug builds for easier debugging.
Change-Id: I4b43a9e12fc1f5b8a795fec790fe7548a100d9db
CRs-Fixed: 2037094
Add provision for flush callback in scheduler message such that
during driver unload scheduler can invoke the flush callback and
components can release the common object ref count which is taken
before posting the message.
Change-Id: I28490e18247239af27feef3a4b53e5080ab012fc
CRs-Fixed: 2034772
Driver is missing couple of deregister handler while bringing down the
scheduler.
Change-Id: I99fe6e9a5d3cac800154945e41e707ebb7ee6396
CRs-Fixed: 2001133
Scheduler thread can get stuck because of many reasons like
mutex deadlock, resource starvation etc. Add changes to detect
if scheduler thread is stuck.
Change-Id: Ib9d4e3b240077464b3a51ab6be6af728cb845bfe
CRs-Fixed: 1107636
Legacy protocol engine already has a module name 'sch' rename
control path scheduler from sch to scheduler to avoid naming
conflict with protocol sch.
Change-Id: I94ce9aa5037aa75319aaad2287116462444c03f4
CRs-Fixed: 1105115