summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: lustre: rearrange placement of CPU partition management code.NeilBrown2018-04-231-1079/+0
| | | | | | | | | | | | | | | | | | | | | Currently the code for cpu-partition tables lives in various places. The non-SMP code is partly in libcfs/libcfs_cpu.h as static inlines, and partly in lnet/libcfs/libcfs_cpu.c - some of the functions are tiny and could well be inlines. The SMP code is all in lnet/libcfs/linux/linux-cpu.c. This patch moves all the trivial non-SMP functions into libcfs_cpu.h as inlines, and all the SMP functions into libcfs_cpu.c with the non-trival !SMP code. Now when you go looking for some function, it is easier to find both versions together when neither is trivial. There is no code change here - just code movement. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: fix assorted checkpatch errorsNeilBrown2018-02-221-1/+1
| | | | | | | | | | Possibly the most interesting is the for-loop with no body. Rearranging and initializing end_dirent on each iteration of the outer while, makes the intent clearer. Reviewed-by: "Eremin, Dmitry" <dmitry.eremin@intel.com> Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: more LIBCFS_ALLOC conversions to GFP_KERNEL allocations.NeilBrown2018-01-091-12/+7
| | | | | | | | None of these need GFP_NOFS so allocate directly. Change matching LIBCFS_FREE() to kfree() or kvfree(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: switch to cpumask_var_tNeilBrown2018-01-091-51/+41
| | | | | | | | | | | | | So that we can use the common cpumask allocation functions, switch to cpumask_var_t. We need to be careful not to free a cpumask_var_t until the variable has been initialized, and it cannot be initialized directly. So we must be sure either that it is filled with zeros, or that zalloc_cpumask_var() has been called on it. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: replace simple cases of LIBCFS_ALLOC with kzalloc.NeilBrown2018-01-091-11/+8
| | | | | | | | | | | | | | | | | | | | | All usages of the form LIBCFS_ALLOC(variable, sizeof(variable)) or LIBCFS_ALLOC(variable, sizeof(variable's-type)) are changed to variable = kzalloc(sizeof(...), GFP_NOFS); Similarly, all LIBCFS_FREE(variable, sizeof(variable)) become kfree(variable); None of these need the vmalloc option, or any of the other minor benefits of LIBCFS_ALLOC(). Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: disable preempt while sampling processor id.NeilBrown2018-01-081-6/+7
| | | | | | | | | | | | | | | Calling smp_processor_id() without disabling preemption triggers a warning (if CONFIG_DEBUG_PREEMPT). I think the result of cfs_cpt_current() is only used as a hint for load balancing, rather than as a precise and stable indicator of the current CPU. So it doesn't need to be called with preemption disabled. So disable preemption inside cfs_cpt_current() to silence the warning. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: use strim instead of cfs_trimwhite.NeilBrown2018-01-081-4/+4
| | | | | | | | | Linux lib provides identical functionality to cfs_trimwhite, so discard that code and use the standard. Signed-off-by: NeilBrown <neilb@suse.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: add SPDX identifiers to all lustre filesGreg Kroah-Hartman2017-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/lustre files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: add include path to MakefileJames Simmons2017-08-221-1/+1
| | | | | | | Rationalize include paths in the libcfs source code files. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: fix error messagesDmitry Eremin2017-02-031-2/+3
| | | | | | | | | | | | | | Don't treat unability to set CPU partition affinity as error. Improve those warning messages. Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8703 Reviewed-on: https://review.whamcloud.com/23307 Reviewed-by: Patrick Farrell <paf@cray.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: default CPT matches NUMA topologyDmitry Eremin2017-02-031-1/+1
| | | | | | | | | | | | | | Change default value of CPT pattern and make it match NUMA topology Signed-off-by: Liang Zhen <liang.zhen@intel.com> Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5050 Reviewed-on: http://review.whamcloud.com/22377 Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: avoid stomping on module param cpu_patternDmitry Eremin2017-02-031-1/+9
| | | | | | | | | | | | | | | | | | The function cfs_cpt_table_create_pattern() alters the string passed to it. Currently we are passing in the module parameter string cpu_pattern which is incorrect. Instead lets duplicate the module parameter string and pass that to the function cfs_cpt_table_create_pattern(). Signed-off-by: Liang Zhen <liang.zhen@intel.com> Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5050 Reviewed-on: http://review.whamcloud.com/22377 Reviewed-by: James Simmons <uja.ornl@yahoo.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/lustre/libcfs: Convert to hotplug state machineAnna-Maria Gleixner2016-12-251-40/+45
| | | | | | | | | | | | | | | | | | Install the callbacks via the state machine. No functional change. Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: devel@driverdev.osuosl.org Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: rt@linutronix.de Cc: lustre-devel@lists.lustre.org Link: http://lkml.kernel.org/r/20161202110027.htzzeervzkoc4muv@linutronix.de Link: http://lkml.kernel.org/r/20161221192111.922872524@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* staging: lustre: libcfs: white space cleanupJames Simmons2016-11-181-50/+50
| | | | | | | | | Remove white space present for variable declarations or initialization. Cleanup structs was strange alignments due to white spacing. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: remove == 0 testingJames Simmons2016-11-181-6/+6
| | | | | | | | Testing == 0 is not kernel style so remove this type of testing from libcfs. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: remove != 0 testingJames Simmons2016-11-181-7/+7
| | | | | | | | Testing != 0 is not kernel style so remove this type of testing from libcfs. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: don't use bare unsignedJames Simmons2016-11-181-3/+3
| | | | | | | | Turn all bare unsigned to unsigned int that were detected by checkpatch in the LNet/libcfs layer. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: remove broken dead code in cfs_cpt_table_create_patternArnd Bergmann2016-10-251-7/+0
| | | | | | | | | | | | | | | | | | | After a recent bugfix, we get a warning about the use of an uninitialized variable: drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c: In function 'cfs_cpt_table_create_pattern': drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c:833:7: error: 'str' may be used uninitialized in this function [-Werror=maybe-uninitialized] This part of the function used to not do anything as we would reassign the 'str' pointer to something else right away, but now we pass an uninitialized pointer into 'strchr', which can cause a kernel page fault or worse. Fixes: 239fd5d41f9b ("staging: lustre: libcfs: shortcut to create CPT from NUMA topology") Cc: Liang Zhen <liang.zhen@intel.com> Cc: James Simmons <jsimmons@infradead.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: shortcut to create CPT from NUMA topologyLiang Zhen2016-10-161-8/+40
| | | | | | | | | | | | | | | | | | If user wants to create CPT table that can match numa topology, she has to query cpu & numa topology, then provide a pattern string to describe the topology, this is inconvenient. To improve it, this patch can support shortcut expression "N" or "n" to create CPT table from NUMA & CPU topology Signed-off-by: Liang Zhen <liang.zhen@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6325 Reviewed-on: http://review.whamcloud.com/14049 Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Bobi Jam <bobijam@hotmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: check mask returned by cpumask_of_nodeLiang Zhen2016-09-191-3/+14
| | | | | | | | | | | | | | | | cpumask_of_node can return NULL if NUMA node is unavailable, in this case cfs_node_to_cpumask will try to copy from NULL and cause kernel panic. Signed-off-by: Liang Zhen <liang.zhen@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5751 Reviewed-on: http://review.whamcloud.com/13207 Reviewed-by: Li Wei <wei.g.li@intel.com> Reviewed-by: Bobi Jam <bobijam@hotmail.com> Reviewed-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: Fix NUMA emulated modeAndriy Skulysh2016-04-281-2/+7
| | | | | | | | | | | | | | | Kernel commit c1c3443c9c5e9be92641029ed229a41563e44506 assigns all allowed cpus to emulated node. End cpt initialization loop when all CPUs are assigned. Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3992 Reviewed-on: http://review.whamcloud.com/7724 Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: move libcfs to lnet layerJames Simmons2016-03-101-0/+1040
The lustre file system has a layered architecture with libcfs as the lowest layer and LNet layered on top. Then on top of LNet we run the lustre client. This patch moves the libcfs module code out of lustre into the lnet tree. This fits into the long term goal of eventually merging libcfs into LNet. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud