Re: [PATCH] perf: Remove setting of page->index and ->mapping

Peter Zijlstra
2024-08-10T22:15:11Z

On Fri, Aug 09, 2024 at 09:10:36PM +0100, Matthew Wilcox (Oracle) wrote:
> I have no idea why perf is setting these fields. There should be
> no need to do this.

Because these are not shared pages and nobody will ever look at these
fields? Yeah, I can't for the life of me remember why I did that.

> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> kernel/events/core.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index aa3450bdc227..f55ab04f3df0 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -6221,8 +6221,6 @@ static vm_fault_t perf_mmap_fault(struct vm_fault *vmf)
> goto unlock;
>
> get_page(vmf->page);
> - vmf->page->mapping = vmf->vma->vm_file->f_mapping;
> - vmf->page->index = vmf->pgoff;
>
> ret = 0;
> unlock:
> --
> 2.43.0
>