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
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>.
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>
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>.
20 - the drbd_a_<x> and drbd_as_<x> show up when DRBD is duplex.
22 - the drbd_a_<x> threads have SCHED_RR scheduling policy.
24 manifests/resource.pp | 3 +++
25 templates/header.res.erb | 6 ++++++
26 2 files changed, 9 insertions(+)
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
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 (
41 @@ -48,6 +50,7 @@ define drbd::resource (
42 $num_parallel = false,
44 $resync_after = undef,
46 $net_parameters = 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 %> {
59 + cpu-mask <%= @cpumask %>;
64 after-sb-0pri discard-zero-changes;
65 after-sb-1pri discard-secondary;