summaryrefslogtreecommitdiffstats
path: root/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-01-21 18:34:06 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-01-21 18:34:06 +0000
commit4c74ad945b5b20be3014178070b495f10c16a74e (patch)
treef76b2e9892bd056b3da3a03a0ad27c5f8d2bb9ab /patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
parent2662d9c5800b67d9375c22ccac439e3aeea3b4e5 (diff)
parente42a9b3011f96ad26f4a19db77ac44cad31a4290 (diff)
Merge "Uplift Armband to Fuel Newton"
Diffstat (limited to 'patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch')
-rw-r--r--patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch b/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
new file mode 100644
index 00000000..de0ca78a
--- /dev/null
+++ b/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
@@ -0,0 +1,30 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Sun, 15 Jan 2017 08:14:12 +0100
+Subject: [PATCH] AArch64: Read hugepage size from /proc/meminfo
+
+This method should be arch-indepedent, provided /proc/meminfo
+reports the correct information.
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ agent | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/agent b/agent
+index eeb4d26..d514de6 100755
+--- a/agent
++++ b/agent
+@@ -1399,6 +1399,13 @@ class NodeAgent
+ def supported_hugepages
+ return [2048, 1048576] if _get_detailed_cpuinfo['0'][:flags].include?('pdpe1gb')
+ return [2048] if _get_detailed_cpuinfo['0'][:flags].include?('pse')
++ # AArch64 does not expose CPU flags, but we can rely on /proc/meminfo
++ File.open('/proc/meminfo').each do |l|
++ case l.strip
++ when /Hugepagesize:\s+(\d+)\s+kB/
++ return [$1.to_i()]
++ end
++ end
+ []
+ end
+