On Wed, 5 Jun 2019 14:19:36 +0300 Tzvetomir Stoyanov <tstoyanov@xxxxxxxxxx> wrote: > @@ -973,6 +984,17 @@ static void __free_page(struct tracecmd_input *handle, struct page *page) > cpu_data->page_cnt--; > > free(page); > + > + for (index = cpu_data->nr_pages - 1; index > 0; index--) > + if (cpu_data->pages[index]) > + break; > + if (index < (cpu_data->nr_pages - 1)) { > + pages = realloc(cpu_data->pages, (index + 1) * sizeof(*cpu_data->pages)); > + if (!pages) > + return; > + cpu_data->pages = pages; > + cpu_data->nr_pages = index + 1; > + } > } > Heads up. Johannes found a regression that this code above causes reading a 1.7G file where the above code makes it go from reading it in 5 seconds, to over 2 minutes! I bisected it down to this commit (saw a small, but not so drastic performance issue it my tests). I asked Johannes to revert the commit, and he said that it removed the regression. He said he'll report this in the Bugzilla, but we should be looking at changing the realloc() logic. -- Steve