From: Andrea Arcangeli <andrea@suse.de>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: mmap-rb-7 [was Re: /proc/<n>/maps growing...]
Date: Mon, 3 Sep 2001 19:20:36 +0200 [thread overview]
Message-ID: <20010903192036.W699@athlon.random> (raw)
In-Reply-To: <000f01c1349b$263fb890$010411ac@local>
In-Reply-To: <000f01c1349b$263fb890$010411ac@local>; from manfred@colorfullife.com on Mon, Sep 03, 2001 at 07:09:03PM +0200
On Mon, Sep 03, 2001 at 07:09:03PM +0200, Manfred Spraul wrote:
> > +/*
> > + * vma->vm_start/vm_end cannot change under us because the caller is
> required
> > + * to hold the mmap_sem in write mode. We need to get the spinlock
> only
> > + * before relocating the vma range ourself.
> > + */
>
> There is one exception to that rule: a growable stack grows with
> mmap_sem only acquired in read mode. vm_start can change on platforms
expand_stack was broken. I fixed that, see the other patch posted to l-k
today. growsup faults must grab the write semaphore too of course.
> > - lock_vma_mappings(vma);
> > - spin_lock(&vma->vm_mm->page_table_lock);
> > vma->vm_pgoff += (end - vma->vm_start) >> PAGE_SHIFT;
> > + lock_vma_mappings(vma);
> > + spin_lock(&mm->page_table_lock);
> > vma->vm_start = end;
>
> Could be wrong with concurrent stack faults.
even if the growsdown faults would acquire only the read seamphore that
change would still be obviously right because there (madvise) we hold
the write semaphore, and even in the buggy 2.4.10pre4 the stack faults
at least grab the read semaphore so they cannot race.
Andrea
next prev parent reply other threads:[~2001-09-03 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-03 17:09 mmap-rb-7 [was Re: /proc/<n>/maps growing...] Manfred Spraul
2001-09-03 17:20 ` Andrea Arcangeli [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-08-06 13:29 /proc/<n>/maps growing Andrea Arcangeli
2001-08-06 17:27 ` Linus Torvalds
2001-09-03 15:44 ` mmap-rb-7 [was Re: /proc/<n>/maps growing...] Andrea Arcangeli
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=20010903192036.W699@athlon.random \
--to=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=torvalds@transmeta.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