[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMArcTW4-4=4XR+KshpPqVKXgTRNmXdwATrij9gAgYKrpOcOTw@mail.gmail.com>
Date: Thu, 8 May 2025 00:54:30 +0900
From: Taehee Yoo <ap420073@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
andrew+netdev@...n.ch, horms@...nel.org, almasrymina@...gle.com,
sdf@...ichev.me, netdev@...r.kernel.org, asml.silence@...il.com,
dw@...idwei.uk, skhawaja@...gle.com, willemb@...gle.com, jdamato@...tly.com
Subject: Re: [PATCH net v2] net: devmem: fix kernel panic when socket close
after module unload
On Wed, May 7, 2025 at 10:23 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Wed, 7 May 2025 13:55:44 +0900 Taehee Yoo wrote:
> > So, it acquires a socket lock only for setting binding->dev to NULL,
> > right?
>
> Yes.
>
> BTW one more tiny nit pick:
>
> net_devmem_unbind_dmabuf(binding);
> + mutex_unlock(&priv->lock); << unlock
> netdev_unlock(dev);
> + netdev_put(dev, &dev_tracker);
> + mutex_lock(&priv->lock); << re-lock
>
> The two marked ops are unnecessary. We only have to acquire the locks
> in order. Its perfectly fine to release netdev_unlock() and keep holding
> the socket lock.
Wow, I didn't know that.
As my knowledge is only ABBA is correct, and I've never thought about
whether ABAB is possible or not.
I will change it.
Thank you so much!
Taehee Yoo
Powered by blists - more mailing lists