All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: <vkoul@kernel.org>, Dan Williams <dan.j.williams@intel.com>,
	<dmaengine@vger.kernel.org>
Subject: Re: [PATCH v3] dmaengine: idxd: Do not use devm for 'struct device' object allocation
Date: Sat, 27 Feb 2021 19:57:52 -0400	[thread overview]
Message-ID: <20210227235752.GD4247@nvidia.com> (raw)
In-Reply-To: <1482a4fc-3359-e807-d8ac-8fa7a2e110ab@intel.com>

On Sat, Feb 27, 2021 at 09:27:26AM -0700, Dave Jiang wrote:
> 
> On 2/26/2021 6:36 PM, Jason Gunthorpe wrote:
> > On Wed, Feb 24, 2021 at 03:35:19PM -0700, Dave Jiang wrote:
> > > Remove devm_* allocation of memory of 'struct device' objects.
> > > The devm_* lifetime is incompatible with device->release() lifetime.
> > > Address issues flagged by CONFIG_DEBUG_KOBJECT_RELEASE. Add release
> > > functions for each component in order to free the allocated memory at
> > > the appropriate time. Each component such as wq, engine, and group now
> > > needs to be allocated individually in order to setup the lifetime properly.
> > You've tested this now with kasn and all the other debugging turned
> > on?
> 
> Only with DEBUG_KOBJECT_RELEASE. I wasn't aware of the kasn tests. I'll go
> test with those. Thanks for the thorough review. Really appreciate it.

I turn on these things in my debug kernel builds:

        DEBUG_ATOMIC_SLEEP
        DEBUG_BUGVERBOSE
        DEBUG_KERNEL
        DEBUG_KOBJECT
        DEBUG_LIST
        DETECT_HUNG_TASK
        HARDLOCKUP_DETECTOR
        HAVE_RELIABLE_STACKTRACE
        KASAN
        MAGIC_SYSRQ_SERIAL
        PERF_EVENTS
        PRINTK_TIME
        PROVE_LOCKING
        PROVE_RCU
        SOFTLOCKUP_DETECTOR
        STACKPROTECTOR_STRONG
        STACK_VALIDATION
        UBSAN
        UBSAN_SANITIZE_ALL
        UNWINDER_FRAME_POINTER
        WQ_WATCHDOG

Jason

      reply	other threads:[~2021-02-27 23:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 22:35 [PATCH v3] dmaengine: idxd: Do not use devm for 'struct device' object allocation Dave Jiang
2021-02-27  1:36 ` Jason Gunthorpe
2021-02-27 16:27   ` Dave Jiang
2021-02-27 23:57     ` Jason Gunthorpe [this message]

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=20210227235752.GD4247@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /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.