[ofa-general] ib_create_fmr_pool do INIT_HLIST_NODE only if cache is enabled

subbu kl subbukl at gmail.com
Mon Mar 17 17:06:57 PDT 2008


I agree Roland.
Only thing is it may save very few machine cycles :)

~subbu

--- fmr_pool.orig.c 2008-03-05 11:29:20.000000000 -0600
+++ fmr_pool.mod.c  2008-03-17 17:05:04.000000000 -0500
@@ -321,7 +321,9 @@
      fmr->pool             = pool;
      fmr->remap_count      = 0;
      fmr->ref_count        = 0;
-     INIT_HLIST_NODE(&fmr->cache_node);
+
+     if (params->cache)
+       INIT_HLIST_NODE(&fmr->cache_node);

      fmr->fmr = ib_alloc_fmr(pd, params->access, &fmr_attr);
      if (IS_ERR(fmr->fmr)) {



On Sun, Mar 9, 2008 at 3:51 PM, Roland Dreier <rdreier at cisco.com> wrote:

>  > -                       INIT_HLIST_NODE(&fmr->cache_node);
>
>  > +                       if (params->cache) {
>  > +                               INIT_HLIST_NODE(&fmr->cache_node);
>  > +                       }
>
> I guess we could do that but in practice it doesn't make any
> difference, does it?  Adding the if statement makes the code bigger
> (and it's not a fast path anyway).
>
> (BTW the kernel style is to leave out the { } around a single line block)
>
>  - R.
>



-- 
. . . s u b b u
"You've got to be original, because if you're like someone else, what do
they need you for?"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080317/c472ccc1/attachment.html>


More information about the general mailing list