Skip to content
Snippets Groups Projects
Commit 46fb3813 authored by Bobi Jam's avatar Bobi Jam
Browse files

Branch b1_6

b=12744
i=adilger, johann

get rid of smp_num_cpus, instead use num_online_cpus() and/or num_possible_cpus().
parent 082ec6ae
No related branches found
No related tags found
No related merge requests found
...@@ -95,8 +95,11 @@ typedef unsigned short umode_t; ...@@ -95,8 +95,11 @@ typedef unsigned short umode_t;
#ifndef smp_processor_id #ifndef smp_processor_id
#define smp_processor_id() 0 #define smp_processor_id() 0
#endif #endif
#ifndef smp_num_cpus #ifndef num_online_cpus
#define smp_num_cpus 1 #define num_online_cpus() 1
#endif
#ifndef num_possible_cpus
#define num_possible_cpus() 1
#endif #endif
/* always adopt 2.5 definitions */ /* always adopt 2.5 definitions */
......
...@@ -27,7 +27,7 @@ struct obd_device; ...@@ -27,7 +27,7 @@ struct obd_device;
#define OBD_LDLM_DEVICENAME "ldlm" #define OBD_LDLM_DEVICENAME "ldlm"
#define LDLM_DEFAULT_LRU_SIZE (100 * smp_num_cpus) #define LDLM_DEFAULT_LRU_SIZE (100 * num_online_cpus())
#define LDLM_DEFAULT_MAX_ALIVE (cfs_time_seconds(36000)) #define LDLM_DEFAULT_MAX_ALIVE (cfs_time_seconds(36000))
typedef enum { typedef enum {
......
...@@ -85,10 +85,11 @@ ...@@ -85,10 +85,11 @@
* considered full when less than ?_MAXREQSIZE is left in them. * considered full when less than ?_MAXREQSIZE is left in them.
*/ */
#define LDLM_THREADS_AUTO_MIN min((int)(smp_num_cpus * smp_num_cpus * 2), 8) #define LDLM_THREADS_AUTO_MIN \
min((int)(num_online_cpus() * num_online_cpus() * 2), 8)
#define LDLM_THREADS_AUTO_MAX (LDLM_THREADS_AUTO_MIN * 16) #define LDLM_THREADS_AUTO_MAX (LDLM_THREADS_AUTO_MIN * 16)
#define LDLM_BL_THREADS LDLM_THREADS_AUTO_MIN #define LDLM_BL_THREADS LDLM_THREADS_AUTO_MIN
#define LDLM_NBUFS (64 * smp_num_cpus) #define LDLM_NBUFS (64 * num_online_cpus())
#define LDLM_BUFSIZE (8 * 1024) #define LDLM_BUFSIZE (8 * 1024)
#define LDLM_MAXREQSIZE (5 * 1024) #define LDLM_MAXREQSIZE (5 * 1024)
#define LDLM_MAXREPSIZE (1024) #define LDLM_MAXREPSIZE (1024)
...@@ -97,7 +98,7 @@ ...@@ -97,7 +98,7 @@
#define MDS_THREADS_MIN 2 #define MDS_THREADS_MIN 2
#define MDS_THREADS_MAX 512 #define MDS_THREADS_MAX 512
#define MDS_THREADS_MIN_READPAGE 2 #define MDS_THREADS_MIN_READPAGE 2
#define MDS_NBUFS (64 * smp_num_cpus) #define MDS_NBUFS (64 * num_online_cpus())
#define MDS_BUFSIZE (8 * 1024) #define MDS_BUFSIZE (8 * 1024)
/* Assume file name length = FNAME_MAX = 256 (true for ext3). /* Assume file name length = FNAME_MAX = 256 (true for ext3).
* path name length = PATH_MAX = 4096 * path name length = PATH_MAX = 4096
...@@ -121,7 +122,7 @@ ...@@ -121,7 +122,7 @@
#define MGS_THREADS_AUTO_MIN 2 #define MGS_THREADS_AUTO_MIN 2
#define MGS_THREADS_AUTO_MAX 32 #define MGS_THREADS_AUTO_MAX 32
#define MGS_NBUFS (64 * smp_num_cpus) #define MGS_NBUFS (64 * num_online_cpus())
#define MGS_BUFSIZE (8 * 1024) #define MGS_BUFSIZE (8 * 1024)
#define MGS_MAXREQSIZE (8 * 1024) #define MGS_MAXREQSIZE (8 * 1024)
#define MGS_MAXREPSIZE (9 * 1024) #define MGS_MAXREPSIZE (9 * 1024)
...@@ -129,7 +130,7 @@ ...@@ -129,7 +130,7 @@
/* Absolute limits */ /* Absolute limits */
#define OSS_THREADS_MIN 2 #define OSS_THREADS_MIN 2
#define OSS_THREADS_MAX 512 #define OSS_THREADS_MAX 512
#define OST_NBUFS (64 * smp_num_cpus) #define OST_NBUFS (64 * num_online_cpus())
#define OST_BUFSIZE (8 * 1024) #define OST_BUFSIZE (8 * 1024)
/* OST_MAXREQSIZE ~= 4768 bytes = /* OST_MAXREQSIZE ~= 4768 bytes =
* lustre_msg + obdo + 16 * obd_ioobj + 256 * niobuf_remote * lustre_msg + obdo + 16 * obd_ioobj + 256 * niobuf_remote
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment