From: "David S. Miller" <davem@redhat.com>
To: ebiederm@xmission.com
Cc: torvalds@transmeta.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: 2.4.14 + Bug in swap_out.
Date: Tue, 20 Nov 2001 22:29:20 -0800 (PST) [thread overview]
Message-ID: <20011120.222920.51691672.davem@redhat.com> (raw)
In-Reply-To: <m1vgg41x3x.fsf@frodo.biederman.org>
And looking in fork.c mmput under with right circumstances becomes.
kmem_cache_free(mm_cachep, (mm)))
So it appears that there is nothing that keeps the mm_struct that
swap_mm points to as being valid.
I do not agree with your analysis.
If we hold the mmlist lock and we find the mm on the swap mm list, by
definition it must have a non-zero user count already. (put an assert
there if you don't believe me :-)
Only when the user count drops to zero will mmput() free up the mm.
It simultaneously grabs the mmlist lock when it drops the user count
to zero, this is how it synchronizes with the rest of the world.
Perhaps you aren't noticing that it is using "atomic_dec_and_lock()"
or you don't understand how that primitive works?
We increment the mm user count before dropping the mmlist lock in the
swapper, so even if the user does a mmput() we still hold a reference.
ie. mmput won't put the user count to zero.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/
next prev parent reply other threads:[~2001-11-21 6:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-21 6:01 Eric W. Biederman
2001-11-21 6:29 ` David S. Miller [this message]
2001-11-21 6:37 ` Eric W. Biederman
2001-11-21 12:17 ` Rik van Riel
2001-11-21 13:31 ` Eric W. Biederman
2001-11-21 14:20 ` Rik van Riel
2001-11-21 14:21 ` Eric W. Biederman
2001-11-21 12:13 ` Rik van Riel
[not found] <Pine.LNX.4.21.0111211515210.1357-100000@localhost.localdomain>
2001-11-21 15:39 ` Rik van Riel
[not found] <Pine.LNX.4.21.0111211558160.1394-100000@localhost.localdomain>
2001-11-21 16:26 ` Eric W. Biederman
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=20011120.222920.51691672.davem@redhat.com \
--to=davem@redhat.com \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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