[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <60aff3a2-35d5-53f4-65eb-f28d577dab55@virtuozzo.com>
Date: Mon, 15 May 2017 11:29:57 +0300
From: Andrey Ryabinin <aryabinin@...tuozzo.com>
To: <js1304@...il.com>, Andrew Morton <akpm@...ux-foundation.org>
CC: "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
<kasan-dev@...glegroups.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>, <kernel-team@....com>,
Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: Re: [PATCH] mm/kasan: use kasan_zero_pud for p4d table
On 05/15/2017 09:20 AM, js1304@...il.com wrote:
> From: Joonsoo Kim <iamjoonsoo.kim@....com>
>
> There is missing optimization in zero_p4d_populate() that can save
> some memory when mapping zero shadow. Implement it like as others.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@....com>
Acked-by: Andrey Ryabinin <aryabinin@...tuozzo.com>
> ---
> mm/kasan/kasan_init.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/mm/kasan/kasan_init.c b/mm/kasan/kasan_init.c
> index b96a5f7..554e4c0 100644
> --- a/mm/kasan/kasan_init.c
> +++ b/mm/kasan/kasan_init.c
> @@ -118,6 +118,18 @@ static void __init zero_p4d_populate(pgd_t *pgd, unsigned long addr,
>
> do {
> next = p4d_addr_end(addr, end);
> + if (IS_ALIGNED(addr, P4D_SIZE) && end - addr >= P4D_SIZE) {
> + pud_t *pud;
> + pmd_t *pmd;
> +
> + p4d_populate(&init_mm, p4d, lm_alias(kasan_zero_pud));
> + pud = pud_offset(p4d, addr);
> + pud_populate(&init_mm, pud, lm_alias(kasan_zero_pmd));
> + pmd = pmd_offset(pud, addr);
> + pmd_populate_kernel(&init_mm, pmd,
> + lm_alias(kasan_zero_pte));
> + continue;
> + }
>
> if (p4d_none(*p4d)) {
> p4d_populate(&init_mm, p4d,
>
Powered by blists - more mailing lists