All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next v11 08/11] RDMA/rxe: Add code to cleanup mcast memory
Date: Fri, 11 Feb 2022 13:36:06 -0600	[thread overview]
Message-ID: <a34545c4-dd47-2613-e08a-cfbc3ce0d32c@gmail.com> (raw)
In-Reply-To: <20220211184301.GA576950@nvidia.com>

On 2/11/22 12:43, Jason Gunthorpe wrote:
> On Tue, Feb 08, 2022 at 03:16:42PM -0600, Bob Pearson wrote:
>> Well behaved applications will free all memory allocated by multicast
>> but programs which do not clean up properly can leave behind allocated
>> memory when the rxe driver is unloaded. This patch walks the red-black
>> tree holding multicast group elements and then walks the list of attached
>> qp's freeing the mca's and finally the mcg's.
> 
> How does this happen? the ib core ensures that all uobjects are
> destroyed, so if something is still in the rb tree here it means that
> an earlier uobject destruction leaked it
> 
> Jason

The mc_grp and mc_elem objects are not rdma-core uobjects. So their memory
is allocated by the rxe driver. They get created by ib_attach_mcast and destroyed
by ib_detach_mcast. If an application crashes without calling a matching
ib_detach_mcast for each attachment the driver would have leaked the memory.
This patch fixes that.

Bob

  reply	other threads:[~2022-02-11 19:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 21:16 [PATCH for-next v11 00/11] Move two object pools to rxe_mcast.c Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 01/11] RDMA/rxe: Move mcg_lock to rxe Bob Pearson
2022-02-11 19:00   ` Jason Gunthorpe
2022-02-11 19:27     ` Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 02/11] RDMA/rxe: Use kzmalloc/kfree for mca Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 03/11] RDMA/rxe: Replace grp by mcg, mce by mca Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 04/11] RDMA/rxe: Replace int num_qp by atomic_t qp_num Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 05/11] RDMA/rxe: Replace pool key by rxe->mcg_tree Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 06/11] RDMA/rxe: Remove key'ed object support Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 07/11] RDMA/rxe: Remove mcg from rxe pools Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 08/11] RDMA/rxe: Add code to cleanup mcast memory Bob Pearson
2022-02-11 18:43   ` Jason Gunthorpe
2022-02-11 19:36     ` Bob Pearson [this message]
2022-02-11 19:56       ` Jason Gunthorpe
2022-02-12  0:37         ` Bob Pearson
2022-02-14 17:41           ` Jason Gunthorpe
2022-02-08 21:16 ` [PATCH for-next v11 09/11] RDMA/rxe: Finish cleanup of rxe_mcast.c Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 10/11] RDMA/rxe: For mcast copy qp list to temp array Bob Pearson
2022-02-08 21:16 ` [PATCH for-next v11 11/11] RDMA/rxe: Convert mca read locking to RCU Bob Pearson
2022-02-11 20:09   ` Jason Gunthorpe
2022-02-11 20:04 ` [PATCH for-next v11 00/11] Move two object pools to rxe_mcast.c Jason Gunthorpe

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=a34545c4-dd47-2613-e08a-cfbc3ce0d32c@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@gmail.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.