Re: [RFC v10 PATCH 0/3] mm: zap pages with read mmap_sem in munmap for large mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux