All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zlatko Calusic <Zlatko.Calusic@CARNet.hr>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Andrea Arcangeli <andrea@e-mind.com>,
	Linux-MM List <linux-mm@kvack.org>, Andi Kleen <andi@zero.aec.at>
Subject: Re: Update shared mappings
Date: 30 Nov 1998 16:19:17 +0100	[thread overview]
Message-ID: <87yaotcioa.fsf@atlas.CARNet.hr> (raw)
In-Reply-To: "Stephen C. Tweedie"'s message of "Mon, 30 Nov 1998 13:52:08 GMT"

"Stephen C. Tweedie" <sct@redhat.com> writes:

> Hi,
> 
> On 20 Nov 1998 05:10:01 +0100, Zlatko Calusic <Zlatko.Calusic@CARNet.hr>
> said:
> 
> > Should this patch be applied to kernel? [Andrea's
> > update_shared_mappings patch]
> 
> No.

:)

> The mmap_semaphore is already taken out _much_ earlier on in msync(), or
> the vm_area_struct can be destroyed by another thread.  Is this patch
> tested?  Won't we deadlock immediately on doing this extra down()
> operation? 

You're right. And that is the exact reason why I had locks with
StarOffice in down_sem().

Andrea already contacted me, and I think this now concludes our
conversation regarding that problem. :)

> 
> The only reason that this patch works in its current state is that
> exit_mmap() skips the down(&mm->mmap_sem).  It can safely do so only
> because if we are exiting the mmap, we know we are the last thread and
> so no other thread can be playing games with us.  So, exit_mmap()
> doesn't deadlock, but a sys_msync() on the region looks as if it will.
> 
> Other than that, it looks fine.  One other thing occurs to me, though:
> it would be easy enough to add a condition (atomic_read(&page->count) >
> 2) on this to disable the update-mappings call entirely if the page is
> only mapped by one vma (which will be a very common case).  We already
> access the count field, so we are avoiding the cost of any extra cache
> misses if we make this check.
> 
> Comments?
> 

You're probably right.

Hopefully, Andrea will resend his patch with necessary fixes, so after
testing it gets included in kernel.

Regards,
-- 
Posted by Zlatko Calusic           E-mail: <Zlatko.Calusic@CARNet.hr>
---------------------------------------------------------------------
	    Life would be easier if I had the source code.
--
This is a majordomo managed list.  To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org

  reply	other threads:[~1998-11-29 20:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-20  4:10 Update shared mappings Zlatko Calusic
1998-11-30 13:52 ` Stephen C. Tweedie
1998-11-30 15:19   ` Zlatko Calusic [this message]
1998-11-30 20:02   ` Andrea Arcangeli
1998-12-01 15:03     ` Stephen C. Tweedie
1998-12-01 17:48       ` Andrea Arcangeli
1998-12-02 16:21         ` Stephen C. Tweedie
1998-12-02 18:32           ` Andrea Arcangeli
1998-12-03  5:44             ` Eric W. Biederman
1998-12-03 11:56             ` Stephen C. Tweedie

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=87yaotcioa.fsf@atlas.CARNet.hr \
    --to=zlatko.calusic@carnet.hr \
    --cc=andi@zero.aec.at \
    --cc=andrea@e-mind.com \
    --cc=linux-mm@kvack.org \
    --cc=sct@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.