LU-1282 lprocfs: Use present cpu numbers to save memory
Port of combined patch from master branch:
Commit
65dc702123f91c4fb2ae25604f98e195fcc15544
Commit
8c831cb8a05f0d6f63b88e9b2dfb85ba4eca217a
Commit
560efa06be97651252caff4ba9bc2c014cf62ff9
* lprocfs stats data should allocated by the number of present cpus in
stead of by possible cpu number which wastes a lot of memory.
* When new cpus are hot-plugged in, alloc necessary percpu array
elements on demand.
* Add a LPROCFS_STATS_FLAG_IRQ_SAFE flag, when a stat is non-percpu
stats with this flag, lprocfs_stats_lock() should disable irq.
* OSS minimum thread number also better be decided by online cpu
number.
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I7e80f27123d2e0a6352dc8d01e6ca70b9f137220
Reviewed-on: http://review.whamcloud.com/3607
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>