Kernel Newbies archive on lore.kernel.org
 help / color / 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 21:31:56 +0530
Message-ID: <CAEXHiZGx0F5Gg=GZnq1XeDK4uCqh7QaBcaxUuf90YKCTbwwb1w@mail.gmail.com> (raw)
In-Reply-To: <504953.1579439927@turing-police>

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

On Sun, 19 Jan 2020 at 6:48 PM Valdis Klētnieks <valdis.kletnieks@vt.edu>
wrote:

> On Sun, 19 Jan 2020 12:45:57 +0000, Anupam Kapoor said:
>
> > > Note that in this case, "naively" includes "not remembering to consider
> > > that the page being unmapped may have contained data we'd rather
> > > have kept by flushing the page to disk" :)
> >
> > but is it that bad ?
> >
> > before marking a page unmappable, the application has full control
> > over what it wants to do with the data, and can choose to dump it
> > to the appropriate destination.
>
> Yes, but now you're getting into more code that has to be written,
> including
> code to marshal things like binary trees into a savable format, and more
> code
> to read them back at a later time. Plus all the fun if the tree has
> hundreds of thousands
> or millions of entries, and how to deal with it if some parts of the tree
> have been
> released and saved to disk, or if the 4K page contained members of several
> different
> data structures - in other words, you probably just decided to write your
> own backing store,
> garbage collector, and virtual object manager for your heap.
>
> As I said - it's a naive approach that ends up following the 90/10 rule:
> the easy 90% of it takes the first 90% of the time to code it, and the
> difficult
> 10% takes the other 90% of the time... :)


well sure, if you try to replicate everything that exists below libc, then
there is little hope.

however if your application’s data can be serialized/deserialized, then i
_suspect_ it might not be too much of work.

for example, if i am maintaining l2 forwarding table entries then it might
be possible to have, on an average fixed number of pages representing this
cache...

—
kind regards
anupam

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

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

<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 19 Jan 2020 at 6:48 PM Valdis Klētnieks &lt;<a href="mailto:valdis.kletnieks@vt.edu">valdis.kletnieks@vt.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, 19 Jan 2020 12:45:57 +0000, Anupam Kapoor said:<br>
<br>
&gt; &gt; Note that in this case, &quot;naively&quot; includes &quot;not remembering to consider<br>
&gt; &gt; that the page being unmapped may have contained data we&#39;d rather<br>
&gt; &gt; have kept by flushing the page to disk&quot; :)<br>
&gt;<br>
&gt; but is it that bad ?<br>
&gt;<br>
&gt; before marking a page unmappable, the application has full control<br>
&gt; over what it wants to do with the data, and can choose to dump it<br>
&gt; to the appropriate destination.<br>
<br>
Yes, but now you&#39;re getting into more code that has to be written, including<br>
code to marshal things like binary trees into a savable format, and more code<br>
to read them back at a later time. Plus all the fun if the tree has hundreds of thousands<br>
or millions of entries, and how to deal with it if some parts of the tree have been<br>
released and saved to disk, or if the 4K page contained members of several different<br>
data structures - in other words, you probably just decided to write your own backing store,<br>
garbage collector, and virtual object manager for your heap.<br>
<br>
As I said - it&#39;s a naive approach that ends up following the 90/10 rule:<br>
the easy 90% of it takes the first 90% of the time to code it, and the difficult<br>
10% takes the other 90% of the time... :)</blockquote><div dir="auto"><br></div><div dir="auto">well sure, if you try to replicate everything that exists below libc, then there is little hope.</div><div dir="auto"><br></div><div dir="auto">however if your application’s data can be serialized/deserialized, then i _suspect_ it might not be too much of work. </div><div dir="auto"><br></div><div dir="auto">for example, if i am maintaining l2 forwarding table entries then it might be possible to have, on an average fixed number of pages representing this cache...</div><div dir="auto"><br></div><div dir="auto">—</div><div dir="auto">kind regards </div><div dir="auto">anupam </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font face="monospace, monospace">In the beginning was the lambda, and the lambda was with Emacs, and Emacs was the lambda. </font></div></div></div>

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

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

  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 12:31 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
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 [this message]
2020-01-19 16:59 ` Bernd Petrovitsch

Reply instructions:

You may reply publically 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='CAEXHiZGx0F5Gg=GZnq1XeDK4uCqh7QaBcaxUuf90YKCTbwwb1w@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

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git