Subject: Re: uvm_km_valloc_align() and USPACE (Re: CVS commit: syssrc)
To: None <>
From: Noriyuki Soda <>
List: tech-kern
Date: 11/29/2000 18:56:25
> On Wed, Nov 29, 2000 at 12:21:43AM +0900, Izumi Tsutsui wrote:
>  > This means that UPAGES must be the power of two?
>  > On some m68k port, UPAGES is 3 so uvm_map_findspace() fails
>  > on KASSERT((align & (align - 1)) == 0).
>  > 
>  > (I guess UPAGES on such ports could be changed to 2 from 3, though.)

>>>>> On Tue, 28 Nov 2000 08:05:31 -0800,
	Jason R Thorpe <> said:

> Yah, it should just be 2 ... wonder why some of them are using 3 pages?!

Mmmm, really?
As far as I know, the size of UPAGES depends on the following things:

- stack usage of kernel upper half
- stack usage of kernel lower half
	this depends on maximum allowed nesting level of interrupt handler,
	i.e. depends on the number of interrupt priority level
- stack usage of the architecture
- page size

If a architecture requires more stack to call a function, the
architecture might require larger value of UPAGES.
Or, if a architecture uses smaller size for PAGE_SIZE, the
architecture might require larger value of UPAGES.

Is there any reason that UPAGES should be 2?

For me, adding a symbol like USPACE_ALIGNMENT and use the symbol
for uvm_km_valloc_align seems to be the right thing.

The USPACE_ALIGNMENT on mips should be USPACE,
and the value on other architectures should be NBPG.