Re: [PATCH for-next 03/12] IB/hfi1: Remove the debug trace message in pin_sdma_pages()

Leon Romanovsky
2017-09-27T15:30:33Z

[-- Attachment #1: Type: text/plain, Size: 1821 bytes --]

On Tue, Sep 26, 2017 at 07:00:17AM -0700, Dennis Dalessandro wrote:
> From: Harish Chegondi <harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> Remove the debug trace statement in pin_sdma_pages() that
> gets executed when there is a memory allocation failure as
> the trace message doesn't help with debugging the memory
> allocation failure.
>
> Cc: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Harish Chegondi <harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
> drivers/infiniband/hw/hfi1/user_sdma.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>

Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

BTW, by looking on something else,

1. I saw that you are not checking for kcalloc failure in drivers/infiniband/hw/hfi1/verbs.c

1138 empty_buf = kcalloc(extra_bytes, sizeof(u8),
1139 GFP_KERNEL);
1140 seg_pio_copy_mid(pbuf, empty_buf, extra_bytes);

2. The following code in drivers/infiniband/hw/hfi1/sdma.c, can and
should be replaced by kvmalloc. You are incorrectly open-coded failback.

1467 sde->tx_ring =
1468 kcalloc(descq_cnt, sizeof(struct sdma_txreq *),
1469 GFP_KERNEL);
1470 if (!sde->tx_ring)
1471 sde->tx_ring =
1472 vzalloc(
1473 sizeof(struct sdma_txreq *) *
1474 descq_cnt);

Thanks

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]