linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Korolev <akorolex@gmail.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Alexey Korolev <akorolev@infradead.org>, linux-mm@kvack.org
Subject: Re: HugeTLB mapping for drivers (sample driver)
Date: Mon, 20 Jul 2009 01:39:30 +1200	[thread overview]
Message-ID: <202cde0e0907190639k7bbebc63k143734ad696f90f5@mail.gmail.com> (raw)
In-Reply-To: <202cde0e0907141708g51294247i7a201c34e97f5b66@mail.gmail.com>

Mel,

>>
>> I ran out of time to review this properly, but glancing through I would be
>> concerned with what happens on fork() and COW. At a short read, it would
>> appear that pages get allocated from alloc_buddy_huge_page() instead of your
>> normal function altering the counters for hstate_nores.
>>

I've done some more investigations. You are right it is necessary to
track cases with private mappings some how if we are going to provide
hugetlb remap for drivers. OOM killer starts to work on COW caused by
private hugetlb mapping. (In case of non huge tlb mapping memory just
copied)

In fact there should be quite few cases when private mapping makes
sense for drivers and mapping DMA buffers. I thought about possible
solutions. The question is what to choose.

1. Forbid private mappings for drivers in case of hugetlb. (But this
limits functionality - it is not so good)
2. Allow private mapping. Use hugetlbfs hstates. (But it forces user
to know how much hugetlb memory it is necessary to reserve for
drivers)
3. Allow private mapping. Use special hstate for driver and driver
should tell how much memory needs to be reserved for it. (Not clear
yet how to behave if we are out of reserved space)

Could you please suggest what is the best solution? May be some other options?

Thanks,
Alexey

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-07-19 13:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14  2:07 HugeTLB mapping for drivers (sample driver) Alexey Korolev
2009-07-14 10:27 ` Mel Gorman
2009-07-15  0:08   ` Alexey Korolev
2009-07-19 13:39     ` Alexey Korolev [this message]
2009-07-20  8:11       ` Mel Gorman
2009-07-21  9:32         ` Alexey Korolev
2009-07-21  9:40           ` Mel Gorman

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=202cde0e0907190639k7bbebc63k143734ad696f90f5@mail.gmail.com \
    --to=akorolex@gmail.com \
    --cc=akorolev@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    /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).