[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALvZod7ieLEObX0y-7X+_zMwaVN5o0P-ZwZVLqCAK5ytQrNs9w@mail.gmail.com>
Date: Thu, 6 May 2021 11:24:18 -0700
From: Shakeel Butt <shakeelb@...gle.com>
To: Rick Edgecombe <rick.p.edgecombe@...el.com>
Cc: Dave Hansen <dave.hansen@...el.com>,
Andy Lutomirski <luto@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Linux MM <linux-mm@...ck.org>, x86@...nel.org,
Andrew Morton <akpm@...ux-foundation.org>,
linux-hardening@...r.kernel.org,
kernel-hardening@...ts.openwall.com,
Ira Weiny <ira.weiny@...el.com>,
Mike Rapoport <rppt@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC 5/9] x86, mm: Use cache of page tables
On Tue, May 4, 2021 at 5:36 PM Rick Edgecombe
<rick.p.edgecombe@...el.com> wrote:
>
[...]
> +#ifdef CONFIG_PKS_PG_TABLES
> +struct page *alloc_table(gfp_t gfp)
> +{
> + struct page *table;
> +
> + if (!pks_page_en)
> + return alloc_page(gfp);
> +
> + table = get_grouped_page(numa_node_id(), &gpc_pks);
> + if (!table)
> + return NULL;
> +
> + if (gfp & __GFP_ZERO)
> + memset(page_address(table), 0, PAGE_SIZE);
> +
> + if (memcg_kmem_enabled() &&
> + gfp & __GFP_ACCOUNT &&
> + !__memcg_kmem_charge_page(table, gfp, 0)) {
> + free_table(table);
> + table = NULL;
> + }
> +
> + VM_BUG_ON_PAGE(*(unsigned long *)&table->ptl, table);
table can be NULL due to charge failure.
Powered by blists - more mailing lists