mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: akpm@linux-foundation.org
Cc: torvalds@linux-foundation.org, hughd@google.com, mel@csn.ul.ie,
	riel@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [patch 45/99] mm: unmapped page migration avoid unmap+remap overhead
Date: Sat, 13 Dec 2014 19:08:07 -0800	[thread overview]
Message-ID: <1418526487.1928.1.camel@stgolabs.net> (raw)
In-Reply-To: <548b8eb3.mP5dt9zrTrZO7rLj%akpm@linux-foundation.org>

On Fri, 2014-12-12 at 16:56 -0800, akpm@linux-foundation.org wrote:
> From: Hugh Dickins <hughd@google.com>
> Subject: mm: unmapped page migration avoid unmap+remap overhead
> 
> Page migration's __unmap_and_move(), and rmap's try_to_unmap(), were
> created for use on pages almost certainly mapped into userspace.  But
> nowadays compaction often applies them to unmapped page cache pages: which
> may exacerbate contention on i_mmap_rwsem quite unnecessarily, since
> try_to_unmap_file() makes no preliminary page_mapped() check.
> 
> Now check page_mapped() in __unmap_and_move(); and avoid repeating the
> same overhead in rmap_walk_file() - don't remove_migration_ptes() when we
> never inserted any.
> 
> (The PageAnon(page) comment blocks now look even sillier than before, but
> clean that up on some other occasion.  And note in passing that
> try_to_unmap_one() does not use a migration entry when PageSwapCache, so
> remove_migration_ptes() will then not update that swap entry to newpage
> pte: not a big deal, but something else to clean up later.)
> 
> Davidlohr remarked in "mm,fs: introduce helpers around the i_mmap_mutex"
> conversion to i_mmap_rwsem, that "The biggest winner of these changes is
> migration": a part of the reason might be all of that unnecessary taking
> of i_mmap_mutex in page migration; 

Yeah, this is making a lot of sense.

> and it's rather a shame that I didn't
> get around to sending this patch in before his - this one is much less
> useful after Davidlohr's conversion to rwsem, but still good.

Now that I have some free hardware, I did some testing to consider this
patch for some SLE kernels (which still has the i_mmap mutex), and it
sure relieves a lot of the overhead/contention. On a 60-core box with a
file server benchmark we increase throughput by up to 60-70%:

new_fserver-61     21456.59 (  0.00%)    35875.59 ( 67.20%)
new_fserver-121    22335.16 (  0.00%)    38037.28 ( 70.30%)
new_fserver-181    23280.22 (  0.00%)    39518.54 ( 69.75%)
new_fserver-241    23194.88 (  0.00%)    39065.85 ( 68.42%)
new_fserver-301    23135.30 (  0.00%)    38464.88 ( 66.26%)
new_fserver-361    22922.97 (  0.00%)    38115.74 ( 66.28%)
new_fserver-421    22841.84 (  0.00%)    37859.06 ( 65.74%)
new_fserver-481    22643.83 (  0.00%)    37751.59 ( 66.72%)
new_fserver-541    22620.21 (  0.00%)    37036.09 ( 63.73%)
new_fserver-601    22593.85 (  0.00%)    36959.11 ( 63.58%)
new_fserver-661    22434.81 (  0.00%)    36629.28 ( 63.27%)
new_fserver-721    22219.68 (  0.00%)    36128.16 ( 62.60%)
new_fserver-781    22134.90 (  0.00%)    35893.50 ( 62.16%)
new_fserver-841    21901.59 (  0.00%)    35826.33 ( 63.58%)
new_fserver-901    21911.80 (  0.00%)    35285.66 ( 61.03%)
new_fserver-961    21810.72 (  0.00%)    35253.62 ( 61.63%)

Anyway, it's already picked up by Linus, but thought it would be nice to
have actual data.

Thanks,
Davidlohr



       reply	other threads:[~2014-12-14  3:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <548b8eb3.mP5dt9zrTrZO7rLj%akpm@linux-foundation.org>
2014-12-14  3:08 ` Davidlohr Bueso [this message]
2014-12-14  3:24   ` Hugh Dickins

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=1418526487.1928.1.camel@stgolabs.net \
    --to=dave@stgolabs.net \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=riel@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®