Re: [PATCH V6 01/16] perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE

Dave Hansen
2020-08-12T13:53:43Z

On 8/12/20 6:39 AM, Liang, Kan wrote:
> I searched the vma_mmu_pagesize(). It seems that PowerPC is the only
> one that defines a 'strong' function. In other words, the MMUPageSize
> and KerelPageSize are the same for X86. However, it seems not true
> for the above compound page cases. Is it a bug for smaps? Or am I
> missed anything?

__weak unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
{
return vma_kernel_pagesize(vma);
}

unsigned long vma_kernel_pagesize(struct vm_area_struct *vma)
{
if (vma->vm_ops && vma->vm_ops->pagesize)
return vma->vm_ops->pagesize(vma);
return PAGE_SIZE;
}

It can be overridden with vm_ops too, not just a weak symbol.