From 68ed546e43dbc4ba31b409e9dbf8a65ef9a7f425 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Thu, 12 Apr 2012 08:48:42 +0800 Subject: [PATCH] LU-1282 lprocfs: Add a module param to disable percpu stats Add an obdclass module option to choose to use a single lprocfs stats structure rather than percpu data. Signed-off-by: Bobi Jam Change-Id: I45d5a05029197e629d4f7d161a5e4e5d01a93bf5 Reviewed-on: http://review.whamcloud.com/2515 Tested-by: Hudson Reviewed-by: Christopher J. Morrone Reviewed-by: Jinshan Xiong Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/obdclass/lprocfs_status.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index cd09402..8c0c854 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -58,6 +58,10 @@ #if defined(LPROCFS) +static int lprocfs_no_percpu_stats = 0; +CFS_MODULE_PARM(lprocfs_no_percpu_stats, "i", int, 0644, + "Do not alloc percpu data for lprocfs stats"); + #define MAX_STRING_SIZE 128 /* for bug 10866, global variable */ @@ -1194,6 +1198,9 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num, if (num == 0) return NULL; + if (lprocfs_no_percpu_stats != 0) + flags |= LPROCFS_STATS_FLAG_NOPERCPU; + if (flags & LPROCFS_STATS_FLAG_NOPERCPU) num_cpu = 1; else -- 1.8.3.1