Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_alloc.c Create Date:2022-07-28 15:04:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Spill all the per-cpu pages from all CPUs back into the buddy allocator.* When zone parameter is non-NULL, spill just the single zone's pages.* Note that this can be extremely slow as the draining happens in a workqueue.

Proto:void drain_all_pages(struct zone *zone)

Type:void

Parameter:

TypeParameterName
struct zone *zone
2894  If WARN_ON_ONCE(!mm_percpu_wq) Then Return
2902  If Value for the false possibility is greater at compile time(!mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically) Then
2903  If Not zone Then Return
2905  mutex_lock( & pcpu_drain_mutex)
2914  for_each_online_cpu(cpu)
2917  bool has_pcps = false
2919  If zone Then
2920  pcp = per_cpu_ptr(pageset, cpu)
2923  Else
2924  do nothing (z)
2925  pcp = per_cpu_ptr(pageset, cpu)
2927  has_pcps = true
2928  Break
2933  If has_pcps Then pumask_set_cpu - set a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@dstp: the cpumask pointer
2935  Else pumask_clear_cpu - clear a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@dstp: the cpumask pointer
2940  drain = per_cpu_ptr( & pcpu_drain, cpu)
2942  zone = zone
2943  INIT_WORK( & work, drain_local_pages_wq)
2944  queue_work_on - queue work on specific cpu*@cpu: CPU number to execute work on*@wq: workqueue to use*@work: work to queue* We queue the work to a specific CPU, the caller must ensure it* can't go away.
2946  for_each_cpu(cpu, & cpus_with_pcps)
2947  lush_work - wait for a work to finish executing the last queueing instance*@work: the work to flush* Wait until @work has finished execution
2949  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
Caller
NameDescribe
__alloc_pages_direct_reclaimThe really slow allocator path where we enter direct reclaim
madvise_inject_errorError injection support for memory error handling.
shake_pageWhen a unknown page type is encountered drain as many buffers as possible* in the hope to turn the page into a LRU or free page, which we can handle.
read_page_owner
set_migratetype_isolate