From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28184C43387 for ; Thu, 27 Dec 2018 09:44:23 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C55F22148E for ; Thu, 27 Dec 2018 09:44:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="n3XstAmy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="aTVT6eyh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C55F22148E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1gcSD0-0004lQ-Mu; Thu, 27 Dec 2018 04:44:06 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gcSCx-0004lK-JY for kernelnewbies@kernelnewbies.org; Thu, 27 Dec 2018 04:44:03 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 466D6214E0; Thu, 27 Dec 2018 04:43:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 27 Dec 2018 04:43:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=zv9ToZrTph0jlYmjXVAaXl99du1 3c8+WMbdMusV09Qc=; b=n3XstAmyp5grUnWD4MTOFWxAZz6T5md39RjShQIp7Xi wltNGNT7AhDNOb3H6V4sFoIec/YANh9NJSrtjsRFbYJaZc61MSRxgTQbsnth3j3d WMEk5Cu2dm6TunZUV+89eaiM1c0Uxlp4/gR9u6lGUu0fjTm+//ComwOm/7v8l4/b ldwWg1bYcLzort5hHEwaT9s79BGXMvoW2wjphaDzE4QWwjTKbcZkhddyt8QcaB2n 5XoUjL51VFBz0Ct4ZRFatiI7Gzqc3bUwebkNatfAL2vKsIEHHhGL10ASyer5EOUM oV7mvqvcjJGKojZAvfo82r7mKGNi/b15oJueLQnBDVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=zv9ToZ rTph0jlYmjXVAaXl99du13c8+WMbdMusV09Qc=; b=aTVT6eyhDwZxoCOXarUHw6 eSBZ7ivmrg6daiW2ZIt3IMeFh9SpMlpBI7b8VJHDJG2FVFqLJrHX2jzpmjxbktCl l/BfPORLv9kxfdDjMEOawM2GcEoYeo4Jq30WORvhmExWzXJCRKy92ZuZQ8Gv2iBd kIMlBdmqDw2seoFFkMHZ7fct1Gu7laEXBCpESH1EeMapzV7aw4flUB8weU8kmWvG FkcIPx3XSg0ZMrzGaS3mkNIvj63UOudIDrdOj30bljnEOGNkRxH7ZHDq78lSZMeh KfKom3qfXtxQM7LsZa3VXHbZEXrKHu/rG+ki+lmEBgiW6YWD35YUTiKmA7nJQE5A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrtddvgddtjeculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujggfsehttd ertddtredvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhm qeenucfkphepkeefrdekiedrkeelrddutdejnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hgrhgvgheskhhrohgrhhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 05070E4366; Thu, 27 Dec 2018 04:43:57 -0500 (EST) Date: Thu, 27 Dec 2018 10:43:56 +0100 From: Greg KH To: Lev Olshvang Subject: Re: How to signal kernel that shared library is not in use by any process anymore ? Message-ID: <20181227094356.GE15340@kroah.com> References: <965981545402036@sas1-2b3c3045b736.qloud-c.yandex.net> <20181221153110.GA14584@kroah.com> <11849361545896862@myt5-a323eb993ef7.qloud-c.yandex.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <11849361545896862@myt5-a323eb993ef7.qloud-c.yandex.net> User-Agent: Mutt/1.11.1 (2018-12-01) Cc: linux-il , kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org 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