[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180918103757.GA17108@bombadil.infradead.org>
Date: Tue, 18 Sep 2018 03:37:57 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Yang Shi <yang.shi@...ux.alibaba.com>
Cc: mhocko@...nel.org, ldufour@...ux.vnet.ibm.com, vbabka@...e.cz,
kirill@...temov.name, akpm@...ux-foundation.org,
dave.hansen@...el.com, oleg@...hat.com, srikar@...ux.vnet.ibm.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC v10 PATCH 0/3] mm: zap pages with read mmap_sem in munmap
for large mapping
On Mon, Sep 17, 2018 at 01:00:58PM -0700, Yang Shi wrote:
> On 9/15/18 3:10 AM, Matthew Wilcox wrote:
> > Something I've been wondering about for a while is whether we should "sort"
> > the readers together. ie if the acquirers look like this:
> >
> > A write
> > B read
> > C read
> > D write
> > E read
> > F read
> > G write
> >
> > then we should grant the lock to A, BCEF, D, G rather than A, BC, D, EF, G.
>
> I'm not sure how much this can help to the real world workload.
>
> Typically, there are multi threads to contend for one mmap_sem. So, they are
> trying to read/write the same address space. There might be dependency or
> synchronization among them. Sorting read together might break the
> dependency?
I don't think that's true for the mmap_sem. If one thread is trying to
get the sem for read then it's a page fault. Another thread trying to
get the sem for write is trying to modify the address space. If an
application depends on the ordering of an mmap vs a page fault, it has
to have its own synchronisation.
Powered by blists - more mailing lists