[ofa-general] Re: [PATCH] mlx4: confiugre cache line size

Eli Cohen eli at dev.mellanox.co.il
Tue Sep 22 11:54:15 PDT 2009


On Tue, Sep 22, 2009 at 10:51:10AM -0700, Roland Dreier wrote:
I agree with you on both comments. Would you like me to resend or will
you make the necessary changes?

> 
>  > +#if defined(cache_line_size)
> 
> Why the #if here?  Do we just need to include <linux/cache.h> explicitly
> to make sure we get the define?
> 
>  > +	*((u8 *) mailbox->buf + INIT_HCA_CACHELINE_SZ_OFFSET) =
>  > +		order_base_2(cache_line_size() / 16) << 5;
> 
> Trivial but I think it's safe to assume a cacheline is always a power of
> 2.  And I think it's clearer (and avoids generating a divide) to use
> subtraction rather than division... so this could all become:
> 
> 		(ilog2(cache_line_size()) - 4) << 5;
> 
>  - R.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the general mailing list