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

Sergey Senozhatsky sergey.senozhatsky.work at gmail.com
Wed Jun 15 19:18:13 PDT 2016


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



More information about the linux-arm-kernel mailing list