All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Gu <guwen@linux.alibaba.com>
To: Markus Elfring <Markus.Elfring@web.de>,
	linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"D. Wythe" <alibuda@linux.alibaba.com>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Jan Karcher <jaka@linux.ibm.com>, Paolo Abeni <pabeni@redhat.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [0/2] net/smc: Adjustments for two function implementations
Date: Tue, 2 Jan 2024 19:33:18 +0800	[thread overview]
Message-ID: <b2ee4680-72e9-56a1-e0dd-9cbbe64a7dac@linux.alibaba.com> (raw)
In-Reply-To: <46fe66f7-dc3b-4863-96e8-7a855316e8bd@web.de>



On 2024/1/2 16:51, Markus Elfring wrote:
> …
>>> A few update suggestions were taken into account
>>> from static source code analysis.
> …
>>>     Return directly after a failed kzalloc() in smc_fill_gid_list()
>>>     Improve exception handling in smc_llc_cli_add_link_invite()
>>>
>>>    net/smc/af_smc.c  |  2 +-
>>>    net/smc/smc_llc.c | 15 +++++++--------
>>>    2 files changed, 8 insertions(+), 9 deletions(-)
> …
>> I see you want to fix the kfree(NULL) issues in these two patches.
> 
> I propose to avoid redundant function calls at various source code places.
> 
> 
>> But I am wondering if this is necessary, since kfree() can handle NULL correctly.
> 
> Would you prefer only required data processing in affected function implementations?
> 

Thank you Markus. I understood that you want to avoid redundant function calls.

But it is not very attractive to me since the calls occur on low-frequency paths
or unlikely condition, resulting in limited performance loss and the current
kfree() usage is fine and common. So what is the benfit?

I noticed that some other discussions are on-going. It seems like you are trying
to change other similiar places. Let's collect more opinions.

https://lore.kernel.org/netdev/828bb442-29d0-4bb8-b90d-f200bdd4faf6@web.de/
https://lore.kernel.org/netdev/90679f69-951c-47b3-b86f-75fd9fde3da3@web.de/
https://lore.kernel.org/netdev/dc0a1c9d-ceca-473d-9ad5-89b59e6af2e7@web.de/
https://lore.kernel.org/netdev/cde82080-c715-473c-97ac-6ef66bba6d64@web.de/

Thanks.

> Regards,
> Markus

  reply	other threads:[~2024-01-02 11:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-31 14:55 [PATCH 0/2] net/smc: Adjustments for two function implementations Markus Elfring
2023-12-31 14:58 ` [PATCH 1/2] net/smc: Return directly after a failed kzalloc() in smc_fill_gid_list() Markus Elfring
2024-01-02  2:13   ` Tony Lu
2023-12-31 15:00 ` [PATCH 2/2] net/smc: Improve exception handling in smc_llc_cli_add_link_invite() Markus Elfring
2023-12-31 22:09   ` kernel test robot
2023-12-31 22:40   ` kernel test robot
2024-01-02  2:19   ` Tony Lu
2024-01-02  8:13 ` [PATCH 0/2] net/smc: Adjustments for two function implementations Wen Gu
2024-01-02  8:44   ` Tony Lu
2024-01-02  8:51   ` [0/2] " Markus Elfring
2024-01-02 11:33     ` Wen Gu [this message]
2024-01-02 11:50       ` Markus Elfring
2024-01-04 20:40       ` Simon Horman
2024-01-03 13:44 ` [PATCH 0/2] " Wenjia Zhang
2024-01-03 14:16   ` [0/2] " Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2ee4680-72e9-56a1-e0dd-9cbbe64a7dac@linux.alibaba.com \
    --to=guwen@linux.alibaba.com \
    --cc=Markus.Elfring@web.de \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jaka@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.