From: David Wragg <dpw@doc.ic.ac.uk>
To: linux-kernel@vger.kernel.org
Subject: limit on number of kmapped pages
Date: 23 Jan 2001 13:56:00 +0000 [thread overview]
Message-ID: <y7rsnmav0cv.fsf@sytry.doc.ic.ac.uk> (raw)
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!).
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.).
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.
So why is LAST_PKMAP so low, and what would the consequences of
raising it be?
(I don't think kernel address space is that scarce in the
CONFIG_HIGHMEM case, so I suspect that the main reason is to limit the
amount of searching needed for kmap to find a free slot. Is this
right?)
David Wragg
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next reply other threads:[~2001-01-23 13:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-23 13:56 David Wragg [this message]
2001-01-23 18:23 ` Eric W. Biederman
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
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=y7rsnmav0cv.fsf@sytry.doc.ic.ac.uk \
--to=dpw@doc.ic.ac.uk \
--cc=linux-kernel@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
Powered by JetHome