Re: 2.6.17-rc5-mm1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2006-06-06 at 10:39 -0700, Christoph Lameter wrote:
> Ok. So we have a mystical expression here that needs to be explained:
> 
> swp_type(pte_to_swp_entry(swp_entry_to_pte(swp_entry(~0UL,0))))
> 
> swp_entry(~0L,0) ->
> swp_entry(0xffffffffffffffff, 0) ->
> 0xfffffffffffffff << SWP_TYPE_SHIFT ->
> 0x1f
> 
> Ok we got the highest swap type and this encodes MAX_SWAPFILES_SHIFT and 
> therefore limits the number of swap 
> 
> But now we convert this to a arch specific pte. The hope is that the arch
> will mask off any unsupported bits? This is done by s390?

Yes.

> Then we convert the result back into a swap entry and take its type which 
> will hopefully give us the maximum number of swap devices supported by the 
> arch?

Yes.

> Would it not be better for an arch to explicitly tell us how many swap 
> devices are supported? Then we could make the swap_info array shorter and 
> get rid of this cryptic test.

Do you want to calculate the correct number for all architectures? Have
fun trying to decrypt the different pte formats.

> This test also creates a problem for the migration entries: It is really 
> not clear until runtime how many swap devices are supported so we cannot 
> take the last 2 for page migration. In order for page migration to work 
> all NUMA arches that do not support 32 swap devices need to define 
> CONFIG_MIGRATION=n. Seems that this is only s390?

s390 is not a NUMA system, but it does support 32 swap devices.

-- 
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux