All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anupam Kapoor <anupam.kapoor@gmail.com>
To: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
Cc: Sumit Kumar <sumit686215@gmail.com>,
	kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: transfer physical memory page to swap disk
Date: Sun, 19 Jan 2020 10:55:44 +0000	[thread overview]
Message-ID: <CAEXHiZEBpf2KKFQ04wUkQqoW809aSq+2SMfuLfvEkJswzBnGZQ@mail.gmail.com> (raw)
In-Reply-To: <412530.1579360214@turing-police>


[-- Attachment #1.1: Type: text/plain, Size: 2048 bytes --]

On Wed, 15 Jan 2020 18:23:05 +0530, Anupam Kapoor said:
>> On Wed, 15 Jan 2020 at 6:02 PM Sumit Kumar <sumit686215@gmail.com> wrote:
>>> Does C/C++ provide any API / system call that enables user to force the
>>> application to transfer some its physical pages to swap disk ? If so,
is it
>>> also possible to obtain the least used page using some API ?

>> would madvise not serve your needs ?

> There's this word "force" in the question.

> The problem is that madvise() is *advice* to the kernel, not a strict
> guarantee.  There's a difference between "If you need to move pages
> to disk, consider these pages first" and "Move them to disk now, whether
> you really wanted to or not".

ofcourse (afaik) there is no way for the application to force the
*kernel* to do something like this.

but if _all_ that is required is randomly unmapping some marked
application pages, _that_ can be naively 'done' by the application
itself :)

for example, have a list of unmappable pages and an unmapper thread
which does the unmapping for you (picking any element in the list
at random)

--
kind regards
anupam

In the beginning was the lambda, and the lambda was with Emacs, and Emacs
was the lambda.


On Sat, Jan 18, 2020 at 3:10 PM Valdis Klētnieks <valdis.kletnieks@vt.edu>
wrote:

> On Wed, 15 Jan 2020 18:23:05 +0530, Anupam Kapoor said:
> > On Wed, 15 Jan 2020 at 6:02 PM Sumit Kumar <sumit686215@gmail.com>
> wrote:
> > > Does C/C++ provide any API / system call that enables user to force the
> > > application to transfer some its physical pages to swap disk ? If so,
> is it
> > > also possible to obtain the least used page using some API ?
> > would madvise not serve your needs ?
>
> There's this word "force" in the question.
>
> The problem is that madvise() is *advice* to the kernel, not a strict
> guarantee.  There's a difference between "If you need to move pages
> to disk, consider these pages first" and "Move them to disk now, whether
> you really wanted to or not".
>
>

[-- Attachment #1.2: Type: text/html, Size: 4081 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

  parent reply	other threads:[~2020-01-19 10:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 12:31 transfer physical memory page to swap disk Sumit Kumar
2020-01-15 12:42 ` aleix sanchis ramírez
2020-01-15 12:53 ` Anupam Kapoor
2020-01-18 15:10   ` Valdis Klētnieks
2020-01-19 10:01     ` Sumit Kumar
2020-01-19 10:55     ` Anupam Kapoor [this message]
2020-01-19 11:14       ` Valdis Klētnieks
2020-01-19 12:45         ` Anupam Kapoor
2020-01-19 13:18           ` Valdis Klētnieks
2020-01-19 16:01             ` Anupam Kapoor
2020-01-19 16:59 ` 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=CAEXHiZEBpf2KKFQ04wUkQqoW809aSq+2SMfuLfvEkJswzBnGZQ@mail.gmail.com \
    --to=anupam.kapoor@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=sumit686215@gmail.com \
    --cc=valdis.kletnieks@vt.edu \
    /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.