From: Daniel Jordan <daniel.m.jordan@oracle.com>
To: Steven Whitehouse <swhiteho@redhat.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: aaron.lu@intel.com, ak@linux.intel.com,
akpm@linux-foundation.org, Dave.Dice@oracle.com,
dave@stgolabs.net, khandual@linux.vnet.ibm.com,
ldufour@linux.vnet.ibm.com, mgorman@suse.de, mhocko@kernel.org,
pasha.tatashin@oracle.com, steven.sistare@oracle.com,
yossi.lev@oracle.com
Subject: Re: [RFC PATCH v1 00/13] lru_lock scalability
Date: Thu, 1 Feb 2018 23:18:01 -0500 [thread overview]
Message-ID: <e3e47085-1b5e-0d2e-f8cb-03defb9af0dd@oracle.com> (raw)
In-Reply-To: <6bd1c8a5-c682-a3ce-1f9f-f1f53b4117a9@redhat.com>
On 02/01/2018 10:54 AM, Steven Whitehouse wrote:
> Hi,
>
>
> On 31/01/18 23:04, daniel.m.jordan@oracle.com wrote:
>> lru_lock, a per-node* spinlock that protects an LRU list, is one of the
>> hottest locks in the kernel.A On some workloads on large machines, it
>> shows up at the top of lock_stat.
>>
>> One way to improve lru_lock scalability is to introduce an array of locks,
>> with each lock protecting certain batches of LRU pages.
>>
>> A A A A A A A A *ooooooooooo**ooooooooooo**ooooooooooo**oooo ...
>> A A A A A A A A |A A A A A A A A A A ||A A A A A A A A A A ||A A A A A A A A A A ||
>> A A A A A A A A A \ batch 1 /A \ batch 2 /A \ batch 3 /
>>
>> In this ASCII depiction of an LRU, a page is represented with either '*'
>> or 'o'.A An asterisk indicates a sentinel page, which is a page at the
>> edge of a batch.A An 'o' indicates a non-sentinel page.
>>
>> To remove a non-sentinel LRU page, only one lock from the array is
>> required.A This allows multiple threads to remove pages from different
>> batches simultaneously.A A sentinel page requires lru_lock in addition to
>> a lock from the array.
>>
>> Full performance numbers appear in the last patch in this series, but this
>> prototype allows a microbenchmark to do up to 28% more page faults per
>> second with 16 or more concurrent processes.
>>
>> This work was developed in collaboration with Steve Sistare.
>>
>> Note: This is an early prototype.A I'm submitting it now to support my
>> request to attend LSF/MM, as well as get early feedback on the idea.A Any
>> comments appreciated.
>>
>>
>> * lru_lock is actually per-memcg, but without memcg's in the picture it
>> A A becomes per-node.
> GFS2 has an lru list for glocks, which can be contended under certain workloads. Work is still ongoing to figure out exactly why, but this looks like it might be a good approach to that issue too. The main purpose of GFS2's lru list is to allow shrinking of the glocks under memory pressure via the gfs2_scan_glock_lru() function, and it looks like this type of approach could be used there to improve the scalability,
Glad to hear that this could help in gfs2 as well.
Hopefully struct gfs2_glock is less space constrained than struct page for storing the few bits of metadata that this approach requires.
Daniel
>
> Steve.
>
>>
>> Aaron Lu (1):
>> A A mm: add a percpu_pagelist_batch sysctl interface
>>
>> Daniel Jordan (12):
>> A A mm: allow compaction to be disabled
>> A A mm: add lock array to pgdat and batch fields to struct page
>> A A mm: introduce struct lru_list_head in lruvec to hold per-LRU batch
>> A A A A info
>> A A mm: add batching logic to add/delete/move API's
>> A A mm: add lru_[un]lock_all APIs
>> A A mm: convert to-be-refactored lru_lock callsites to lock-all API
>> A A mm: temporarily convert lru_lock callsites to lock-all API
>> A A mm: introduce add-only version of pagevec_lru_move_fn
>> A A mm: add LRU batch lock API's
>> A A mm: use lru_batch locking in release_pages
>> A A mm: split up release_pages into non-sentinel and sentinel passes
>> A A mm: splice local lists onto the front of the LRU
>>
>> A include/linux/mm_inline.h | 209 +++++++++++++++++++++++++++++++++++++++++++++-
>> A include/linux/mm_types.hA |A A 5 ++
>> A include/linux/mmzone.hA A A |A 25 +++++-
>> A kernel/sysctl.cA A A A A A A A A A |A A 9 ++
>> A mm/KconfigA A A A A A A A A A A A A A A |A A 1 -
>> A mm/huge_memory.cA A A A A A A A A |A A 6 +-
>> A mm/memcontrol.cA A A A A A A A A A |A A 5 +-
>> A mm/mlock.cA A A A A A A A A A A A A A A |A 11 +--
>> A mm/mmzone.cA A A A A A A A A A A A A A |A A 7 +-
>> A mm/page_alloc.cA A A A A A A A A A |A 43 +++++++++-
>> A mm/page_idle.cA A A A A A A A A A A |A A 4 +-
>> A mm/swap.cA A A A A A A A A A A A A A A A | 208 ++++++++++++++++++++++++++++++++++++---------
>> A mm/vmscan.cA A A A A A A A A A A A A A |A 49 +++++------
>> A 13 files changed, 500 insertions(+), 82 deletions(-)
>>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2018-02-02 4:18 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 23:04 daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 01/13] mm: add a percpu_pagelist_batch sysctl interface daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 02/13] mm: allow compaction to be disabled daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 03/13] mm: add lock array to pgdat and batch fields to struct page daniel.m.jordan
2018-02-01 22:50 ` Tim Chen
2018-02-02 4:29 ` Daniel Jordan
2018-01-31 23:04 ` [RFC PATCH v1 04/13] mm: introduce struct lru_list_head in lruvec to hold per-LRU batch info daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 05/13] mm: add batching logic to add/delete/move API's daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 06/13] mm: add lru_[un]lock_all APIs daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 07/13] mm: convert to-be-refactored lru_lock callsites to lock-all API daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 08/13] mm: temporarily convert " daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 09/13] mm: introduce add-only version of pagevec_lru_move_fn daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 10/13] mm: add LRU batch lock API's daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 11/13] mm: use lru_batch locking in release_pages daniel.m.jordan
2018-01-31 23:04 ` [RFC PATCH v1 12/13] mm: split up release_pages into non-sentinel and sentinel passes daniel.m.jordan
2018-02-02 14:40 ` Laurent Dufour
2018-02-02 17:00 ` Laurent Dufour
2018-02-06 17:47 ` Daniel Jordan
2018-02-05 4:58 ` [lkp-robot] [mm] 44b163e12f: kernel_BUG_at_mm/swap.c kernel test robot
2018-01-31 23:04 ` [RFC PATCH v1 13/13] mm: splice local lists onto the front of the LRU daniel.m.jordan
2018-02-01 23:30 ` Tim Chen
2018-02-02 5:17 ` Daniel Jordan
2018-02-02 5:21 ` Aaron Lu
2018-02-06 17:38 ` Daniel Jordan
2018-02-02 15:22 ` Laurent Dufour
2018-02-06 18:18 ` Daniel Jordan
2018-02-01 15:54 ` [RFC PATCH v1 00/13] lru_lock scalability Steven Whitehouse
2018-02-02 4:18 ` Daniel Jordan [this message]
2018-02-02 10:50 ` Steven Whitehouse
2018-02-08 23:36 ` Andrew Morton
2018-02-13 21:07 ` Daniel Jordan
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=e3e47085-1b5e-0d2e-f8cb-03defb9af0dd@oracle.com \
--to=daniel.m.jordan@oracle.com \
--cc=Dave.Dice@oracle.com \
--cc=aaron.lu@intel.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=khandual@linux.vnet.ibm.com \
--cc=ldufour@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=pasha.tatashin@oracle.com \
--cc=steven.sistare@oracle.com \
--cc=swhiteho@redhat.com \
--cc=yossi.lev@oracle.com \
/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