X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fnrs_orr.c;h=a5afbc0a30db50ae7c1c12d368e1dea461f3d6cb;hb=612f27788166e2f1153cb5f2c4b4bffba9a42235;hp=c660916e0c1ccb950b37cf44be6853c8932fc59c;hpb=c85f006d40cc5c9504ea873fc815ce2eaa1ee062;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/nrs_orr.c b/lustre/ptlrpc/nrs_orr.c index c660916..a5afbc0 100644 --- a/lustre/ptlrpc/nrs_orr.c +++ b/lustre/ptlrpc/nrs_orr.c @@ -20,7 +20,7 @@ * GPL HEADER END */ /* - * Copyright (c) 2011 Intel Corporation + * Copyright (c) 2013, Intel Corporation. * * Copyright 2012 Xyratex Technology Limited */ @@ -595,7 +595,8 @@ static cfs_binheap_ops_t nrs_orr_heap_ops = { /** * Prints a warning message if an ORR/TRR policy is started on a service with - * more than one CPT. + * more than one CPT. Not printed on the console for now, since we don't + * have any performance metrics in the first place, and it is annoying. * * \param[in] policy the policy instance * @@ -603,16 +604,13 @@ static cfs_binheap_ops_t nrs_orr_heap_ops = { */ static int nrs_orr_init(struct ptlrpc_nrs_policy *policy) { - if (policy->pol_nrs->nrs_svcpt->scp_service->srv_ncpts > 1) { - bool is_orr = strncmp(policy->pol_desc->pd_name, - NRS_POL_NAME_ORR, NRS_POL_NAME_MAX) == 0; - - CWARN("A%s %s NRS policy has been registered on a PTLRPC " - "service which has more than one service partition. " - "Please be advised that this policy may perform better " - "on services with only one partition.\n", - is_orr ? "n" : "", policy->pol_desc->pd_name); - } + if (policy->pol_nrs->nrs_svcpt->scp_service->srv_ncpts > 1) + CDEBUG(D_CONFIG, "%s: The %s NRS policy was registered on a " + "service with multiple service partitions. This policy " + "may perform better with a single partition.\n", + policy->pol_nrs->nrs_svcpt->scp_service->srv_name, + policy->pol_desc->pd_name); + return 0; } @@ -654,9 +652,9 @@ static int nrs_orr_start(struct ptlrpc_nrs_policy *policy) /** * Slab cache for NRS ORR/TRR objects. */ - orrd->od_cache = cfs_mem_cache_create(orrd->od_objname, - sizeof(struct nrs_orr_object), - 0, 0); + orrd->od_cache = kmem_cache_create(orrd->od_objname, + sizeof(struct nrs_orr_object), + 0, 0, NULL); if (orrd->od_cache == NULL) GOTO(failed, rc = -ENOMEM); @@ -704,7 +702,7 @@ static int nrs_orr_start(struct ptlrpc_nrs_policy *policy) failed: if (orrd->od_cache) { - rc = cfs_mem_cache_destroy(orrd->od_cache); + kmem_cache_destroy(orrd->od_cache); LASSERTF(rc == 0, "Could not destroy od_cache slab\n"); } if (orrd->od_binheap != NULL) @@ -737,7 +735,7 @@ static void nrs_orr_stop(struct ptlrpc_nrs_policy *policy) cfs_binheap_destroy(orrd->od_binheap); cfs_hash_putref(orrd->od_obj_hash); - cfs_mem_cache_destroy(orrd->od_cache); + kmem_cache_destroy(orrd->od_cache); OBD_FREE_PTR(orrd); } @@ -761,7 +759,7 @@ int nrs_orr_ctl(struct ptlrpc_nrs_policy *policy, enum ptlrpc_nrs_ctl opc, { LASSERT(spin_is_locked(&policy->pol_nrs->nrs_lock)); - switch(opc) { + switch((enum nrs_ctl_orr)opc) { default: RETURN(-EINVAL); @@ -884,8 +882,8 @@ int nrs_orr_res_get(struct ptlrpc_nrs_policy *policy, OBD_SLAB_CPT_ALLOC_PTR_GFP(orro, orrd->od_cache, nrs_pol2cptab(policy), nrs_pol2cptid(policy), - moving_req ? CFS_ALLOC_ATOMIC : - CFS_ALLOC_IO); + (moving_req ? GFP_ATOMIC : + __GFP_IO)); if (orro == NULL) RETURN(-ENOMEM); @@ -1314,7 +1312,7 @@ static int ptlrpc_lprocfs_wr_nrs_orr_quantum(struct file *file, if (count > (sizeof(kernbuf) - 1)) return -EINVAL; - if (cfs_copy_from_user(kernbuf, buffer, count)) + if (copy_from_user(kernbuf, buffer, count)) return -EFAULT; kernbuf[count] = '\0'; @@ -1533,7 +1531,7 @@ static int ptlrpc_lprocfs_wr_nrs_orr_offset_type(struct file *file, if (count > (sizeof(kernbuf) - 1)) return -EINVAL; - if (cfs_copy_from_user(kernbuf, buffer, count)) + if (copy_from_user(kernbuf, buffer, count)) return -EFAULT; kernbuf[count] = '\0'; @@ -1795,7 +1793,7 @@ static int ptlrpc_lprocfs_wr_nrs_orr_supported(struct file *file, if (count > (sizeof(kernbuf) - 1)) return -EINVAL; - if (cfs_copy_from_user(kernbuf, buffer, count)) + if (copy_from_user(kernbuf, buffer, count)) return -EFAULT; kernbuf[count] = '\0';