Subject: [PATCH] ARM: mm: Speed up page list initialization during boot

From: [email-masked] (Sergey Senozhatsky)
Date: Thu, 16 Jun 2016 11:18:13 +0900

On (01/05/16 18:56), Jungseung Lee wrote:
[..]
> > > >> #ifdef CONFIG_HIGHMEM
> > > >> static inline void free_area_high(unsigned long pfn, unsigned long
> > > >>end)  {
> > > >>-      for (; pfn < end; pfn++)
> > > >>-              free_highmem_page(pfn_to_page(pfn));
> > > >>+      while (pfn < end) {
> > > >>+              struct page *page = pfn_to_page(pfn);
> > > >>+              unsigned long order = min(__ffs(pfn), MAX_ORDER - 1);
> > > >>+              unsigned long nr_pages = 1 << order;
> > > >>+              unsigned long rem = end - pfn;
> > > >>+
> > > >>+              if (nr_pages > rem) {
> > > >>+                      order = __fls(rem);
> > > >>+                      nr_pages = 1 << order;
> > > >>+              }
> > > >>+
> > > >>+              __free_pages_bootmem(page, order);
> > > >>+              totalram_pages += nr_pages;
> > > >>+              totalhigh_pages += nr_pages;

+			page_zone(page)->managed_pages += nr_pages;  ???

> > > >>+              pfn += nr_pages;
> > > >>+      }
> > > >> }

	-ss