Re: Re: [PATCH] RDMA/siw: Print error code while kthread_create failed
From: Bernard Metzler
Date: Wed Jul 10 2019 - 04:38:11 EST
-----"Leon Romanovsky" <leon@xxxxxxxxxx> wrote: -----
>To: "YueHaibing" <yuehaibing@xxxxxxxxxx>
>From: "Leon Romanovsky" <leon@xxxxxxxxxx>
>Date: 07/10/2019 06:36AM
>Cc: bmt@xxxxxxxxxxxxxx, dledford@xxxxxxxxxx, jgg@xxxxxxxx,
>linux-kernel@xxxxxxxxxxxxxxx, linux-rdma@xxxxxxxxxxxxxxx
>Subject: [EXTERNAL] Re: [PATCH] RDMA/siw: Print error code while
>kthread_create failed
>
>On Wed, Jul 10, 2019 at 09:50:09AM +0800, YueHaibing wrote:
>> In iw_create_tx_threads(), if we failed to create kthread,
>> we should print the 'rv', this fix gcc warning:
>>
>> drivers/infiniband/sw/siw/siw_main.c: In function
>'siw_create_tx_threads':
>> drivers/infiniband/sw/siw/siw_main.c:91:11: warning:
>> variable 'rv' set but not used [-Wunused-but-set-variable]
>>
>> Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
>> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
>> ---
>> drivers/infiniband/sw/siw/siw_main.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/sw/siw/siw_main.c
>b/drivers/infiniband/sw/siw/siw_main.c
>> index fd2552a..2a70830d 100644
>> --- a/drivers/infiniband/sw/siw/siw_main.c
>> +++ b/drivers/infiniband/sw/siw/siw_main.c
>> @@ -101,7 +101,8 @@ static int siw_create_tx_threads(void)
>> if (IS_ERR(siw_tx_thread[cpu])) {
>> rv = PTR_ERR(siw_tx_thread[cpu]);
>> siw_tx_thread[cpu] = NULL;
>> - pr_info("Creating TX thread for CPU %d failed", cpu);
>> + pr_info("Creating TX thread for CPU%d failed %d\n",
>> + cpu, rv);
>
>Delete this print together with variable, failure to create kthread
>is basic failure, which affect performance only. The whole kthread
>creation spam in this driver looked suspicious during submission
>and it continues to be.
>
>Thanks
Right, I agree with Leon. Better remove all those printouts. We
already have a warning if we cannot start any thread. Also
stopping those threads is not worth spamming the console. I just
forgot to remove after Leon's comment. Would it be possible
to apply the following?
Thanks a lot!
Bernard.