From: Rik van Riel <riel@redhat.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>,
Ebru Akagunduz <ebru.akagunduz@gmail.com>
Cc: linux-mm@kvack.org, hughd@google.com, akpm@linux-foundation.org,
kirill.shutemov@linux.intel.com, n-horiguchi@ah.jp.nec.com,
aarcange@redhat.com, iamjoonsoo.kim@lge.com, gorcunov@openvz.org,
linux-kernel@vger.kernel.org, mgorman@suse.de,
rientjes@google.com, vbabka@suse.cz,
aneesh.kumar@linux.vnet.ibm.com, hannes@cmpxchg.org,
mhocko@suse.cz, boaz@plexistor.com
Subject: Re: [PATCH v2 2/2] mm, thp: avoid unnecessary swapin in khugepaged
Date: Sun, 13 Mar 2016 21:14:41 -0400 [thread overview]
Message-ID: <1457918081.8898.1.camel@redhat.com> (raw)
In-Reply-To: <20160313233301.GB10438@node.shutemov.name>
[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]
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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2016-03-14 1:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-13 9:28 [PATCH v2 0/2] mm, thp: Fix unnecessarry resource consuming in swapin Ebru Akagunduz
2016-03-13 9:28 ` [PATCH v2 1/2] mm, vmstat: calculate particular vm event Ebru Akagunduz
2016-03-13 23:08 ` Kirill A. Shutemov
2016-03-13 9:28 ` [PATCH v2 2/2] mm, thp: avoid unnecessary swapin in khugepaged Ebru Akagunduz
2016-03-13 9:45 ` kbuild test robot
2016-03-13 23:33 ` Kirill A. Shutemov
2016-03-14 1:14 ` Rik van Riel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457918081.8898.1.camel@redhat.com \
--to=riel@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=boaz@plexistor.com \
--cc=ebru.akagunduz@gmail.com \
--cc=gorcunov@openvz.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).