On Fri, 13 Feb 2009 08:56:40 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
Clarification :)
res_counter_charge() is called from
- page fault
=> under down_read(mmap_sem), lock_page() may be held. IRQ=ENABLED)
- add_to_page_cache
=> under lock_page(), mapping->tree_lock is *not* held, IRQ=DISABLED
- shmem
=> info->lock is held, we use __GFP_NOWAIT here. IRQ=ENABLED
- shmem
=> info->lock is *not* held with GFP_KERNEL here, IRQ=ENABLED.
- migration
=> under lock_page() and mmap_sem, IRQ=ENABLED
res_counter_uncharge() is called from
- page_remove_rmap()//(Only when ANON)
=> anon_vma->lock and pte_lock(),lock_page() can be held. IRQ=ENABLED?
- remove_from_page_cache()
=> lock_page() and mapping->tree_lock is held, IRQ=DISABLED.
Summary:
"Charge" is considered as heavy operation and the call path is placed where the
thread can sleep, AMAP.
"Uncharge" is considered as light operation and call path is under some # of
spinlocks.
Bye,
-Kame
--