Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / puppet / files / puppet-drbd / 0006-CGTS-7164-Add-resource-options-cpu-mask-to-affine-drbd-kernel-threads.patch
1 From 0e264e7ac2b311aa9b42b183660a07b7e4e36b11 Mon Sep 17 00:00:00 2001
2 From: Jim Gauld <james.gauld@windriver.com>
3 Date: Fri, 9 Jun 2017 14:58:23 -0400
4 Subject: [PATCH 1/1] CGTS-7164: Add resource options cpu-mask to affine drbd
5  kernel threads
6
7 This adds "options { cpu-mask <cpumask>; }" section to DRBD resource
8 configuration if 'cpumask' hexstring is defined. This governs kernel
9 threads: drbd_w_<x>, drbd_r_<x>, drbd_a_<x>.
10
11 Related notes:
12 - if cpumask is not specified, the kernel threads drbd_w_<x>, drbd_r_<x>,
13   drbd_a_<x>, and drbd_as_<x> are affined to individual cores, each <x>
14   on a different core.
15
16 - the remainder of the kernel threads are governed by kernel boot
17   argument kthread_cpus=<cpulist>.  i.e., drbd-reissue, drbd<x>_submit,
18   jbd2/drbd<x>-8, drbd_as_<x>.
19
20 - the drbd_a_<x> and drbd_as_<x> show up when DRBD is duplex.
21
22 - the drbd_a_<x> threads have SCHED_RR scheduling policy.
23 ---
24  manifests/resource.pp    | 3 +++
25  templates/header.res.erb | 6 ++++++
26  2 files changed, 9 insertions(+)
27
28 diff --git a/manifests/resource.pp b/manifests/resource.pp
29 index d19ad8b..17e6142 100644
30 --- a/manifests/resource.pp
31 +++ b/manifests/resource.pp
32 @@ -26,6 +26,8 @@
33  #  [link_speed] replication link network speed mbps
34  #  [num_parallel] number of parallel drbd filesystems to sync
35  #  [rtt_ms] round-trip-time milliseconds (i.e., ping between replication nodes)
36 +#  [cpumask] cpu-affinity-mask for DRBD kernel threads (hexidecimal notation).
37 +#    0 means spread over all CPUs of the machine.
38  define drbd::resource (
39    $host1          = undef,
40    $host2          = undef,
41 @@ -48,6 +50,7 @@ define drbd::resource (
42    $num_parallel   = false,
43    $rtt_ms         = false,
44    $resync_after   = undef,
45 +  $cpumask        = false,
46    $net_parameters = false,
47    $manage         = true,
48    $ha_primary     = false,
49 diff --git a/templates/header.res.erb b/templates/header.res.erb
50 index be53761..df52544 100644
51 --- a/templates/header.res.erb
52 +++ b/templates/header.res.erb
53 @@ -29,6 +29,12 @@ resource <%= @name %> {
54  <% end -%>
55    }
56  
57 +<% if @cpumask -%>
58 +  options {
59 +    cpu-mask <%= @cpumask %>;
60 +  }
61 +<% end -%>
62 +
63    net {
64      after-sb-0pri discard-zero-changes;
65      after-sb-1pri discard-secondary;
66 -- 
67 1.8.3.1
68