Re: [RFC PATCH 6/7] execmem: add support for cache of large ROX pages

2024-04-18 Thread Mike Rapoport
On Tue, Apr 16, 2024 at 09:52:34AM +0200, Peter Zijlstra wrote: > On Mon, Apr 15, 2024 at 08:00:26PM +0300, Mike Rapoport wrote: > > On Mon, Apr 15, 2024 at 12:47:50PM +0200, Peter Zijlstra wrote: > > > On Thu, Apr 11, 2024 at 07:05:25PM +0300, Mike Rapoport wrote: > > > > > > > To populate the

Re: [RFC PATCH 6/7] execmem: add support for cache of large ROX pages

2024-04-16 Thread Peter Zijlstra
On Mon, Apr 15, 2024 at 08:00:26PM +0300, Mike Rapoport wrote: > On Mon, Apr 15, 2024 at 12:47:50PM +0200, Peter Zijlstra wrote: > > On Thu, Apr 11, 2024 at 07:05:25PM +0300, Mike Rapoport wrote: > > > > > To populate the cache, a writable large page is allocated from vmalloc > > > with > > >

Re: [RFC PATCH 6/7] execmem: add support for cache of large ROX pages

2024-04-15 Thread Mike Rapoport
On Mon, Apr 15, 2024 at 12:47:50PM +0200, Peter Zijlstra wrote: > On Thu, Apr 11, 2024 at 07:05:25PM +0300, Mike Rapoport wrote: > > > To populate the cache, a writable large page is allocated from vmalloc with > > VM_ALLOW_HUGE_VMAP, filled with invalid instructions and then remapped as > > ROX.

Re: [RFC PATCH 6/7] execmem: add support for cache of large ROX pages

2024-04-15 Thread Peter Zijlstra
On Thu, Apr 11, 2024 at 07:05:25PM +0300, Mike Rapoport wrote: > To populate the cache, a writable large page is allocated from vmalloc with > VM_ALLOW_HUGE_VMAP, filled with invalid instructions and then remapped as > ROX. > +static void execmem_invalidate(void *ptr, size_t size, bool writable)

[RFC PATCH 6/7] execmem: add support for cache of large ROX pages

2024-04-11 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Using large pages to map text areas reduces iTLB pressure and improves performance. Extend execmem_alloc() with an ability to use PMD_SIZE'ed pages with ROX permissions as a cache for smaller allocations. To populate the cache, a writable large page is allocated