LU-4786 osc: to not pick busy pages for ELC

This is a combination of commit 154fb1f7 from LU-3321 and commit
bfae5a4e from LU-4300. This patch is only required in b2_5 as the
code is already in 2.6.

Use weigh_ast to decide if a lock covers any pages.
In recovery, weigh_ast will be used to decide if a DLM read lock
covers any locked pages, or it will be canceled instead being
recovered.

The problem with the original implementation is that it attached
each osc_page to an osc_lock also changed lock state to add every
pages for readahead.

Bugzilla-bug-Id: b=16774

Change the policy of ELC to pick locks that have no dirty pages,
no page in writeback state, and no locked pages.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I9e560a991deee82fc45f1e9ddf9380747dc5af3f
LU-3428 build: fix 'uninitialized variables' errors

Fix 'uninitialized variables' defects found by Coverity version 6.5.1:
Uninitialized scalar variable (UNINIT)
Using uninitialized value.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I594b3c509ec72cb35829fb675c4a23c6ef03b6d8
Reviewed-on: http://review.whamcloud.com/6511
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobbie Lind <bobbie.j.lind@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4584 mdt: ensure orig lock is found in hash upon resend

Look for 1st lock found in hash for remote_hdl but that's not
new_lock itself.
There should only be 2 upon resent, new_lock and the 1st/orig
one we want ...

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Change-Id: If2b9287ef2d919ac46d8bf3a237b7040947db96b
Patch-Set: 9
LU-5549 mdc: cl_default_mds_easize not refreshed

The client_obd::cl_default_mds_easize field should track the largest
observed EA size advertised by the MDT, subject to a reasonable upper
bound.  The MDC uses cl_default_mds_easize to calculate the initial
size of request buffers.  The default value should be small enough to
avoid wasted memory and excessive use of vmalloc(), yet large enough
to accommodate the common use case.

In the current code, the default value is only updated if
client_obd::cl_max_mds_easize is strictly less than
mdt_body::mbo_max_mdsize. This condition is almost never met, because
client_obd::cl_max_mds_easize is computed at client mount-time based
on the number of OSTs in the filesystem, so the MDT won't ever observe
and advertise an EA size larger than that.

As a result, client_obd::cl_default_mds_easize indefinitely retains
its initial value, which is computed at client mount-time based on
the filesystem's default stripe width. Any getattr() requests for
more widely striped files will consequently allocate a request buffer
that is too small, forcing reallocations on both the client and
server side. To avoid this, update client_obd::cl_default_mds_easize
independently of the value of client_obd::cl_max_mds_easize.

In addition, this patch includes these changes:

- Add comments to the client_obd structure to clarify what the
  cl_{default,max}_mds_{cookie,ea}size values mean.

- Prevent mdc_get_info() from storing uninitialized data in
  client_obd::cl_max_mds_cookiesize.

- Use LU_PAGE_SIZE to fix an upper bound for the default values.
  The former bound of PAGE_CACHE_SIZE is too large on 64k-page
  platforms (i.e. PPC), so it fails to prevent the vmalloc()
  spinlock contention described in LU-3338.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Change-Id: I363017844d6af3e6b67b7c03bd206226f9495116
Patch-Set: 2 (but proc name fix dropped)
LU-2263 ptlrpc: add missing newline in debug message

This should be merged with the earlier LU-2263 patch.

Although, upstream did not use this patch at all, favoring
a different patch.  We need to figure out if we can now
drop our LU-2263 patch al together.

Change-Id: I01ecbfc6a23334b5c9f44795826acdf665036210
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>