From 04abb4a484ec57881a30632bbf0abbf26ad6856a Mon Sep 17 00:00:00 2001 From: zab Date: Thu, 23 Oct 2003 16:28:24 +0000 Subject: [PATCH] b=2010 This time, actually initialize the OSC's maximum number of pages allowed in each RPC to the nice value that we calculate, rather than just setting the tunable max. We export the math from portals so that client_obd_setup() can use it to initialize the OSC from its summer home in ptlrpc/. --- lnet/include/lnet/lib-types.h | 1 + lustre/portals/include/portals/lib-types.h | 1 + lustre/ptlrpc/ptlrpc_lib.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index 9db8489..e5447d7 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -139,6 +139,7 @@ typedef struct { /* temporary expedient: limit number of entries in discontiguous MDs */ # define PTL_MTU (512<<10) # define PTL_MD_MAX_IOV 128 +# define PTL_MD_MAX_PAGES min_t(int, PTL_MD_MAX_IOV, PTL_MTU / PAGE_SIZE) struct lib_msg_t { struct list_head msg_list; diff --git a/lustre/portals/include/portals/lib-types.h b/lustre/portals/include/portals/lib-types.h index 9db8489..e5447d7 100644 --- a/lustre/portals/include/portals/lib-types.h +++ b/lustre/portals/include/portals/lib-types.h @@ -139,6 +139,7 @@ typedef struct { /* temporary expedient: limit number of entries in discontiguous MDs */ # define PTL_MTU (512<<10) # define PTL_MD_MAX_IOV 128 +# define PTL_MD_MAX_PAGES min_t(int, PTL_MD_MAX_IOV, PTL_MTU / PAGE_SIZE) struct lib_msg_t { struct list_head msg_list; diff --git a/lustre/ptlrpc/ptlrpc_lib.c b/lustre/ptlrpc/ptlrpc_lib.c index a7569c7..68d7be6 100644 --- a/lustre/ptlrpc/ptlrpc_lib.c +++ b/lustre/ptlrpc/ptlrpc_lib.c @@ -106,7 +106,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) cli->cl_brw_in_flight = 0; spin_lock_init(&cli->cl_rpc_concurrency_oh.oh_lock); spin_lock_init(&cli->cl_pages_per_rpc_oh.oh_lock); - cli->cl_max_pages_per_rpc = PTL_MD_MAX_IOV; + cli->cl_max_pages_per_rpc = PTL_MD_MAX_PAGES; cli->cl_max_rpcs_in_flight = 8; conn = ptlrpc_uuid_to_connection(&server_uuid); -- 1.8.3.1