| Previous | Next |
| KERN_INVALID_PROCESSOR_SET | KERN_INVALID_POLICY |
KERN_POLICY_LIMIT
A limit on a valid scheduling request
KERN_POLICY_LIMIT is a Mach kern_return_t used by scheduler-policy interfaces. It means that the requested scheduling attributes are outside the limits accepted for the target thread. The policy request can be structurally valid while still asking for more than that thread is permitted to receive.
This is most relevant when code uses thread_policy_set or a related Mach interface. That call identifies a target thread, a policy flavor, a policy-data structure, and a count expressed in integer_t units. For example, THREAD_TIME_CONSTRAINT_POLICY supplies a period, computation time, constraint, and preemptibility flag; the time fields are Mach absolute-time values.
How it differs from nearby results
| Status | Diagnostic meaning |
|---|---|
KERN_POLICY_LIMIT | The selected attributes exceed the applicable limit for the target thread. |
KERN_INVALID_POLICY | The requested policy is not enabled or cannot be used in the current policy context. |
KERN_INVALID_ARGUMENT | An argument, policy flavor, structure size, or supplied value is not valid for the call. |
KERN_POLICY_STATIC | The target thread’s policy parameters cannot be changed at that point. |
Do not reduce this status to a generic “priority too high” message. The useful evidence is the complete policy request and the identity of the target thread, because the applicable limit belongs to that scheduler context rather than to a single global number.
What to record before changing the request
- Capture the exact Mach routine, policy flavor, target thread port, and every field of the policy structure.
- For a time-constraint request, preserve
period,computation, andconstrainttogether. The XNU definition requires the constraint to be at least the computation time, but satisfying that relationship alone does not establish that the request is within the thread’s allowed limits. - Check whether the code is trying to apply a real-time policy where a normal pthread or QoS mechanism is the intended API. Apple documents Mach policy calls for cases that need scheduler behavior beyond ordinary POSIX priority control.
- Validate the effective policy after a successful retry instead of assuming that a fallback or wrapper preserved the requested attributes.
References
- Apple XNU: kern_return.h
- Apple XNU: thread_policy.h
- Apple Kernel Programming Guide: Mach Scheduling and Thread Interfaces
Looking for a different code? Search another status or error code.