Guest User

Untitled

a guest
Oct 15th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. for_each_thread(p, t) {
  2. list_for_each_entry(child, &t->children, sibling) {
  3. unsigned int child_points;
  4.  
  5. child_points = oom_badness(child,
  6. oc->memcg, oc->nodemask, oc->totalpages);
  7. if (child_points > victim_points) {
  8. put_task_struct(victim);
  9. victim = child;
  10. victim_points = child_points;
  11. get_task_struct(victim);
  12. }
  13. }
  14. }
  15.  
  16. child_points = oom_badness(child,
  17. oc->memcg, oc->nodemask, oc->totalpages);
  18.  
  19. points = get_mm_rss(p->mm) + get_mm_counter(p->mm, MM_SWAPENTS) +
  20. mm_pgtables_bytes(p->mm) / PAGE_SIZE;
  21.  
  22. static inline unsigned long get_mm_rss(struct mm_struct *mm)
  23. {
  24. return get_mm_counter(mm, MM_FILEPAGES) +
  25. get_mm_counter(mm, MM_ANONPAGES) +
  26. get_mm_counter(mm, MM_SHMEMPAGES);
  27. }
Add Comment
Please, Sign In to add comment