From: ebiederm@xmission.com (Eric W. Biederman)
To: David Wragg <dpw@doc.ic.ac.uk>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: limit on number of kmapped pages
Date: 23 Jan 2001 11:23:46 -0700 [thread overview]
Message-ID: <m1r91udt59.fsf@frodo.biederman.org> (raw)
In-Reply-To: David Wragg's message of "23 Jan 2001 13:56:00 +0000"
David Wragg <dpw@doc.ic.ac.uk> writes:
> While testing some kernel code of mine on a machine with
> CONFIG_HIGHMEM enabled, I've run into the limit on the number of pages
> that can be kmapped at once. I was surprised to find it was so low --
> only 2MB/4MB of address space for kmap (according to the value of
> LAST_PKMAP; vmalloc gets a much more generous 128MB!).
kmap is for quick transitory mappings. kmap is not for permanent mappings.
At least that was my impression. The persistence is intended to just
kill error prone cases.
> My code allocates a large number of pages (4MB-worth would be typical)
> to act as a buffer; interrupt handlers/BHs copy data into this buffer,
> then a kernel thread moves filled pages into the page cache and
> replaces them with newly allocated pages. To avoid overhead on
> IRQs/BHs, all the pages in the buffer are kmapped. But with
> CONFIG_HIGHMEM if I try to kmap 512 pages or more at once, the kernel
> locks up (fork() starts blocking inside kmap(), etc.).
This may be a reasonable use, I'm not certain. It wasn't the application
kmap was designed to deal with though...
> There are ways I could work around this (either by using kmap_atomic,
> or by adding another kernel thread that maintains a window of kmapped
> pages within the buffer). But I'd prefer not to have to add a lot of
> code specific to the CONFIG_HIGHMEM case.
Why do you need such a large buffer? And why do the pages need to be kmapped?
If you are doing dma there is no such requirement... And unless you are
running on something faster than a PCI bus I can't imagine why you need
a buffer that big. My hunch is that it makes sense to do the kmap,
and the i/o in the bottom_half. What is wrong with that?
kmap should be quick and fast because it is for transitory mappings.
It shouldn't be something whose overhead you are trying to avoid.
If kmap is that expensive then kmap needs to be fixed, instead
of your code working around a perceived problem.
At least that is what it looks like from here.
Eric
--
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.eu.org/Linux-MM/
next parent reply other threads:[~2001-01-23 18:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <y7rsnmav0cv.fsf@sytry.doc.ic.ac.uk>
2001-01-23 18:23 ` Eric W. Biederman [this message]
2001-01-24 0:35 ` David Wragg
2001-01-24 2:03 ` Benjamin C.R. LaHaise
2001-01-24 10:09 ` David Wragg
2001-01-24 14:27 ` Eric W. Biederman
2001-01-25 10:06 ` Random thoughts on sustained write performance Daniel Phillips
[not found] ` <y7rsnm7mai7.fsf@sytry.doc.ic.ac.uk>
[not found] ` <01012615062602.20169@gimli>
2001-01-27 13:50 ` David Wragg
2001-01-27 17:23 ` Daniel Phillips
2001-01-27 21:23 ` David Wragg
2001-01-25 18:16 ` limit on number of kmapped pages Stephen C. Tweedie
2001-01-25 23:53 ` David Wragg
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=m1r91udt59.fsf@frodo.biederman.org \
--to=ebiederm@xmission.com \
--cc=dpw@doc.ic.ac.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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