On Mon, 2016-03-14 at 02:33 +0300, Kirill A. Shutemov wrote: > On Sun, Mar 13, 2016 at 11:28:55AM +0200, Ebru Akagunduz wrote: > > > > @@ -2493,7 +2494,14 @@ static void collapse_huge_page(struct > > mm_struct *mm, > > goto out; > > } > > > > - __collapse_huge_page_swapin(mm, vma, address, pmd); > > + swap = get_mm_counter(mm, MM_SWAPENTS); > > + curr_allocstall = sum_vm_event(ALLOCSTALL); > > + /* > > + * When system under pressure, don't swapin readahead. > > + * So that avoid unnecessary resource consuming. > > + */ > > + if (allocstall == curr_allocstall && swap != 0) > > + __collapse_huge_page_swapin(mm, vma, address, > > pmd); > > So, between these too points, where new ALLOCSTALL events comes from? > > I would guess that in most cases they would come from allocation of > huge > page itself (if khugepaged defrag is enabled). So we are willing to > pay > for allocation new huge page, but not for swapping in. > > I wounder, if it was wise to allocate the huge page in first place? > > Or shouldn't we at least have consistent behaviour on swap-in vs. > allocation wrt khugepaged defragmentation option? > > Or am I wrong and ALLOCSTALLs aren't caused by khugepagd? It could be caused by khugepaged, but it could just as well be caused by any other task running in the system. Khugepaged stores the allocstall value when it goes to sleep, and checks it before calling (or not) __collapse_huge_page_swapin. -- All Rights Reversed.
Attachment:
signature.asc
Description: This is a digitally signed message part