linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: "Robin Murphy" <robin.murphy@arm.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Will Deacon" <will.deacon@arm.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>
Subject: Re: struct dev_pagemap corruption
Date: Sun, 7 Apr 2019 15:25:42 -0700	[thread overview]
Message-ID: <CAPcyv4jMKc++ySHN4hDKtC3jFsXxntAx=0e0vWoW-LQsodAk3Q@mail.gmail.com> (raw)
In-Reply-To: <60d1c5b7-7f85-7658-00f3-a3e5c6edc302@arm.com>

On Fri, Apr 5, 2019 at 7:54 AM Anshuman Khandual
<anshuman.khandual@arm.com> wrote:
[..]
> > Given that what seems to ultimately get corrupted is the memory pointed to by pgmap here, how is *that* being allocated?
>
> struct dev_pagemap *pgmap;
>
> pgmap = devm_kzalloc(dev, sizeof(struct dev_pagemap), GFP_KERNEL);
>
> Is it problematic to use dev_kzalloc here instead of generic kmalloc/kzalloc
> functions ?

On this specific question, no. devm_kzalloc() is how the pmem and
device-dax drivers allocate the pgmap passed to devm_memremap_pages().
The unwind order of the devres resources ensures that the
devm_memremap_pages() devres actions occur before the release of the
pgmap allocation.


  parent reply	other threads:[~2019-04-07 22:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05  4:40 struct dev_pagemap corruption Anshuman Khandual
2019-04-05 13:37 ` Robin Murphy
2019-04-05 14:54   ` Anshuman Khandual
2019-04-05 15:57     ` Robin Murphy
2019-04-07 22:25     ` Dan Williams [this message]
2019-04-05 13:42 ` Catalin Marinas
2019-04-05 14:58   ` Anshuman Khandual
2019-04-05 13:53 ` Jerome Glisse

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='CAPcyv4jMKc++ySHN4hDKtC3jFsXxntAx=0e0vWoW-LQsodAk3Q@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=jglisse@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=robin.murphy@arm.com \
    --cc=will.deacon@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).