Difference between revisions of "CPU Shielding capability"

From eLinux.org
Jump to: navigation, search
(Created page with "; Summary: CPU Shielding capability ; Proposer: Tim Bird, Sony Mobile == Description == In multi-processor realtime systems, it is sometimes desirable to isolate some CPUs i...")
 
(Add selected status)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
; Summary: CPU Shielding capability
 
; Summary: CPU Shielding capability
 
 
; Proposer: Tim Bird, Sony Mobile
 
; Proposer: Tim Bird, Sony Mobile
 +
; Status: Selected to be sponsored by the CE Workgroup
  
 
== Description ==
 
== Description ==
Line 7: Line 7:
 
the system to enhance their capability to maintain realtime performance.
 
the system to enhance their capability to maintain realtime performance.
  
Normally, when the Linux kernel is running in an SMP configuration, any CPU may take an interrupt
+
Normally, when the Linux kernel is running in an SMP configuration, any CPU
or run a process.  Under realtime conditions, the operations of scheduling multiple processes
+
may take an interrupt or run a process.  Under realtime conditions, the
or handling an interrupt may interfere with a particular process meeting it's realtime deadlines.
+
operations of scheduling multiple processes or handling an interrupt may
 +
interfere with a particular process meeting it's realtime deadlines.
  
It would be nice to be able to isolate a realtime process on a CPU such that it was shielded
+
It would be nice to be able to isolate a realtime process on a CPU such
from the scheduling of other processes and from handling interrupts.
+
that it was shielded from the scheduling of other processes and from
 +
handling interrupts.
  
This project would create a new 'shield' command, which would restrict a particular CPU
+
This project would create a new 'shield' command, which would restrict a
to execution of an particular process (or set of processes), and also prevent that CPU
+
particular CPU to execution of an particular process (or set of processes),
from handling interrupts.  This might involve modifying the kernel scheduler and using
+
and also prevent that CPU from handling interrupts.  This might involve
IRQ affinity features in the kernel to achieve this result.
+
modifying the kernel scheduler and using IRQ affinity features in the
 +
kernel to achieve this result.
  
cgroups supports such a feature, called 'cpusets', but if the feature can be provided outside
+
cgroups supports such a feature, called 'cpusets', but if the feature can
of cgroups, that would be better, since cgroups is generally incompatible with realtime embedded Linux.
+
be provided outside of cgroups, that would be better, since cgroups is
 +
generally incompatible with realtime embedded Linux.
  
 
== Related work ==
 
== Related work ==
 
* RedHawk Linux has a command called 'shield' which performs this function:  
 
* RedHawk Linux has a command called 'shield' which performs this function:  
 
** http://wiki.simwb.com/swbwiki/swbdoc/UserManualFlash/SimConfig/optimizing/optimizing.htm
 
** http://wiki.simwb.com/swbwiki/swbdoc/UserManualFlash/SimConfig/optimizing/optimizing.htm
 +
* http://www.janoszen.com/2013/02/06/limiting-linux-processes-cgroups-explained/
 +
* isolcpus on kernel command line
 +
** http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/re46.html
 +
** from Documentation/kernel-parameters.txt:
 +
isolcpus=[KNL,SMP] Isolate CPUs from the general scheduler.
 +
  Format:
 +
  <cpu number>,...,<cpu number>
 +
  or
 +
  <cpu number>-<cpu number>
 +
  (must be a positive range in ascending order)
 +
  or a mixture
 +
  <cpu number>,...,<cpu number>-<cpu number>
 +
 
 +
  This option can be used to specify one or more CPUs
 +
  to isolate from the general SMP balancing and scheduling
 +
  algorithms. You can move a process onto or off an
 +
  "isolated" CPU via the CPU affinity syscalls or cpuset.
 +
  <cpu number> begins at 0 and the maximum value is
 +
  "number of CPUs in system - 1".
 +
 
 +
  This option is the preferred way to isolate CPUs. The
 +
  alternative -- manually setting the CPU mask of all
 +
  tasks in the system -- can cause problems and
 +
  suboptimal load balancer performance.
  
 
== Scope ==
 
== Scope ==
Line 33: Line 61:
  
 
== Comments ==
 
== Comments ==
 +
What is isolcpus missing, in order for it to fulfill the needed functionality?
 +
 +
If cgroups had less overhead, would that be sufficient for this feature?
 +
 +
Does the feature need to be configurable at runtime? (isolcpus is at boot time)
  
 
[[Category:Project proposals 2013]]
 
[[Category:Project proposals 2013]]

Latest revision as of 17:20, 27 December 2013

Summary
CPU Shielding capability
Proposer
Tim Bird, Sony Mobile
Status
Selected to be sponsored by the CE Workgroup

Description

In multi-processor realtime systems, it is sometimes desirable to isolate some CPUs in the system to enhance their capability to maintain realtime performance.

Normally, when the Linux kernel is running in an SMP configuration, any CPU may take an interrupt or run a process. Under realtime conditions, the operations of scheduling multiple processes or handling an interrupt may interfere with a particular process meeting it's realtime deadlines.

It would be nice to be able to isolate a realtime process on a CPU such that it was shielded from the scheduling of other processes and from handling interrupts.

This project would create a new 'shield' command, which would restrict a particular CPU to execution of an particular process (or set of processes), and also prevent that CPU from handling interrupts. This might involve modifying the kernel scheduler and using IRQ affinity features in the kernel to achieve this result.

cgroups supports such a feature, called 'cpusets', but if the feature can be provided outside of cgroups, that would be better, since cgroups is generally incompatible with realtime embedded Linux.

Related work

isolcpus=[KNL,SMP] Isolate CPUs from the general scheduler.
  Format:
  <cpu number>,...,<cpu number>
  or
  <cpu number>-<cpu number>
  (must be a positive range in ascending order)
  or a mixture
  <cpu number>,...,<cpu number>-<cpu number>
  
  This option can be used to specify one or more CPUs
  to isolate from the general SMP balancing and scheduling
  algorithms. You can move a process onto or off an
  "isolated" CPU via the CPU affinity syscalls or cpuset.
  <cpu number> begins at 0 and the maximum value is
  "number of CPUs in system - 1".
  
  This option is the preferred way to isolate CPUs. The
  alternative -- manually setting the CPU mask of all
  tasks in the system -- can cause problems and
  suboptimal load balancer performance.

Scope

Unknown

Contractor Candidates

None yet.

Comments

What is isolcpus missing, in order for it to fulfill the needed functionality?

If cgroups had less overhead, would that be sufficient for this feature?

Does the feature need to be configurable at runtime? (isolcpus is at boot time)