kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Lev Olshvang <levonshe@yandex.com>
Cc: linux-il <linux-il@cs.huji.ac.il>,
	kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: How to signal kernel that shared library is not in use by any process anymore ?
Date: Thu, 27 Dec 2018 10:43:56 +0100	[thread overview]
Message-ID: <20181227094356.GE15340@kroah.com> (raw)
In-Reply-To: <11849361545896862@myt5-a323eb993ef7.qloud-c.yandex.net>

On Thu, Dec 27, 2018 at 10:47:42AM +0300, Lev Olshvang wrote:
> Hello Greg,
> 
> Thanks for you your reply.
> It help me to better express my question
> 
> >From the application I can access /proc/self/maps and see which memory is  mapped  for my library I do not intend to use after application passes init phase.
> I would like to unmap this memory region, but since I do not have file descriptor for this so I can not do this.

Why do you care?  The loader should handle all of this for you
automatically.

> Only kernel can unmap this memory for me,
> I am willing to pass library name or address to system cal, but IMHO such system call does not exist.
> Should I rely on memory manager which will use reuse this pages because they will never page faulted back ?

Yes you should.

> I am afraid that since this is C++ lib, some pages are modified and will not be considered clean ?

That depends on your code, if it is still in use, yes, it will not be
freed, you have control over that as this is your userspace code.  There
is nothing in the kernel you can do about this, sorry, please just fix
up your application.

good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2018-12-27  9:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 14:20 How to signal kernel that shared library is not in use by any process anymore ? Lev Olshvang
2018-12-21 15:31 ` Greg KH
2018-12-27  7:47   ` Lev Olshvang
2018-12-27  9:43     ` Greg KH [this message]
2018-12-21 16:37 ` Lior Okman
2019-01-08 15:56   ` Lev Olshvang
2018-12-22  2:34 ` Bernd Petrovitsch

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=20181227094356.GE15340@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=levonshe@yandex.com \
    --cc=linux-il@cs.huji.ac.il \
    /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;
as well as URLs for NNTP newsgroup(s).