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: Fri, 2 Feb 2018 09:00:03 -0800	[thread overview]
Message-ID: <20180202170003.GA16840@bombadil.infradead.org> (raw)
In-Reply-To: <af831ebd-6acf-1f83-c531-39895ab2eddb@oracle.com>

On Thu, Feb 01, 2018 at 11:07:56PM -0500, Daniel Jordan wrote:
> On 02/01/2018 04:44 AM, Matthew Wilcox wrote:
> > 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.
> 
> I like the idea of touching fewer cachelines.
> 
> I looked through your latest XArray series (v6).  Am I understanding it correctly that a removal (xa_erase) is an exclusive operation within one XArray, i.e. that only one thread can do this at once?  Not sure how XQueue would implement removal though, so the answer might be different for it.

That's currently the case for the XArray, yes.  Peter Zijlstra wrote a
paper over ten years ago for allowing multiple simultaneous page-cache
writers.  https://www.kernel.org/doc/ols/2007/ols2007v2-pages-311-318.pdf

I'm not sure it's applicable to the current XArray which has grown other
features, but it should be implementable for the XQueue.

--
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-02 17:00 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
2018-02-02  4:07   ` Daniel Jordan
2018-02-02 17:00     ` Matthew Wilcox [this message]
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=20180202170003.GA16840@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).