Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: hch@infradead.org, David Milburn <dmilburn@redhat.com>,
	chaitanya.kulkarni@wdc.com, dwagner@suse.de,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH v2 2/2] nvmet: avoid memleak by freeing any remaining aens in nvmet_async_events_free
Date: Tue, 19 May 2020 23:16:13 -0700	[thread overview]
Message-ID: <20200520061613.GA18308@infradead.org> (raw)
In-Reply-To: <388242d3-5ccc-d694-c7a0-ac489f63f26a@grimberg.me>

On Tue, May 19, 2020 at 01:33:17AM -0700, Sagi Grimberg wrote:
> Something here looks wrong to me... There is no reason to free aens here...

I think there is.  Remember we have two aen related resources:

 (1) the nvmet_req structures in ctrl->async_event_cmds.  One of these
     exists for each command that the host has outstanding
 (2) the nvmet_async_event strutures hanging off ctrl->async_events.
     One of these is added for each event that the target generates.

So when the host usually only has a single aen command outstanding (like
the Linux host) we might start having a pretty long list on the target
for a while until all the roundtrips to deliver them have been
completed, and if the admin queue gets shut down during that time we'll
need to free them.


_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2020-05-20  6:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 18:59 [PATCH v2 0/2] nvmet: fixup processing async events David Milburn
2020-05-18 18:59 ` [PATCH v2 1/2] nvmet: check command slot before pulling and freeing aen David Milburn
2020-05-20 17:18   ` Christoph Hellwig
2020-05-18 18:59 ` [PATCH v2 2/2] nvmet: avoid memleak by freeing any remaining aens in nvmet_async_events_free David Milburn
2020-05-19  8:33   ` Sagi Grimberg
2020-05-19 19:14     ` David Milburn
2020-05-19 20:42       ` Sagi Grimberg
2020-05-19 20:51         ` Sagi Grimberg
2020-05-20  6:18           ` Christoph Hellwig
2020-05-20  7:01             ` Sagi Grimberg
2020-05-20  6:16     ` Christoph Hellwig [this message]
2020-05-20  6:59       ` Sagi Grimberg
2020-05-20  7:03         ` Christoph Hellwig
2020-05-20  7:08           ` Sagi Grimberg
2020-05-20  7:15             ` Christoph Hellwig
2020-05-20  8:06               ` Sagi Grimberg
2020-05-20 10:39                 ` David Milburn
2020-05-20 17:19                   ` Sagi Grimberg
2020-05-20 17:23                     ` David Milburn
2020-05-20 17:30                     ` Christoph Hellwig
2020-05-20 17:27                   ` Christoph Hellwig
2020-05-20 17:41                     ` Sagi Grimberg
2020-05-20 17:46                       ` Christoph Hellwig
2020-05-20 18:04                         ` Sagi Grimberg
2020-05-20 18:15                           ` Christoph Hellwig
2020-05-20 19:40                             ` Sagi Grimberg
2020-05-19  8:40 ` [PATCH v2 0/2] nvmet: fixup processing async events Chaitanya Kulkarni
2020-05-19 19:17   ` David Milburn
2020-05-20  6:20     ` hch

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=20200520061613.GA18308@infradead.org \
    --to=hch@infradead.org \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=dmilburn@redhat.com \
    --cc=dwagner@suse.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox