linux-newbie.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jayram Déshpandé" <jaydesh9@gmail.com>
To: linux-newbie@vger.kernel.org
Subject: mapping memory reserved by "memmap" kernel boot param into user space
Date: Sun, 31 Mar 2013 22:11:56 -0700	[thread overview]
Message-ID: <CAGj4Cuci1+tk55bSAVONT1O+Z+7kBce9CJ=7gspGXseGhsyaeQ@mail.gmail.com> (raw)

Hello ,

As discussed in this[1] discussion, i am reserving a memory chunk at the
boot time using a kernel boot parameter memmap=8G$64G

I have written a character driver [2] kernel module which , during
initialization does a ioremap of this reserved memory chunk. As explained
here , in my driver mmap all i need to do is remap_pfn_range for this
memory chunk pointer returned by the ioremap.

I am running this on 3.x linux kernel. My user space application opens this
memory chunk as a device mounted by the driver. When i do mmap from the use
space application i see a system hang. my dmesg don't provide me much
information.

So questions are :

1 ) Does  remap_pfn_range function have some upper limit on the size of the
memory that can be remaped to ? Note that i am trying to reserve a
comparatively large chunks of memory at the boot time of the order of 64GB
to about 150GB. The system can have 128 to 256 GB of ram.

2) I tried by disabling the ioremap from the initialization and thus
directly doing the page frame numbers remapping in the mmap ioctl routing.
But that also results in a hang.


3) I tried with a page-fault handler , but that doesn't seem to help either.




Regards,
-Jay


P.S. code can be found here [4]


[1] http:// stackoverflow.com/q/1911473/143897
[2] http:// pete.akeo.ie/2011/08/writing-linux-device-driver-for-kernels.html
[3] http:// www.
linuxquestions.org/questions/linux-kernel-70/mmap-of-several-gb-of-reserved-memory-using-805818/#post3972954
[4] http:// stackoverflow.com/questions/12790382/mapping-memory-reserved-by-mmap-kernel-boot-param-into-user-space
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

                 reply	other threads:[~2013-04-01  5:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAGj4Cuci1+tk55bSAVONT1O+Z+7kBce9CJ=7gspGXseGhsyaeQ@mail.gmail.com' \
    --to=jaydesh9@gmail.com \
    --cc=linux-newbie@vger.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).