summaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/include/linux
diff options
context:
space:
mode:
authorAmir Shehata <amir.shehata@intel.com>2016-02-22 17:29:23 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-22 18:05:49 -0800
commit95fc2938eb923cf26a95d692e7380f6b5e5db895 (patch)
tree4cc3282d23b1f32644591fd2a4652a9dd599391d /drivers/staging/lustre/include/linux
parent83c991b29b43b3b5883ede3c6646d1f56be67994 (diff)
downloadop-kernel-dev-95fc2938eb923cf26a95d692e7380f6b5e5db895.zip
op-kernel-dev-95fc2938eb923cf26a95d692e7380f6b5e5db895.tar.gz
staging: lustre: Allocate the correct number of rtr buffers
This patch ensures that the correct number of router buffers are allocated. It keeps a count that keeps track of the number of buffers allocated. Another count keeps the number of buffers requested. The number of buffers allocated is set when creating new buffers and reduced when buffers are freed. The number of requested buffer is set when the buffers are allocated and is checked when credits are returned to determine whether the buffer should be freed or kept. In lnet_rtrpool_adjust_bufs() grab lnet_net_lock() before using rbp_nbuffers to ensure that it doesn't change by lnet_return_rx_credits_locked() during the process of allocating new buffers. All other access to rbp_nbuffers is already being protected by lnet_net_lock(). This avoids the case where we allocate less than the desired number of buffers. Signed-off-by: Amir Shehata <amir.shehata@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6122 Reviewed-on: http://review.whamcloud.com/13519 Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/include/linux')
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lib-types.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index c10f03b..07b8db1 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -396,7 +396,10 @@ typedef struct {
struct list_head rbp_msgs; /* messages blocking
for a buffer */
int rbp_npages; /* # pages in each buffer */
- int rbp_nbuffers; /* # buffers */
+ /* requested number of buffers */
+ int rbp_req_nbuffers;
+ /* # buffers actually allocated */
+ int rbp_nbuffers;
int rbp_credits; /* # free buffers /
blocked messages */
int rbp_mincredits; /* low water mark */
OpenPOWER on IntegriCloud