Lines Matching refs:pgdat
377 void reset_isolation_suitable(pg_data_t *pgdat) in reset_isolation_suitable() argument
382 struct zone *zone = &pgdat->node_zones[zoneid]; in reset_isolation_suitable()
748 static bool too_many_isolated(pg_data_t *pgdat) in too_many_isolated() argument
754 inactive = node_page_state(pgdat, NR_INACTIVE_FILE) + in too_many_isolated()
755 node_page_state(pgdat, NR_INACTIVE_ANON); in too_many_isolated()
756 active = node_page_state(pgdat, NR_ACTIVE_FILE) + in too_many_isolated()
757 node_page_state(pgdat, NR_ACTIVE_ANON); in too_many_isolated()
758 isolated = node_page_state(pgdat, NR_ISOLATED_FILE) + in too_many_isolated()
759 node_page_state(pgdat, NR_ISOLATED_ANON); in too_many_isolated()
763 wake_throttle_isolated(pgdat); in too_many_isolated()
789 pg_data_t *pgdat = cc->zone->zone_pgdat; in isolate_migratepages_block() local
809 while (unlikely(too_many_isolated(pgdat))) { in isolate_migratepages_block()
818 reclaim_throttle(pgdat, VMSCAN_THROTTLE_ISOLATED); in isolate_migratepages_block()
1976 static bool kswapd_is_running(pg_data_t *pgdat) in kswapd_is_running() argument
1980 pgdat_kswapd_lock(pgdat); in kswapd_is_running()
1981 running = pgdat->kswapd && task_is_running(pgdat->kswapd); in kswapd_is_running()
1982 pgdat_kswapd_unlock(pgdat); in kswapd_is_running()
2021 static unsigned int fragmentation_score_node(pg_data_t *pgdat) in fragmentation_score_node() argument
2029 zone = &pgdat->node_zones[zoneid]; in fragmentation_score_node()
2036 static unsigned int fragmentation_score_wmark(pg_data_t *pgdat, bool low) in fragmentation_score_wmark() argument
2049 static bool should_proactive_compact_node(pg_data_t *pgdat) in should_proactive_compact_node() argument
2053 if (!sysctl_compaction_proactiveness || kswapd_is_running(pgdat)) in should_proactive_compact_node()
2056 wmark_high = fragmentation_score_wmark(pgdat, false); in should_proactive_compact_node()
2057 return fragmentation_score_node(pgdat) > wmark_high; in should_proactive_compact_node()
2088 pg_data_t *pgdat; in __compact_finished() local
2090 pgdat = cc->zone->zone_pgdat; in __compact_finished()
2091 if (kswapd_is_running(pgdat)) in __compact_finished()
2095 wmark_low = fragmentation_score_wmark(pgdat, true); in __compact_finished()
2646 static void proactive_compact_node(pg_data_t *pgdat) in proactive_compact_node() argument
2660 zone = &pgdat->node_zones[zoneid]; in proactive_compact_node()
2676 pg_data_t *pgdat = NODE_DATA(nid); in compact_node() local
2690 zone = &pgdat->node_zones[zoneid]; in compact_node()
2733 pg_data_t *pgdat = NODE_DATA(nid); in compaction_proactiveness_sysctl_handler() local
2735 if (pgdat->proactive_compact_trigger) in compaction_proactiveness_sysctl_handler()
2738 pgdat->proactive_compact_trigger = true; in compaction_proactiveness_sysctl_handler()
2739 wake_up_interruptible(&pgdat->kcompactd_wait); in compaction_proactiveness_sysctl_handler()
2788 static inline bool kcompactd_work_requested(pg_data_t *pgdat) in kcompactd_work_requested() argument
2790 return pgdat->kcompactd_max_order > 0 || kthread_should_stop() || in kcompactd_work_requested()
2791 pgdat->proactive_compact_trigger; in kcompactd_work_requested()
2794 static bool kcompactd_node_suitable(pg_data_t *pgdat) in kcompactd_node_suitable() argument
2798 enum zone_type highest_zoneidx = pgdat->kcompactd_highest_zoneidx; in kcompactd_node_suitable()
2801 zone = &pgdat->node_zones[zoneid]; in kcompactd_node_suitable()
2806 if (compaction_suitable(zone, pgdat->kcompactd_max_order, 0, in kcompactd_node_suitable()
2814 static void kcompactd_do_work(pg_data_t *pgdat) in kcompactd_do_work() argument
2823 .order = pgdat->kcompactd_max_order, in kcompactd_do_work()
2824 .search_order = pgdat->kcompactd_max_order, in kcompactd_do_work()
2825 .highest_zoneidx = pgdat->kcompactd_highest_zoneidx, in kcompactd_do_work()
2830 trace_mm_compaction_kcompactd_wake(pgdat->node_id, cc.order, in kcompactd_do_work()
2837 zone = &pgdat->node_zones[zoneid]; in kcompactd_do_work()
2886 if (pgdat->kcompactd_max_order <= cc.order) in kcompactd_do_work()
2887 pgdat->kcompactd_max_order = 0; in kcompactd_do_work()
2888 if (pgdat->kcompactd_highest_zoneidx >= cc.highest_zoneidx) in kcompactd_do_work()
2889 pgdat->kcompactd_highest_zoneidx = pgdat->nr_zones - 1; in kcompactd_do_work()
2892 void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx) in wakeup_kcompactd() argument
2897 if (pgdat->kcompactd_max_order < order) in wakeup_kcompactd()
2898 pgdat->kcompactd_max_order = order; in wakeup_kcompactd()
2900 if (pgdat->kcompactd_highest_zoneidx > highest_zoneidx) in wakeup_kcompactd()
2901 pgdat->kcompactd_highest_zoneidx = highest_zoneidx; in wakeup_kcompactd()
2907 if (!wq_has_sleeper(&pgdat->kcompactd_wait)) in wakeup_kcompactd()
2910 if (!kcompactd_node_suitable(pgdat)) in wakeup_kcompactd()
2913 trace_mm_compaction_wakeup_kcompactd(pgdat->node_id, order, in wakeup_kcompactd()
2915 wake_up_interruptible(&pgdat->kcompactd_wait); in wakeup_kcompactd()
2924 pg_data_t *pgdat = (pg_data_t *)p; in kcompactd() local
2929 const struct cpumask *cpumask = cpumask_of_node(pgdat->node_id); in kcompactd()
2936 pgdat->kcompactd_max_order = 0; in kcompactd()
2937 pgdat->kcompactd_highest_zoneidx = pgdat->nr_zones - 1; in kcompactd()
2948 trace_mm_compaction_kcompactd_sleep(pgdat->node_id); in kcompactd()
2949 if (wait_event_freezable_timeout(pgdat->kcompactd_wait, in kcompactd()
2950 kcompactd_work_requested(pgdat), timeout) && in kcompactd()
2951 !pgdat->proactive_compact_trigger) { in kcompactd()
2954 kcompactd_do_work(pgdat); in kcompactd()
2972 if (should_proactive_compact_node(pgdat)) { in kcompactd()
2975 prev_score = fragmentation_score_node(pgdat); in kcompactd()
2976 proactive_compact_node(pgdat); in kcompactd()
2977 score = fragmentation_score_node(pgdat); in kcompactd()
2986 if (unlikely(pgdat->proactive_compact_trigger)) in kcompactd()
2987 pgdat->proactive_compact_trigger = false; in kcompactd()
2999 pg_data_t *pgdat = NODE_DATA(nid); in kcompactd_run() local
3001 if (pgdat->kcompactd) in kcompactd_run()
3004 pgdat->kcompactd = kthread_run(kcompactd, pgdat, "kcompactd%d", nid); in kcompactd_run()
3005 if (IS_ERR(pgdat->kcompactd)) { in kcompactd_run()
3007 pgdat->kcompactd = NULL; in kcompactd_run()
3036 pg_data_t *pgdat = NODE_DATA(nid); in kcompactd_cpu_online() local
3039 mask = cpumask_of_node(pgdat->node_id); in kcompactd_cpu_online()
3043 if (pgdat->kcompactd) in kcompactd_cpu_online()
3044 set_cpus_allowed_ptr(pgdat->kcompactd, mask); in kcompactd_cpu_online()