# coresched

## NAME



           coresched - manage core scheduling cookies for tasks
    


## SYNOPSIS



           **coresched**[**get**] [**-s** _pid_]
    
           **coresched new**[**-t** _type_] **-d** _pid_
    
           **coresched new**[**-t** _type_] -- _command_ [_argument_...]
    
           **coresched copy**[**-s** _pid_] [**-t** _type_] **-d** _pid_
    
           **coresched copy**[**-s** _pid_] [**-t** _type_] -- _command_ [_argument_...]
    


## DESCRIPTION



           The **coresched** command is used to retrieve or modify the core
           scheduling cookies of a running process given its _pid_ , or to spawn
           a new _command_ with core scheduling cookies.
    
           Core scheduling permits the definition of groups of tasks that are
           allowed to share a physical core. This is done by assigning a
           cookie to each task. Only tasks have the same cookie are allowed
           to be scheduled on the same physical core.
    
           It is possible to either assign a new random cookie to a task, or
           copy a cookie from another task. It is not possible to choose the
           value of the cookie.
    


## FUNCTIONS



           **get**
               Retrieve the core scheduling cookie of the PID specified in
               **-s**. If **-s** is omitted, it will get the cookie of the current
               **coresched** process.
    
           **new**
               Assign a new cookie to an existing PID specified in **-d** , or
               execute _command_ with a new cookie.
    
           **copy**
               Copy the cookie from an existing PID (**-s**) to another PID (**-d**),
               or execute _command_ with that cookie. If **-s** is omitted, it will
               get the cookie of the current **coresched** process.
    
           If no function is specified, it will run the **get** function.
    


## OPTIONS



           **-s** , **--source** _PID_
               Which _PID_ to get the cookie from. If this option is omitted,
               it will get the cookie from the current **coresched** process.
    
           **-d** , **--dest** _PID_
               Which _PID_ to modify the cookie of.
    
           **-t** , **--dest-type** _TYPE_
               The type of the PID whose cookie will be modified. This can be
               one of three values:
    
               •   **pid** , or process ID
    
               •   **tgid** , or thread group ID (default value)
    
               •   **pgid** , or process group ID
    
           **-v** , **--verbose**
               Show extra information when modifying cookies of tasks.
    
           **-h** , **--help**
               Display help text and exit.
    
           **-V** , **--version**
               Display version and exit.
    


## EXAMPLES



           Get the core scheduling cookie of the coresched task itself,
           usually inherited from its parent:
               **coresched get**
    
           Get the core scheduling cookie of a task with PID _123_ :
               **coresched get -s** _123_
    
           Give a task with PID _123_ a new core scheduling cookie:
               **coresched new -d** _123_
    
           Spawn a new task with a new core scheduling cookie:
               **coresched new** -- _command_ [_argument_...]
    
           Copy the cookie from the current coresched process another task
           with pid _456_ :
               **coresched copy -d** _456_
    
           Copy the cookie from a task with pid _123_ to another task with pid
           _456_ :
               **coresched copy -s** _123_ **-d** _456_
    
           Copy the cookie from a task with pid _123_ to a new task _command_ :
               **coresched copy -s** _123_ -- _command_ [_argument_...]
    
           Copy the cookie from a task with pid _123_ to the process group ID
           _456_ :
               **coresched copy -s** _123_ **-t** _pgid_ **-d** _456_
    


## PERMISSIONS



           Retrieving or modifying the core scheduling cookie of a process
           requires **PTRACE_MODE_READ_REALCREDS** ptrace access to that process.
           See the section "Ptrace access mode checking" in ptrace(2) for
           more information.
    


## EXIT STATUS



           On success, **coresched** returns 0. If **coresched** fails, it will print
           an error and return 1.
    
           If a _command_ is being executed, the return value of **coresched** will
           be the return value of _command_.
    


## NOTES



           **coresched** requires core scheduling support in the kernel. This can
           be enabled via the **CONFIG_SCHED_CORE** kernel config option.
    


## AVAILABILITY



           The **coresched** command is part of the util-linux package which can
           be downloaded from Linux Kernel Archive
           <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is
           part of the _util-linux_ (a random collection of Linux utilities)
           project. Information about the project can be found at 
           ⟨https://www.kernel.org/pub/linux/utils/util-linux/⟩. If you have a
           bug report for this manual page, send it to
           util-linux@vger.kernel.org. This page was obtained from the
           project's upstream Git repository
           ⟨git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git⟩ on
           2025-08-11. (At that time, the date of the most recent commit that
           was found in the repository was 2025-08-05.) If you discover any
           rendering problems in this HTML version of the page, or you
           believe there is a better or more up-to-date source for the page,
           or you have corrections or improvements to the information in this
           COLOPHON (which is _not_ part of the original manual page), send a
           mail to man-pages@man7.org
    
    util-linux 2.42-start-521-ec46  2025-08-09                   _CORESCHED_(1)
    


* * *