linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org,
	steven.sistare@oracle.com, pasha.tatashin@oracle.com,
	yossi.lev@oracle.com, Dave.Dice@oracle.com,
	akpm@linux-foundation.org, mhocko@kernel.org,
	ldufour@linux.vnet.ibm.com, dave@stgolabs.net,
	khandual@linux.vnet.ibm.com, ak@linux.intel.com, mgorman@suse.de
Subject: Re: [LSF/MM TOPIC] lru_lock scalability
Date: Thu, 1 Feb 2018 01:44:31 -0800	[thread overview]
Message-ID: <20180201094431.GA20742@bombadil.infradead.org> (raw)
In-Reply-To: <2a16be43-0757-d342-abfb-d4d043922da9@oracle.com>

On Wed, Jan 31, 2018 at 11:44:29PM -0500, Daniel Jordan wrote:
> I'd like to propose a discussion of lru_lock scalability on the mm track.  Since this is similar to Laurent Dufour's mmap_sem topic, it might make sense to discuss these around the same time.
> 
> On large systems, lru_lock is one of the hottest locks in the kernel, showing up on many memory-intensive benchmarks such as decision support.  It also inhibits scalability in many of the mm paths that could be parallelized, such as freeing pages during exit/munmap and inode eviction.
> 
> I'd like to discuss the following two ways of solving this problem, as well as any other approaches or ideas people have.

Something I've been thinking about is changing the LRU from an embedded
list_head to an external data structure that I call the XQueue.
It's based on the XArray, but is used like a queue; pushing items onto
the end of the queue and popping them off the beginning.  You can also
remove items from the middle of the queue.

Removing items from the list usually involves dirtying three cachelines.
With the XQueue, you'd only dirty one.  That's going to reduce lock
hold time.  There may also be opportunities to reduce lock hold time;
removal and addition can be done in parallel as long as there's more
than 64 entries between head and tail of the list.

The downside is that adding to the queue would require memory allocation.
And I don't have time to work on it at the moment.

--
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>

  reply	other threads:[~2018-02-01  9:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  4:44 [LSF/MM TOPIC] lru_lock scalability Daniel Jordan
2018-02-01  9:44 ` Matthew Wilcox [this message]
2018-02-02  4:07   ` Daniel Jordan
2018-02-02 17:00     ` Matthew Wilcox
2018-02-06 15:33       ` Matthew Wilcox
2018-02-08 13:33         ` Daniel Jordan
2018-02-08 13:38           ` Matthew Wilcox
2018-02-02 11:02 ` Laurent Dufour

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=20180201094431.GA20742@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=Dave.Dice@oracle.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.m.jordan@oracle.com \
    --cc=dave@stgolabs.net \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=ldufour@linux.vnet.ibm.com \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=pasha.tatashin@oracle.com \
    --cc=steven.sistare@oracle.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;
as well as URLs for NNTP newsgroup(s).