From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Van Assche Subject: Re: [PATCH RFC 2/2] IB/mlx5: Implement Fast Indirect Memory Registration Feature Date: Tue, 14 Oct 2014 07:41:47 +0200 Message-ID: <543CB79B.6050400@acm.org> References: <1412693281-6161-1-git-send-email-sagig@mellanox.com> <1412693281-6161-3-git-send-email-sagig@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1412693281-6161-3-git-send-email-sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sagi Grimberg , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org, ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org, oren-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org List-Id: linux-rdma@vger.kernel.org On 10/07/14 16:48, Sagi Grimberg wrote: > -static __be64 *mr_align(__be64 *ptr, int align) > +static void *mr_align(void *ptr, int align) > { > unsigned long mask = align - 1; > > - return (__be64 *)(((unsigned long)ptr + mask) & ~mask); > + return (void *)(((unsigned long)ptr + mask) & ~mask); > } Maybe I'm missing something, but why doesn't this function use the ALIGN() macro defined in ? Are you aware that a type with name uintptr_t has been defined in that is intended for casting a pointer to an int ? > +struct ib_indir_reg_list * > +mlx5_ib_alloc_indir_reg_list(struct ib_device *device, > + unsigned int max_indir_list_len) There are three k[zc]alloc() calls in this function. Can these be combined into one without increasing the chance too much that this will increase the order of the allocation ? > + dsize = sizeof(*mirl->klms) * max_indir_list_len; > + mirl->mapped_ilist = kzalloc(dsize + MLX5_UMR_ALIGN - 1, > + GFP_KERNEL); The value of the constant MLX5_UMR_ALIGN is 2048. Does that mean this code will always allocate 2 KB more than needed ? Is this really the minimum alignment required for this data structure ? How likely is it that this code will trigger a higher order allocation ? > + if (unlikely((*seg == qp->sq.qend))) A minor comment: one pair of parentheses can be left out from the above code. > + mlx5_ib_warn(dev, "\n"); Will the warning generated by this code allow a user to find out which code triggered that warning ? Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html