]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/page_alloc.c
ASoC: Intel: sof-rt5682: add a check for devm_clk_get
[linux.git] / mm / page_alloc.c
index dbd0d5cbbcbb57a5ef5dbe903382bfe096be10a4..272c6de1bf4ead31c22aca202940da00bc8eaf8b 100644 (file)
@@ -450,7 +450,7 @@ static inline unsigned long *get_pageblock_bitmap(struct page *page,
                                                        unsigned long pfn)
 {
 #ifdef CONFIG_SPARSEMEM
-       return __pfn_to_section(pfn)->pageblock_flags;
+       return section_to_usemap(__pfn_to_section(pfn));
 #else
        return page_zone(page)->pageblock_flags;
 #endif /* CONFIG_SPARSEMEM */
@@ -4102,7 +4102,6 @@ static int
 __perform_reclaim(gfp_t gfp_mask, unsigned int order,
                                        const struct alloc_context *ac)
 {
-       struct reclaim_state reclaim_state;
        int progress;
        unsigned int noreclaim_flag;
        unsigned long pflags;
@@ -4114,13 +4113,10 @@ __perform_reclaim(gfp_t gfp_mask, unsigned int order,
        psi_memstall_enter(&pflags);
        fs_reclaim_acquire(gfp_mask);
        noreclaim_flag = memalloc_noreclaim_save();
-       reclaim_state.reclaimed_slab = 0;
-       current->reclaim_state = &reclaim_state;
 
        progress = try_to_free_pages(ac->zonelist, order, gfp_mask,
                                                                ac->nodemask);
 
-       current->reclaim_state = NULL;
        memalloc_noreclaim_restore(noreclaim_flag);
        fs_reclaim_release(gfp_mask);
        psi_memstall_leave(&pflags);
@@ -5925,11 +5921,12 @@ void __ref memmap_init_zone_device(struct zone *zone,
 {
        unsigned long pfn, end_pfn = start_pfn + size;
        struct pglist_data *pgdat = zone->zone_pgdat;
+       struct vmem_altmap *altmap = pgmap_altmap(pgmap);
        unsigned long zone_idx = zone_idx(zone);
        unsigned long start = jiffies;
        int nid = pgdat->node_id;
 
-       if (WARN_ON_ONCE(!pgmap || !is_dev_zone(zone)))
+       if (WARN_ON_ONCE(!pgmap || zone_idx(zone) != ZONE_DEVICE))
                return;
 
        /*
@@ -5937,9 +5934,7 @@ void __ref memmap_init_zone_device(struct zone *zone,
         * of the pages reserved for the memmap, so we can just jump to
         * the end of that region and start processing the device pages.
         */
-       if (pgmap->altmap_valid) {
-               struct vmem_altmap *altmap = &pgmap->altmap;
-
+       if (altmap) {
                start_pfn = altmap->base_pfn + vmem_altmap_offset(altmap);
                size = end_pfn - start_pfn;
        }
@@ -5959,12 +5954,12 @@ void __ref memmap_init_zone_device(struct zone *zone,
                __SetPageReserved(page);
 
                /*
-                * ZONE_DEVICE pages union ->lru with a ->pgmap back
-                * pointer and hmm_data.  It is a bug if a ZONE_DEVICE
-                * page is ever freed or placed on a driver-private list.
+                * ZONE_DEVICE pages union ->lru with a ->pgmap back pointer
+                * and zone_device_data.  It is a bug if a ZONE_DEVICE page is
+                * ever freed or placed on a driver-private list.
                 */
                page->pgmap = pgmap;
-               page->hmm_data = 0;
+               page->zone_device_data = NULL;
 
                /*
                 * Mark the block movable so that blocks are reserved for
@@ -5979,7 +5974,7 @@ void __ref memmap_init_zone_device(struct zone *zone,
                 * pfn out of zone.
                 *
                 * Please note that MEMMAP_HOTPLUG path doesn't clear memmap
-                * because this is done early in sparse_add_one_section
+                * because this is done early in section_activate()
                 */
                if (!(pfn & (pageblock_nr_pages - 1))) {
                        set_pageblock_migratetype(page, MIGRATE_MOVABLE);
@@ -7356,12 +7351,18 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
                               (u64)zone_movable_pfn[i] << PAGE_SHIFT);
        }
 
-       /* Print out the early node map */
+       /*
+        * Print out the early node map, and initialize the
+        * subsection-map relative to active online memory ranges to
+        * enable future "sub-section" extensions of the memory map.
+        */
        pr_info("Early memory node ranges\n");
-       for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid)
+       for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
                pr_info("  node %3d: [mem %#018Lx-%#018Lx]\n", nid,
                        (u64)start_pfn << PAGE_SHIFT,
                        ((u64)end_pfn << PAGE_SHIFT) - 1);
+               subsection_map_init(start_pfn, end_pfn - start_pfn);
+       }
 
        /* Initialise every node */
        mminit_verify_pageflags_layout();