From 51d6a9e73384ed7ceff88022eb1c73a503896d52 Mon Sep 17 00:00:00 2001 From: Li Wei Date: Tue, 6 Nov 2012 21:39:57 +0800 Subject: [PATCH] LU-2282 obdclass: Slightly increase the size of lu_keys[] After an "FSTYPE=ldiskfs sh llmount.sh" on a single-node setup, all the thirty-two slots in lu_keys[] will be consumed. For example, Slot Key Address Owner ------------------------------------------ lu_keys[0] ffffffffa0a4bd00 obdclass lu_keys[1] ffffffffa0a4fac0 obdclass lu_keys[2] ffffffffa0a4d4a0 obdclass lu_keys[3] ffffffffa0a58900 obdclass lu_keys[4] ffffffffa0a4fd80 obdclass lu_keys[5] ffffffffa0a2d940 obdclass lu_keys[6] ffffffffa0c34260 ptlrpc lu_keys[7] ffffffffa05577a0 fld lu_keys[8] ffffffffa0131240 fid lu_keys[9] ffffffffa0692140 osc lu_keys[10] ffffffffa0692180 osc lu_keys[11] ffffffffa074a320 lov lu_keys[12] ffffffffa074a360 lov lu_keys[13] ffffffffa07d3860 obdecho lu_keys[14] ffffffffa07d38a0 obdecho lu_keys[15] ffffffffa0819140 lquota lu_keys[16] ffffffffa0822460 lquota lu_keys[17] ffffffffa081c280 lquota lu_keys[18] ffffffffa0afbd60 mgs lu_keys[19] ffffffffa0d00fa0 mdd lu_keys[20] ffffffffa0d01c20 mdd lu_keys[21] ffffffffa0d00f60 mdd lu_keys[22] ffffffffa0dd56a0 osd_ldiskfs lu_keys[23] ffffffffa0e6bf40 mdt lu_keys[24] ffffffffa0ecb6c0 lod lu_keys[25] ffffffffa08576c0 osp lu_keys[26] ffffffffa0857700 osp lu_keys[27] ffffffffa0f17200 ofd lu_keys[28] ffffffffa0fd48e0 lustre lu_keys[29] ffffffffa0fd4920 lustre lu_keys[30] ffffffffa0fd64e0 lustre lu_keys[31] ffffffffa0fd6520 lustre Loading osd_zfs.ko at this point, which is necessary under certain debugging/testing circumstances, will get ENFILE from lu_context_key_register(). To make developing on single-node setups easier while minimizing new array iterating overhead, this patch increases the size of lu_keys[] by eight words. A couple of additional things were considered too. First, the number of keys may be reducible. For instance, the md_ucred and md_capainfo keys in mdd might be merged into the mdd_thread_info key, at a quick glance. However, the amount of change is not small. The other thing is that lu_keys[] could be dynamically allocated and grown on demand. But additional locking is required when synchronizing lu_context::lc_value[]s with lu_keys[]. Change-Id: I211bdb8af524a79f99b11f73e7260572459ccb17 Signed-off-by: Li Wei Reviewed-on: http://review.whamcloud.com/4476 Tested-by: Hudson Reviewed-by: Alex Zhuravlev Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Mike Pershin --- lustre/obdclass/lu_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index 1f9eb53..74c1cc9 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1264,7 +1264,7 @@ enum { /** * Maximal number of tld slots. */ - LU_CONTEXT_KEY_NR = 32 + LU_CONTEXT_KEY_NR = 40 }; static struct lu_context_key *lu_keys[LU_CONTEXT_KEY_NR] = { NULL, }; -- 1.8.3.1