Whamcloud - gitweb
LU-6356 ptlrpc: do not sleep if encpool reached max capacity 70/15070/4
authorSebastien Buisson <sebastien.buisson@bull.net>
Fri, 29 May 2015 13:20:41 +0000 (15:20 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 26 Aug 2015 21:42:12 +0000 (21:42 +0000)
commit7571f2b4ef59d8ec42c320e08d346cd9c6447f4b
tree8222fa36fd487d9fc9401807df6a20f1e55a7608
parent2aa7bd74f6fae63692c65217b5dd38a709b0c0bd
LU-6356 ptlrpc: do not sleep if encpool reached max capacity

When using krb5p Kerberos flavor, RPCs are encrypted just before being
sent. This encryption requires allocating memory in the encoding pool.
The current implementation in sptlrpc_enc_pool_get_pages() is
deadlock-prone. Indeed, if there is no more free pages in the pool,
all ptlrpcd threads can end up waiting in a queue, so there is no
thread available to process other requests. It means client is not
able to process replies from servers that yet contain last committed
transno useful to release memory allocated by previous requests,
including enc_pool pages.

To fix this, in sptlrpc_enc_pool_get_pages(), do not make ptlrpcd
threads wait in queue if encoding pool has already reached its maximum
capacity. Instead, return -ENOMEM. If functions calling ptl_send_rpc()
get -ENOMEM, then put back request in queue by moving it back to
RQ_PHASE_NEW phase.
As an optimization, do not call ptl_send_rpc() again for requests that
already failed to allocate in the enc_pool, as long as there is not
enough memory in the enc_pool to satisfy theirs needs.

In /proc/fs/lustre/sptlrpc/encrypt_page_pools, add a new 'out of mem'
stat to track how many requests fail to allocate memory in the
enc_pool.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: Ie4217bb15c8514d28d360e50a9be7716b52f5147
Reviewed-on: http://review.whamcloud.com/15070
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre_sec.h
lustre/ptlrpc/client.c
lustre/ptlrpc/niobuf.c
lustre/ptlrpc/sec_bulk.c