mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ernie Petrides <petrides@redhat.com>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: Mika Penttila <mika.penttila@kolumbus.fi>,
	Dave Kleikamp <shaggy@austin.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] BUG() in exec_mmap()
Date: Thu, 09 Oct 2003 21:01:11 -0400	[thread overview]
Message-ID: <200310100101.h9A11BeD011819@pasta.boston.redhat.com> (raw)
In-Reply-To: Your message of "Thu, 09 Oct 2003 17:47:19 -0300."

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1171 bytes --]

On Thursday, 9-Oct-2003 at 17:47 -0300, Marcelo Tosatti wrote:

> On Thu, 9 Oct 2003, Mika Penttilä wrote:
>
> > Hmm.. you still need to mmput(old_mm) etc, just remove the mm_users == 1
> > optimization from the beginning of exec_mmap, so this patch is wrong!
>
> Right. Ill fix it up by hand.

Mika is correct that the exit_mmap(old_mm) still needs to happen on the
last use of the "mm_struct".  But whether it's called directly from
exec_mmap() or indirectly from mmput() still needs to depend on the
value of "mm_users".

The original logic avoided the mmdrop(active_mm) call if there was an
old_mm, so I'd infer that the mm_struct reference count is not bumped
twice for both references from the task_struct (mm and active_mm).  So
the patch would need to be reworked to avoid the double decrement, too.

Sorry I missed the discussion on the original changes.  Was there a
race condition with another cpu gaining a reference in proc_pid_status()
or access_process_vm() or something like that?  Is it possible to just
use down_read(&old_mm->mmap_sem) and up_read(&old_mm->mmap_sem) inside
exec_mmap() around the optimized call to exit_mmap() instead?

Cheers.  -ernie

             reply	other threads:[~2003-10-10  0:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-10  1:01 Ernie Petrides [this message]
2003-10-10 10:57 ` Marcelo Tosatti
  -- strict thread matches above, loose matches on Subject: below --
2003-10-10 11:18 Ernie Petrides
2003-10-10  1:24 Ernie Petrides
2003-10-09 20:10 Dave Kleikamp
2003-10-09 20:19 ` Marcelo Tosatti
2003-10-09 20:43   ` Mika Penttilä
2003-10-09 20:47     ` Marcelo Tosatti

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=200310100101.h9A11BeD011819@pasta.boston.redhat.com \
    --to=petrides@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=mika.penttila@kolumbus.fi \
    --cc=shaggy@austin.ibm.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

all inboxes | Powered by JetHome®