Clarify in the code that the "osc.*.short_io_bytes" parameter is
the maximum IO size to pack into request/reply not the minimum.
Allow short_io to be disabled completely if it is set to zero.
It would be nice to also change the name of the /proc functions
in a similar manner but that also changes the /proc tunable name
(via LUSTRE_RW_ATTR() macro) and has compatibility implications
for sites that may have changed this value.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I3a91420d7e0405445558ba9203233d7f977cab07
Reviewed-on: https://review.whamcloud.com/33173
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
/* just a sum of the loi/lop pending numbers to be exported by /proc */
atomic_t cl_pending_w_pages;
atomic_t cl_pending_r_pages;
/* just a sum of the loi/lop pending numbers to be exported by /proc */
atomic_t cl_pending_w_pages;
atomic_t cl_pending_r_pages;
- __u32 cl_max_pages_per_rpc;
- __u32 cl_max_rpcs_in_flight;
- __u32 cl_short_io_bytes;
+ u32 cl_max_pages_per_rpc;
+ u32 cl_max_rpcs_in_flight;
+ u32 cl_max_short_io_bytes;
struct obd_histogram cl_read_rpc_hist;
struct obd_histogram cl_write_rpc_hist;
struct obd_histogram cl_read_page_hist;
struct obd_histogram cl_read_rpc_hist;
struct obd_histogram cl_write_rpc_hist;
struct obd_histogram cl_read_page_hist;
* from OFD after connecting. */
cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES;
* from OFD after connecting. */
cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES;
- cli->cl_short_io_bytes = OBD_MAX_SHORT_IO_BYTES;
+ cli->cl_max_short_io_bytes = OBD_MAX_SHORT_IO_BYTES;
/* set cl_chunkbits default value to PAGE_SHIFT,
* it will be updated at OSC connection time. */
/* set cl_chunkbits default value to PAGE_SHIFT,
* it will be updated at OSC connection time. */
int rc;
spin_lock(&cli->cl_loi_list_lock);
int rc;
spin_lock(&cli->cl_loi_list_lock);
- rc = sprintf(buf, "%d\n", cli->cl_short_io_bytes);
+ rc = sprintf(buf, "%d\n", cli->cl_max_short_io_bytes);
spin_unlock(&cli->cl_loi_list_lock);
return rc;
}
spin_unlock(&cli->cl_loi_list_lock);
return rc;
}
- if (val < MIN_SHORT_IO_BYTES || val > OBD_MAX_SHORT_IO_BYTES)
+ if (val && (val < MIN_SHORT_IO_BYTES || val > OBD_MAX_SHORT_IO_BYTES))
GOTO(out, rc = -ERANGE);
rc = count;
GOTO(out, rc = -ERANGE);
rc = count;
if (val > (cli->cl_max_pages_per_rpc << PAGE_SHIFT))
rc = -ERANGE;
else
if (val > (cli->cl_max_pages_per_rpc << PAGE_SHIFT))
rc = -ERANGE;
else
- cli->cl_short_io_bytes = val;
+ cli->cl_max_short_io_bytes = val;
spin_unlock(&cli->cl_loi_list_lock);
out:
spin_unlock(&cli->cl_loi_list_lock);
out:
for (i = 0; i < page_count; i++)
short_io_size += pga[i]->count;
for (i = 0; i < page_count; i++)
short_io_size += pga[i]->count;
- /* Check if we can do a short io. */
- if (!(short_io_size <= cli->cl_short_io_bytes && niocount == 1 &&
- imp_connect_shortio(cli->cl_import)))
+ /* Check if read/write is small enough to be a short io. */
+ if (short_io_size > cli->cl_max_short_io_bytes || niocount > 1 ||
+ !imp_connect_shortio(cli->cl_import))
short_io_size = 0;
req_capsule_set_size(pill, &RMF_SHORT_IO, RCL_CLIENT,
short_io_size = 0;
req_capsule_set_size(pill, &RMF_SHORT_IO, RCL_CLIENT,