lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FD8F70F.7080405@redhat.com>
Date:	Wed, 13 Jun 2012 16:24:47 -0400
From:	Rik van Riel <riel@...hat.com>
To:	Andi Kleen <andi@...stfloor.org>
CC:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] MM: Support more pagesizes for MAP_HUGETLB/SHM_HUGETLB
 v2

On 06/12/2012 07:13 PM, Andi Kleen wrote:
> From: Andi Kleen<ak@...ux.intel.com>

Acked-by: Rik van Riel <riel@...hat.com>

> There was some desire in large applications using MAP_HUGETLB/SHM_HUGETLB
> to use 1GB huge pages on some mappings, and stay with 2MB on others. This
> is useful together with NUMA policy: use 2MB interleaving on some mappings,
> but 1GB on local mappings.
>
> This patch extends the IPC/SHM syscall interfaces slightly to allow specifying
> the page size.

This would also be useful for emulators such as qemu-kvm,
which want the guest memory to be 2MB aligned.

That would require extending mmap to specify the desired
alignment, which may be possible using the upper bits of
the mmap flags, like you did for the shm interface.

> +#define MAP_HUGE_2MB    (21<<  MAP_HUGE_SHIFT)
> +#define MAP_HUGE_1GB    (30<<  MAP_HUGE_SHIFT)

Nice idea, that way each architecture can define the
names for possible offsets, yet the numeric values
will always line up between all of them.

> + * Assume these are all power of twos.
> + * When 0 use the default page size.
> + */
> +#define SHM_HUGE_SHIFT  26
> +#define SHM_HUGE_MASK   0x3f
> +#define SHM_HUGE_2MB    (21<<  SHM_HUGE_SHIFT)
> +#define SHM_HUGE_1GB    (30<<  SHM_HUGE_SHIFT)
> +
> +#ifdef __KERNEL__

Excellent, this is very similar to what I was
thinking about implementing myself, in order
to pass "desired alignment" information to my
implementation of arch_get_unmapped_area(_topdown) :)


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ