All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane <stephane.tessier@netinsight.se>
To: linux-kernel@vger.kernel.org
Cc: Stephane Tessier <stephane.tessier@netinsight.se>
Subject: exit_mmap
Date: Thu, 27 Mar 2003 15:46:31 +0100	[thread overview]
Message-ID: <3E830EC7.651EB9CE@netinsight.se> (raw)

I have a question about mmap and the close operation of a
vm_area_struct.
Is there a reason why in exit_mmap, when a process dies unexpectedly,
the vm_ops->close is called before zap_page_range is called?

The problem is that if you have allocated one or several kernel pages
for a vm_area_struct, you can not free them in the vm_ops->close
operation since the count field of the pages is not 0 because they are
still mapped. The count will be cleared when zap_page_range is called.

This means that exit_mmap calls vm_ops->close and zap_page_range in the
reverse order of a normal execution of the process, that is when the
process unmap the area before dying.

It would be more deterministic and simple if vm_ops->close was always
called when all the pages of the area was unmapped.

PS: please can you CC'ed the answer to stephane.tessier@netinsight.se
-- 
Stephane Tessier
Net Insight AB          stephane.tessier@netinsight.se
Västberga Allé 9        http://www.netinsight.se
SE-126 30 Hägersten     phone:+46-8-685 04 60
Sweden                  fax:  +46-8-685 04 20

             reply	other threads:[~2003-03-27 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-27 14:46 Stephane [this message]
2003-03-27 15:23 ` exit_mmap Stephane

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=3E830EC7.651EB9CE@netinsight.se \
    --to=stephane.tessier@netinsight.se \
    --cc=linux-kernel@vger.kernel.org \
    /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.