From 9dd333fbb77fdc5b9d958f678548acfd2c369d59 Mon Sep 17 00:00:00 2001 From: Jim Gauld Date: Wed, 28 Oct 2020 17:31:03 -0400 Subject: [PATCH] Format DRBD resource cpu-mask to support 64 or larger cpus This changes the input format of DRBD resource config option cpu-mask so it is correctly parsed in the kernel. The underlying bitmap_parse routine expects large hex values delimited every 8 characters with a comma. e.g., On large cpu systems, we would see the following kern.log : 2020-10-13T20:55:34.079 controller-0 kernel: warning [ 269.423462] drbd drbd-dockerdistribution: Overflow in bitmap_parse(300000003), truncating to 64 bits This resulted in drbd_w_* tasks affined to individual cores instead of platform cores. Change-Id: I59caaa293af0c905eddef00b7b03da921e4510b7 Closes-Bug: 1900174 Signed-off-by: Jim Gauld --- ...pu-mask-to-support-64-or-larger-cpus.patch | 43 +++++++++++++++++++ .../puppet-drbd-0.3.1/centos/puppet-drbd.spec | 2 + 2 files changed, 45 insertions(+) create mode 100644 config/puppet-modules/puppet-drbd-0.3.1/centos/files/0010-Format-DRBD-resource-cpu-mask-to-support-64-or-larger-cpus.patch diff --git a/config/puppet-modules/puppet-drbd-0.3.1/centos/files/0010-Format-DRBD-resource-cpu-mask-to-support-64-or-larger-cpus.patch b/config/puppet-modules/puppet-drbd-0.3.1/centos/files/0010-Format-DRBD-resource-cpu-mask-to-support-64-or-larger-cpus.patch new file mode 100644 index 000000000..3f1ff0939 --- /dev/null +++ b/config/puppet-modules/puppet-drbd-0.3.1/centos/files/0010-Format-DRBD-resource-cpu-mask-to-support-64-or-larger-cpus.patch @@ -0,0 +1,43 @@ +From 65b4c4ca7da29d4d91f3d61c4dd1f59fb06aeada Mon Sep 17 00:00:00 2001 +From: Jim Gauld +Date: Wed, 28 Oct 2020 17:09:20 -0400 +Subject: [PATCH] Format DRBD resource cpu-mask to support 64 or larger cpus + +This changes the input format of DRBD resource config option +cpu-mask so it is correctly parsed in the kernel. The underlying +bitmap_parse routine expects large hex values delimited every 8 +characters with a comma. + +e.g., On large cpu systems, we would see the following kern.log : +2020-10-13T20:55:34.079 controller-0 kernel: warning [ 269.423462] drbd +drbd-dockerdistribution: Overflow in bitmap_parse(300000003), truncating +to 64 bits + +This resulted in drbd_w_* tasks affined to individual cores instead of +platform cores. + +Signed-off-by: Jim Gauld +--- + templates/header.res.erb | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/templates/header.res.erb b/templates/header.res.erb +index df52544..6ac837b 100644 +--- a/templates/header.res.erb ++++ b/templates/header.res.erb +@@ -31,7 +31,11 @@ resource <%= @name %> { + + <% if @cpumask -%> + options { +- cpu-mask <%= @cpumask %>; ++<%# To support 64 cpu systems or larger, need to format cpu-mask string ++with surrounding double quotes. Also must delimit the hex string in ++8 character groups starting from the right. This prevents DRBD kernel ++module bitmap_parse() routine from truncating input at 64 bits. -%> ++ cpu-mask "<%= @cpumask.reverse.scan(/.{1,8}/).join(',').reverse %>"; + } + <% end -%> + +-- +1.8.3.1 + diff --git a/config/puppet-modules/puppet-drbd-0.3.1/centos/puppet-drbd.spec b/config/puppet-modules/puppet-drbd-0.3.1/centos/puppet-drbd.spec index 0c8320e8f..3afec784f 100644 --- a/config/puppet-modules/puppet-drbd-0.3.1/centos/puppet-drbd.spec +++ b/config/puppet-modules/puppet-drbd-0.3.1/centos/puppet-drbd.spec @@ -21,6 +21,7 @@ Patch0006: 0006-CGTS-7164-Add-resource-options-cpu-mask-to-affine-drbd-kern Patch0007: 0007-Add-disk-by-path-test.patch Patch0008: 0008-CGTS-7953-support-for-new-drbd-resources.patch Patch0009: 0009-drbd-slow-before-swact.patch +Patch0010: 0010-Format-DRBD-resource-cpu-mask-to-support-64-or-larger-cpus.patch BuildArch: noarch @@ -53,6 +54,7 @@ find . \( -name spec -o -name ext \) | xargs rm -rf %patch0007 -p1 %patch0008 -p1 %patch0009 -p1 +%patch0010 -p1 %install rm -rf %{buildroot}