public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* limit on number of kmapped pages
@ 2001-01-23 13:56 David Wragg
  2001-01-23 18:23 ` Eric W. Biederman
  0 siblings, 1 reply; 9+ messages in thread
From: David Wragg @ 2001-01-23 13:56 UTC (permalink / raw)
  To: linux-kernel

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/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-01-25 23:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-23 13:56 limit on number of kmapped pages David Wragg
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox