On Thu, May 09, 2019 at 11:35:59AM +0100, Sudeep Holla wrote: > On Thu, May 09, 2019 at 10:28:11AM +0100, Will Deacon wrote: [...] > > > > Since SPE uses virtual addressing, we don't really care about the underlying > > page layout so there's no need to use higher-order allocations. I suppose we > > could theoretically map them at the pmd level in some cases, but ignoring > > them should also be harmless and I suspect you can delete the check. > > > > Yes, I did a quick look to see if we can do that, but couldn't find a clue. > Not sure if that's any optimisation, we can use order from page_private > and set the values accordingly ? > And I forgot to add the diff that I mentioned above, something like the patch below. Regards, Sudeep -->8 diff --git i/drivers/perf/arm_spe_pmu.c w/drivers/perf/arm_spe_pmu.c index 7cb766dafe85..45cd62517080 100644 --- i/drivers/perf/arm_spe_pmu.c +++ w/drivers/perf/arm_spe_pmu.c @@ -827,7 +827,7 @@ static void arm_spe_pmu_read(struct perf_event *event) static void *arm_spe_pmu_setup_aux(struct perf_event *event, void **pages, int nr_pages, bool snapshot) { - int i, cpu = event->cpu; + int i, j, cpu = event->cpu; struct page **pglist; struct arm_spe_pmu_buf *buf; @@ -859,11 +859,12 @@ static void *arm_spe_pmu_setup_aux(struct perf_event *event, void **pages, struct page *page = virt_to_page(pages[i]); if (PagePrivate(page)) { - pr_warn("unexpected high-order page for auxbuf!"); - goto out_free_pglist; + for (j = 0; j < 1 << page_private(page); j++) + pglist[i + j] = page++; + i += j - 1; + } else { + pglist[i] = page; } - - pglist[i] = virt_to_page(pages[i]); } buf->base = vmap(pglist, nr_pages, VM_MAP, PAGE_KERNEL);