Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Mike Rapoport
On Mon, Apr 19, 2021 at 01:21:56PM +0100, Matthew Wilcox wrote: > On Mon, Apr 19, 2021 at 02:56:17PM +0300, Mike Rapoport wrote: > > > > With that fixed, you'll have a head page that you can use for testing, > > > which means you don't need to test PageCompound() (because you know the > > > page

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 02:56:17PM +0300, Mike Rapoport wrote: > On Mon, Apr 19, 2021 at 12:23:02PM +0100, Matthew Wilcox wrote: > > So you're calling page_is_secretmem() on a struct page without having > > a refcount on it. That is definitely not allowed. secretmem seems to > > be full of these

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Mike Rapoport
On Mon, Apr 19, 2021 at 12:23:02PM +0100, Matthew Wilcox wrote: > On Mon, Apr 19, 2021 at 11:42:18AM +0300, Mike Rapoport wrote: > > The perf profile of the test indicated that the regression is caused by > > page_is_secretmem() called from gup_pte_range() (inlined by gup_pgd_range): > > Uhh ...

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 12:36:19PM +0300, Mike Rapoport wrote: > Well, most if the -4.2% of the performance regression kbuild reported were > due to repeated compount_head(page) in page_mapping(). So the whole point > of this patch is to avoid calling page_mapping(). It's quite ludicrous how many

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Matthew Wilcox
On Mon, Apr 19, 2021 at 11:42:18AM +0300, Mike Rapoport wrote: > The perf profile of the test indicated that the regression is caused by > page_is_secretmem() called from gup_pte_range() (inlined by gup_pgd_range): Uhh ... you're calling it in the wrong place!

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread David Hildenbrand
On 19.04.21 12:14, Mike Rapoport wrote: On Mon, Apr 19, 2021 at 11:40:56AM +0200, David Hildenbrand wrote: On 19.04.21 11:38, David Hildenbrand wrote: On 19.04.21 11:36, Mike Rapoport wrote: On Mon, Apr 19, 2021 at 11:15:02AM +0200, David Hildenbrand wrote: On 19.04.21 10:42, Mike Rapoport

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Mike Rapoport
On Mon, Apr 19, 2021 at 11:40:56AM +0200, David Hildenbrand wrote: > On 19.04.21 11:38, David Hildenbrand wrote: > > On 19.04.21 11:36, Mike Rapoport wrote: > > > On Mon, Apr 19, 2021 at 11:15:02AM +0200, David Hildenbrand wrote: > > > > On 19.04.21 10:42, Mike Rapoport wrote: > > > > > From: Mike

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread David Hildenbrand
On 19.04.21 11:38, David Hildenbrand wrote: On 19.04.21 11:36, Mike Rapoport wrote: On Mon, Apr 19, 2021 at 11:15:02AM +0200, David Hildenbrand wrote: On 19.04.21 10:42, Mike Rapoport wrote: From: Mike Rapoport Kernel test robot reported -4.2% regression of will-it-scale.per_thread_ops due

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread David Hildenbrand
On 19.04.21 11:36, Mike Rapoport wrote: On Mon, Apr 19, 2021 at 11:15:02AM +0200, David Hildenbrand wrote: On 19.04.21 10:42, Mike Rapoport wrote: From: Mike Rapoport Kernel test robot reported -4.2% regression of will-it-scale.per_thread_ops due to commit "mm: introduce memfd_secret system

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Mike Rapoport
On Mon, Apr 19, 2021 at 11:15:02AM +0200, David Hildenbrand wrote: > On 19.04.21 10:42, Mike Rapoport wrote: > > From: Mike Rapoport > > > > Kernel test robot reported -4.2% regression of will-it-scale.per_thread_ops > > due to commit "mm: introduce memfd_secret system call to create "secret" >

Re: [PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread David Hildenbrand
On 19.04.21 10:42, Mike Rapoport wrote: From: Mike Rapoport Kernel test robot reported -4.2% regression of will-it-scale.per_thread_ops due to commit "mm: introduce memfd_secret system call to create "secret" memory areas". The perf profile of the test indicated that the regression is caused

[PATCH] secretmem: optimize page_is_secretmem()

2021-04-19 Thread Mike Rapoport
From: Mike Rapoport Kernel test robot reported -4.2% regression of will-it-scale.per_thread_ops due to commit "mm: introduce memfd_secret system call to create "secret" memory areas". The perf profile of the test indicated that the regression is caused by page_is_secretmem() called from