All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Andrea Arcangeli <aarcange@redhat.com>,
	David Rientjes <rientjes@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	mgorman@techsingularity.net, mhocko@kernel.org,
	ying.huang@intel.com, s.priebe@profihost.ag,
	Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
	alex.williamson@redhat.com, lkp@01.org, kirill@shutemov.name,
	Andrew Morton <akpm@linux-foundation.org>,
	zi.yan@cs.rutgers.edu
Subject: Re: [LKP] [mm] ac5b2c1891: vm-scalability.throughput -61.3% regression
Date: Thu, 6 Dec 2018 10:23:15 +0100	[thread overview]
Message-ID: <a55a4fe9-6abe-ccb8-befd-afdacac2829d@suse.cz> (raw)
In-Reply-To: <20181206005425.GB21159@redhat.com>

On 12/6/18 1:54 AM, Andrea Arcangeli wrote:
> On Wed, Dec 05, 2018 at 04:18:14PM -0800, David Rientjes wrote:
>> On Wed, 5 Dec 2018, Andrea Arcangeli wrote:
>>
>> Note that in addition to COMPACT_SKIPPED that you mention, compaction can 
>> fail with COMPACT_COMPLETE, meaning the full scan has finished without 
>> freeing a hugepage, or COMPACT_DEFERRED, meaning that doing another scan 
>> is unlikely to produce a different result.  COMPACT_SKIPPED makes sense to 
>> do reclaim if it can become accessible to isolate_freepages() and 
>> hopefully another allocator does not allocate from these newly freed pages 
>> before compaction can scan the zone again.  For COMPACT_COMPLETE and 
>> COMPACT_DEFERRED, reclaim is unlikely to ever help.
> 
> The COMPACT_COMPLETE and (COMPACT_PARTIAL_SKIPPED for that matter)
> seems just a mistake in the max() evaluation try_to_compact_pages()
> that let it return COMPACT_COMPLETE and COMPACT_PARTIAL_SKIPPED. I
> think it should just return COMPACT_DEFERRED in those two cases and it
> should be enforced forced for all prio.
> 
> There are really only 3 cases that matter for the caller:
> 
> 1) succeed -> we got the page
> 2) defer -> we failed (caller won't care about why)
> 3) skipped -> failed because not enough 4k freed -> reclaim must be invoked then
>    compaction can be retried
> 
> PARTIAL_SKIPPED/COMPLETE both fall into 2) above so for the caller
> they should be treated the same way. It doesn't seem very concerning
> that it may try like if it succeeded and do a spurious single reclaim
> invocation, but it's good to fix this and take the COMPACT_DEFERRED
> nopage path in the __GFP_NORETRY case.

Yeah good point. I wouldn't change the general logic of
try_to_compact_pages() though, but the condition for __GFP_NORETRY can
simply change to:

if (compact_result != COMPACT_SKIPPED)
     goto nopage;

I can make a patch ASAP together with a few others I think are needed,
that should hopefully avoid the need for __GFP_COMPACT_ONLY or checks
based on order. What's probably unavoidable though is adding back
__GFP_NORETRY for madvised allocations (i.e. partially reverting
2516035499b95), but David was fine with that and your __GFP_ONLY_COMPACT
approach effectively did it too.


WARNING: multiple messages have this Message-ID (diff)
From: Vlastimil Babka <vbabka@suse.cz>
To: lkp@lists.01.org
Subject: Re: [mm] ac5b2c1891: vm-scalability.throughput -61.3% regression
Date: Thu, 06 Dec 2018 10:23:15 +0100	[thread overview]
Message-ID: <a55a4fe9-6abe-ccb8-befd-afdacac2829d@suse.cz> (raw)
In-Reply-To: <20181206005425.GB21159@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2294 bytes --]

On 12/6/18 1:54 AM, Andrea Arcangeli wrote:
> On Wed, Dec 05, 2018 at 04:18:14PM -0800, David Rientjes wrote:
>> On Wed, 5 Dec 2018, Andrea Arcangeli wrote:
>>
>> Note that in addition to COMPACT_SKIPPED that you mention, compaction can 
>> fail with COMPACT_COMPLETE, meaning the full scan has finished without 
>> freeing a hugepage, or COMPACT_DEFERRED, meaning that doing another scan 
>> is unlikely to produce a different result.  COMPACT_SKIPPED makes sense to 
>> do reclaim if it can become accessible to isolate_freepages() and 
>> hopefully another allocator does not allocate from these newly freed pages 
>> before compaction can scan the zone again.  For COMPACT_COMPLETE and 
>> COMPACT_DEFERRED, reclaim is unlikely to ever help.
> 
> The COMPACT_COMPLETE and (COMPACT_PARTIAL_SKIPPED for that matter)
> seems just a mistake in the max() evaluation try_to_compact_pages()
> that let it return COMPACT_COMPLETE and COMPACT_PARTIAL_SKIPPED. I
> think it should just return COMPACT_DEFERRED in those two cases and it
> should be enforced forced for all prio.
> 
> There are really only 3 cases that matter for the caller:
> 
> 1) succeed -> we got the page
> 2) defer -> we failed (caller won't care about why)
> 3) skipped -> failed because not enough 4k freed -> reclaim must be invoked then
>    compaction can be retried
> 
> PARTIAL_SKIPPED/COMPLETE both fall into 2) above so for the caller
> they should be treated the same way. It doesn't seem very concerning
> that it may try like if it succeeded and do a spurious single reclaim
> invocation, but it's good to fix this and take the COMPACT_DEFERRED
> nopage path in the __GFP_NORETRY case.

Yeah good point. I wouldn't change the general logic of
try_to_compact_pages() though, but the condition for __GFP_NORETRY can
simply change to:

if (compact_result != COMPACT_SKIPPED)
     goto nopage;

I can make a patch ASAP together with a few others I think are needed,
that should hopefully avoid the need for __GFP_COMPACT_ONLY or checks
based on order. What's probably unavoidable though is adding back
__GFP_NORETRY for madvised allocations (i.e. partially reverting
2516035499b95), but David was fine with that and your __GFP_ONLY_COMPACT
approach effectively did it too.


  reply	other threads:[~2018-12-06  9:26 UTC|newest]

Thread overview: 154+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27  6:25 [LKP] [mm] ac5b2c1891: vm-scalability.throughput -61.3% regression kernel test robot
2018-11-27  6:25 ` kernel test robot
2018-11-27 17:08 ` [LKP] " Linus Torvalds
2018-11-27 17:08   ` Linus Torvalds
2018-11-27 18:17   ` [LKP] " Michal Hocko
2018-11-27 18:17     ` Michal Hocko
2018-11-27 18:21     ` [LKP] " Michal Hocko
2018-11-27 18:21       ` Michal Hocko
2018-11-27 19:05   ` [LKP] " Vlastimil Babka
2018-11-27 19:05     ` Vlastimil Babka
2018-11-27 19:16     ` [LKP] " Vlastimil Babka
2018-11-27 19:16       ` Vlastimil Babka
2018-11-27 20:57   ` [LKP] " Andrea Arcangeli
2018-11-27 20:57     ` Andrea Arcangeli
2018-11-27 22:50     ` [LKP] " Linus Torvalds
2018-11-27 22:50       ` Linus Torvalds
2018-11-28  6:30       ` [LKP] " Michal Hocko
2018-11-28  6:30         ` Michal Hocko
2018-11-28  3:20     ` [LKP] " Huang, Ying
2018-11-28  3:20       ` Huang, Ying
2018-11-28 16:48       ` [LKP] " Linus Torvalds
2018-11-28 16:48         ` Linus Torvalds
2018-11-28 18:39         ` [LKP] " Andrea Arcangeli
2018-11-28 18:39           ` Andrea Arcangeli
2018-11-28 23:10         ` [LKP] " David Rientjes
2018-11-28 23:10           ` David Rientjes
2018-12-03 18:01         ` [LKP] " Linus Torvalds
2018-12-03 18:01           ` Linus Torvalds
2018-12-03 18:14           ` [LKP] " Michal Hocko
2018-12-03 18:14             ` Michal Hocko
2018-12-03 18:19             ` [LKP] " Linus Torvalds
2018-12-03 18:19               ` Linus Torvalds
2018-12-03 18:30               ` [LKP] " Michal Hocko
2018-12-03 18:30                 ` Michal Hocko
2018-12-03 18:45                 ` [LKP] " Linus Torvalds
2018-12-03 18:45                   ` Linus Torvalds
2018-12-03 18:59                   ` [LKP] " Michal Hocko
2018-12-03 18:59                     ` Michal Hocko
2018-12-03 19:23                     ` [LKP] " Andrea Arcangeli
2018-12-03 19:23                       ` Andrea Arcangeli
2018-12-03 20:26                       ` [LKP] " David Rientjes
2018-12-03 20:26                         ` David Rientjes
2018-12-03 19:28                     ` [LKP] " Linus Torvalds
2018-12-03 19:28                       ` Linus Torvalds
2018-12-03 20:12                       ` [LKP] " Andrea Arcangeli
2018-12-03 20:12                         ` Andrea Arcangeli
2018-12-03 20:36                         ` [LKP] " David Rientjes
2018-12-03 20:36                           ` David Rientjes
2018-12-03 22:04                         ` [LKP] " Linus Torvalds
2018-12-03 22:04                           ` Linus Torvalds
2018-12-03 22:27                           ` [LKP] " Linus Torvalds
2018-12-03 22:27                             ` Linus Torvalds
2018-12-03 22:57                             ` [LKP] " David Rientjes
2018-12-03 22:57                               ` David Rientjes
2018-12-04  9:22                             ` [LKP] " Vlastimil Babka
2018-12-04  9:22                               ` Vlastimil Babka
2018-12-04 10:45                               ` [LKP] " Mel Gorman
2018-12-04 10:45                                 ` Mel Gorman
2018-12-05  0:47                                 ` [LKP] " David Rientjes
2018-12-05  0:47                                   ` David Rientjes
2018-12-05  9:08                                   ` [LKP] " Michal Hocko
2018-12-05  9:08                                     ` Michal Hocko
2018-12-05 10:43                                     ` [LKP] " Mel Gorman
2018-12-05 10:43                                       ` Mel Gorman
2018-12-05 11:43                                       ` [LKP] " Michal Hocko
2018-12-05 11:43                                         ` Michal Hocko
2018-12-05 10:06                                 ` [LKP] " Mel Gorman
2018-12-05 10:06                                   ` Mel Gorman
2018-12-05 20:40                                 ` [LKP] " Andrea Arcangeli
2018-12-05 20:40                                   ` Andrea Arcangeli
2018-12-05 21:59                                   ` [LKP] " David Rientjes
2018-12-05 21:59                                     ` David Rientjes
2018-12-06  0:00                                     ` [LKP] " Andrea Arcangeli
2018-12-06  0:00                                       ` Andrea Arcangeli
2018-12-05 22:03                                   ` [LKP] " Linus Torvalds
2018-12-05 22:03                                     ` Linus Torvalds
2018-12-05 22:12                                     ` [LKP] " David Rientjes
2018-12-05 22:12                                       ` David Rientjes
2018-12-05 23:36                                     ` [LKP] " Andrea Arcangeli
2018-12-05 23:36                                       ` Andrea Arcangeli
2018-12-05 23:51                                       ` [LKP] " Linus Torvalds
2018-12-05 23:51                                         ` Linus Torvalds
2018-12-06  0:58                                         ` [LKP] " Linus Torvalds
2018-12-06  0:58                                           ` Linus Torvalds
2018-12-06  9:14                                           ` MADV_HUGEPAGE vs. NUMA semantic (was: Re: [LKP] [mm] ac5b2c1891: vm-scalability.throughput -61.3% regression) Michal Hocko
2018-12-06  9:14                                             ` MADV_HUGEPAGE vs. NUMA semantic (was: " Michal Hocko
2018-12-06 23:49                                             ` MADV_HUGEPAGE vs. NUMA semantic (was: Re: [LKP] " David Rientjes
2018-12-06 23:49                                               ` MADV_HUGEPAGE vs. NUMA semantic (was: " David Rientjes
2018-12-07  7:34                                               ` MADV_HUGEPAGE vs. NUMA semantic (was: Re: [LKP] " Michal Hocko
2018-12-07  7:34                                                 ` MADV_HUGEPAGE vs. NUMA semantic (was: " Michal Hocko
2018-12-07  4:31                                             ` MADV_HUGEPAGE vs. NUMA semantic (was: Re: [LKP] " Linus Torvalds
2018-12-07  4:31                                               ` MADV_HUGEPAGE vs. NUMA semantic (was: " Linus Torvalds
2018-12-07  7:49                                               ` MADV_HUGEPAGE vs. NUMA semantic (was: Re: [LKP] " Michal Hocko
2018-12-07  7:49                                                 ` MADV_HUGEPAGE vs. NUMA semantic (was: " Michal Hocko
2018-12-07  9:06                                                 ` MADV_HUGEPAGE vs. NUMA semantic (was: Re: [LKP] " Vlastimil Babka
2018-12-07  9:06                                                   ` MADV_HUGEPAGE vs. NUMA semantic (was: " Vlastimil Babka
2018-12-07 23:15                                                   ` MADV_HUGEPAGE vs. NUMA semantic (was: Re: [LKP] " David Rientjes
2018-12-07 23:15                                                     ` MADV_HUGEPAGE vs. NUMA semantic (was: " David Rientjes
2018-12-06 23:43                                           ` [LKP] [mm] ac5b2c1891: vm-scalability.throughput -61.3% regression David Rientjes
2018-12-06 23:43                                             ` David Rientjes
2018-12-07  4:01                                             ` [LKP] " Linus Torvalds
2018-12-07  4:01                                               ` Linus Torvalds
2018-12-10  0:29                                               ` [LKP] " David Rientjes
2018-12-10  0:29                                                 ` David Rientjes
2018-12-10  4:49                                                 ` [LKP] " Andrea Arcangeli
2018-12-10  4:49                                                   ` Andrea Arcangeli
2018-12-12  0:37                                                   ` [LKP] " David Rientjes
2018-12-12  0:37                                                     ` David Rientjes
2018-12-12  9:50                                                     ` [LKP] " Michal Hocko
2018-12-12  9:50                                                       ` Michal Hocko
2018-12-12 17:00                                                       ` [LKP] " Andrea Arcangeli
2018-12-12 17:00                                                         ` Andrea Arcangeli
2018-12-14 11:32                                                         ` [LKP] " Michal Hocko
2018-12-14 11:32                                                           ` Michal Hocko
2018-12-12 10:14                                                     ` [LKP] " Vlastimil Babka
2018-12-12 10:14                                                       ` Vlastimil Babka
2018-12-14 21:04                                                       ` [LKP] " David Rientjes
2018-12-14 21:04                                                         ` David Rientjes
2018-12-14 21:33                                                         ` [LKP] " Vlastimil Babka
2018-12-14 21:33                                                           ` Vlastimil Babka
2018-12-21 22:18                                                           ` [LKP] " David Rientjes
2018-12-21 22:18                                                             ` David Rientjes
2018-12-21 22:18                                                             ` [LKP] " David Rientjes
2018-12-22 12:08                                                             ` Mel Gorman
2018-12-22 12:08                                                               ` Mel Gorman
2018-12-14 23:11                                                         ` [LKP] " Mel Gorman
2018-12-14 23:11                                                           ` Mel Gorman
2018-12-21 22:15                                                           ` [LKP] " David Rientjes
2018-12-21 22:15                                                             ` David Rientjes
2018-12-12 10:44                                                   ` [LKP] " Andrea Arcangeli
2018-12-12 10:44                                                     ` Andrea Arcangeli
2019-04-15 11:48                                             ` [LKP] " Michal Hocko
2019-04-15 11:48                                               ` Michal Hocko
2018-12-06  0:18                                       ` [LKP] " David Rientjes
2018-12-06  0:18                                         ` David Rientjes
2018-12-06  0:54                                         ` [LKP] " Andrea Arcangeli
2018-12-06  0:54                                           ` Andrea Arcangeli
2018-12-06  9:23                                           ` Vlastimil Babka [this message]
2018-12-06  9:23                                             ` Vlastimil Babka
2018-12-03 20:39                     ` [LKP] " David Rientjes
2018-12-03 20:39                       ` David Rientjes
2018-12-03 21:25                       ` [LKP] " Michal Hocko
2018-12-03 21:25                         ` Michal Hocko
2018-12-03 21:53                         ` [LKP] " David Rientjes
2018-12-03 21:53                           ` David Rientjes
2018-12-04  8:48                           ` [LKP] " Michal Hocko
2018-12-04  8:48                             ` Michal Hocko
2018-12-05  0:07                             ` [LKP] " David Rientjes
2018-12-05  0:07                               ` David Rientjes
2018-12-05 10:18                               ` [LKP] " Michal Hocko
2018-12-05 10:18                                 ` Michal Hocko
2018-12-05 19:16                                 ` [LKP] " David Rientjes
2018-12-05 19:16                                   ` David Rientjes
2018-11-27  7:23 [LKP] " kernel test robot

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=a55a4fe9-6abe-ccb8-befd-afdacac2829d@suse.cz \
    --to=vbabka@suse.cz \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.williamson@redhat.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=rientjes@google.com \
    --cc=s.priebe@profihost.ag \
    --cc=torvalds@linux-foundation.org \
    --cc=ying.huang@intel.com \
    --cc=zi.yan@cs.rutgers.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.