From 9c0ac8a8febc9d9037991dfebf4eb2f5affd322f Mon Sep 17 00:00:00 2001 From: mcsim Date: Sun, 6 Nov 2011 13:28:37 +0100 Subject: --- user/Maksym_Planeta.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 user/Maksym_Planeta.mdwn (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn new file mode 100644 index 00000000..64dc6e19 --- /dev/null +++ b/user/Maksym_Planeta.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2011 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!toc]] +Notes on tmpfs +============== + +#Debugging + +To debug tmpfs, using libraries from "$PWD"/lib and trace rpc: + +settrans -ca foo /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ tmpfs/tmpfs 1M -- cgit v1.2.3 From f8dc61388c5c7ea1bc2bf1984d3c85de76c8c837 Mon Sep 17 00:00:00 2001 From: mcsim Date: Sun, 6 Nov 2011 21:10:45 +0100 Subject: --- user/Maksym_Planeta.mdwn | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index 64dc6e19..3872bc68 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -9,8 +9,27 @@ is included in the section entitled [[GNU Free Documentation License|/fdl]]."]]"""]] [[!toc]] -Notes on tmpfs -============== +#Notes on tmpfs + +## mach-defpager + + : 1. On every system there is a ``default pager'' (mach-defpager). That one is responsible + for all ``anonymous memory''. For example, when you do malloc(10 MiB), and then there is memory pressure, + this 10 MiB memory region is backed by the default pager, whose job then is it to provide the backing store for this. + : This is what commonly would be known as a swap partition. + : And this is also the way tmpfs works (as I understand it). + : malloc(10 MiB) can also be mmap(MAP_ANONYMOUS, 10 MIB); that's the same, essentially. + : Now, for ext2fs or any other disk-based file system, this is different: + : The ext2fs translator implements its own backing store, namely it accesses the disk for storing + changed file content, or to read in data from disk if a new file is opened. + +## Steps + +1. Find out what causes crashes in tmpfs with defpager + +2. Write own pager + + 6.11.11 Reading/writing for files that fit in vm_page_size works #Debugging -- cgit v1.2.3 From 0bfe39bd20bbec4d2b61f46d6d6b62a98890b1e7 Mon Sep 17 00:00:00 2001 From: mcsim Date: Sun, 6 Nov 2011 22:05:05 +0100 Subject: --- user/Maksym_Planeta.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index 3872bc68..477f11ed 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -35,4 +35,5 @@ License|/fdl]]."]]"""]] To debug tmpfs, using libraries from "$PWD"/lib and trace rpc: -settrans -ca foo /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ tmpfs/tmpfs 1M + settrans -ca foo /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ tmpfs/tmpfs 1M + LD_LIBRARY_PATH="$PWD"/lib gdb tmpfs/tmpfs 698 -- cgit v1.2.3 From 19a1db1623afd94d91570b1ec3ebf2d24c7b4f08 Mon Sep 17 00:00:00 2001 From: mcsim Date: Tue, 8 Nov 2011 09:26:15 +0100 Subject: --- user/Maksym_Planeta.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index 477f11ed..e1a4ece3 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -27,9 +27,12 @@ License|/fdl]]."]]"""]] 1. Find out what causes crashes in tmpfs with defpager +http://www.gnu.org/s/hurd/hurd/translator/tmpfs/notes_various.html + 2. Write own pager 6.11.11 Reading/writing for files that fit in vm_page_size works + 7.11.11 Works for any size. #Debugging -- cgit v1.2.3 From 8efeff1b878761f8a212aa952c3057b5bd1ecdcd Mon Sep 17 00:00:00 2001 From: mcsim Date: Tue, 8 Nov 2011 10:05:51 +0100 Subject: --- user/Maksym_Planeta.mdwn | 49 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index e1a4ece3..f9436668 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -23,20 +23,67 @@ License|/fdl]]."]]"""]] : The ext2fs translator implements its own backing store, namely it accesses the disk for storing changed file content, or to read in data from disk if a new file is opened. +[[defpager|http://www.bddebian.com:8888/~hurd-web/user/Maksym_Planeta/#defpager81111]] + ## Steps 1. Find out what causes crashes in tmpfs with defpager -http://www.gnu.org/s/hurd/hurd/translator/tmpfs/notes_various.html +[[http://www.gnu.org/s/hurd/hurd/translator/tmpfs/notes_various.html]] 2. Write own pager 6.11.11 Reading/writing for files that fit in vm_page_size works + 7.11.11 Works for any size. +3. Make links work + + Symlinks behavior: [[links|http://www.bddebian.com:8888/~hurd-web/user/Maksym_Planeta/#links81111]] + #Debugging To debug tmpfs, using libraries from "$PWD"/lib and trace rpc: settrans -ca foo /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ tmpfs/tmpfs 1M LD_LIBRARY_PATH="$PWD"/lib gdb tmpfs/tmpfs 698 + +#Conversations + +## 8.11.11 + +### links + (10:29:11) braunr: mcsim: ln -s foo/bar foo/baz means the link name is baz in the foo directory, + and its target (relative to its directory) is foo/bar (which would mean /tmp/foo/foo/bar in canonical form) + (10:29:42) braunr: youpi: tschwinge: what did ludovic achieve ? + (10:30:06) tschwinge: mcsim: As Richard says, symlink targets are always relative to the directory they're contained in. + (10:30:51) tschwinge: braunr: This Hydra/Nix (I wtill mix it all up) thing is kind of a package managing system. + (10:31:17) tschwinge: He has written scripts for bootstrapping a Hurd toolchain. + (10:31:26) braunr: oh ok + (10:31:27) mcsim: so, if I want to create link in cd, first I need to cd there? + (10:31:28) tschwinge: And then uses that to build a whole bootable image. + (10:31:36) mcsim: in foo* + (10:31:36) braunr: mcsim: just provide the right paths + (10:32:11) braunr: $ touch foo/bar + (10:32:14) braunr: $ ln -s bar foo/baz + (10:32:32) braunr: bar + (10:32:35) braunr: baz -> bar + +### defpager + (10:36:14) mcsim: who else uses defpager besides tmpfs and kernel? + (10:36:27) braunr: normally, nothing directly + (10:37:04) mcsim: than why tmpfs should use defpager? + (10:37:22) braunr: it's its backend + (10:37:28) braunr: backign store rather + (10:37:38) braunr: the backing store of most file systems are partitions + (10:37:44) braunr: tmpfs has none, it uses the swap space + (10:39:31) mcsim: if we allocate memory for tmpfs using vm_allocate, will it be able to use swap partition? + (10:39:56) braunr: it should + (10:40:27) braunr: vm_allocate just maps anonymous memory + (10:41:27) braunr: anonymous memory uses swap space as its backing store too + (10:43:47) braunr: but be aware that this part of the vm system is known to have deficiencies + (10:44:14) braunr: which is why all mach based implementations have rewritten their default pager + (10:44:41) youpi: ArneBab: the intro is already in in my qemu image + (10:45:11) mcsim: what kind of deficiencies? + (10:45:16) braunr: bugs + (10:45:39) braunr: and design issues, making anonymous memory fragmentation horrible -- cgit v1.2.3 From 04f195d9f689c55165323eec55d5eea9d78c7614 Mon Sep 17 00:00:00 2001 From: mcsim Date: Tue, 8 Nov 2011 14:59:37 +0100 Subject: --- user/Maksym_Planeta.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index f9436668..a72c277b 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -87,3 +87,14 @@ To debug tmpfs, using libraries from "$PWD"/lib and trace rpc: (10:45:11) mcsim: what kind of deficiencies? (10:45:16) braunr: bugs (10:45:39) braunr: and design issues, making anonymous memory fragmentation horrible + + ... + + (15:23:33) antrik: mcsim: vm_allocate doesn't return a memory object; so it can't be passed to clients for mmap() + (15:50:37) mcsim: antrik: I use vm_allocate in pager_read_page + (15:54:43) antrik: mcsim: well, that means that you have to actually implement a pager yourself + (15:56:10) antrik: also, when the kernel asks the pager to write back some pages, it expects the memory to become free. + if you are "paging" to ordinary anonymous memory, this doesn't happen; so I expect it to have a very bad effect + on system performance + (15:56:54) antrik: both can be avoided by just passing a real anonymous memory object, i.e. one provided by the defpager + (15:57:07) antrik: only problem is that the current defpager implementation can't really handle that... -- cgit v1.2.3 From 2fc47a0b3091bb62a206cfdc7839bda4c5fe13b3 Mon Sep 17 00:00:00 2001 From: mcsim Date: Tue, 8 Nov 2011 19:22:42 +0100 Subject: --- user/Maksym_Planeta.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index a72c277b..707507a7 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -48,6 +48,12 @@ To debug tmpfs, using libraries from "$PWD"/lib and trace rpc: settrans -ca foo /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ tmpfs/tmpfs 1M LD_LIBRARY_PATH="$PWD"/lib gdb tmpfs/tmpfs 698 +For debugging ext2fs: + settrans --create --active ramdisk0 /hurd/storeio -T copy zero:32M && \ + /sbin/mkfs.ext2 -F -b 4096 ramdisk0 && \ + settrans --active --orphan ramdisk0 /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ \ + ext2fs/ext2fs.static ramdisk0 + #Conversations ## 8.11.11 -- cgit v1.2.3 From 9b8d20762549403e542d44008e0d28ba76901527 Mon Sep 17 00:00:00 2001 From: mcsim Date: Tue, 8 Nov 2011 20:41:00 +0100 Subject: --- user/Maksym_Planeta.mdwn | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index 707507a7..6f9bf3ec 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -13,16 +13,6 @@ License|/fdl]]."]]"""]] ## mach-defpager - : 1. On every system there is a ``default pager'' (mach-defpager). That one is responsible - for all ``anonymous memory''. For example, when you do malloc(10 MiB), and then there is memory pressure, - this 10 MiB memory region is backed by the default pager, whose job then is it to provide the backing store for this. - : This is what commonly would be known as a swap partition. - : And this is also the way tmpfs works (as I understand it). - : malloc(10 MiB) can also be mmap(MAP_ANONYMOUS, 10 MIB); that's the same, essentially. - : Now, for ext2fs or any other disk-based file system, this is different: - : The ext2fs translator implements its own backing store, namely it accesses the disk for storing - changed file content, or to read in data from disk if a new file is opened. - [[defpager|http://www.bddebian.com:8888/~hurd-web/user/Maksym_Planeta/#defpager81111]] ## Steps @@ -41,6 +31,21 @@ License|/fdl]]."]]"""]] Symlinks behavior: [[links|http://www.bddebian.com:8888/~hurd-web/user/Maksym_Planeta/#links81111]] + 8.11.11 Symlinks work. + +4. Control of used space by tmpfs. + + TODO: Make tmpfs use not more space than it was allowed. + +5. Thread safety. + + TODO: During execution tmpfs hangs in random places. The most possible is variant is deadlocks, + because nothing was undertaken for thread safety. + +6. After sometime of inactivity tmpfs exits. + + TODO: Find out why and correct this. + #Debugging To debug tmpfs, using libraries from "$PWD"/lib and trace rpc: @@ -49,6 +54,7 @@ To debug tmpfs, using libraries from "$PWD"/lib and trace rpc: LD_LIBRARY_PATH="$PWD"/lib gdb tmpfs/tmpfs 698 For debugging ext2fs: + settrans --create --active ramdisk0 /hurd/storeio -T copy zero:32M && \ /sbin/mkfs.ext2 -F -b 4096 ramdisk0 && \ settrans --active --orphan ramdisk0 /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ \ @@ -76,6 +82,20 @@ For debugging ext2fs: (10:32:35) braunr: baz -> bar ### defpager + + earlier: + : 1. On every system there is a ``default pager'' (mach-defpager). That one is responsible + for all ``anonymous memory''. For example, when you do malloc(10 MiB), and then there is memory pressure, + this 10 MiB memory region is backed by the default pager, whose job then is it to provide the backing store for this. + : This is what commonly would be known as a swap partition. + : And this is also the way tmpfs works (as I understand it). + : malloc(10 MiB) can also be mmap(MAP_ANONYMOUS, 10 MIB); that's the same, essentially. + : Now, for ext2fs or any other disk-based file system, this is different: + : The ext2fs translator implements its own backing store, namely it accesses the disk for storing + changed file content, or to read in data from disk if a new file is opened. + + ... + (10:36:14) mcsim: who else uses defpager besides tmpfs and kernel? (10:36:27) braunr: normally, nothing directly (10:37:04) mcsim: than why tmpfs should use defpager? @@ -89,7 +109,6 @@ For debugging ext2fs: (10:41:27) braunr: anonymous memory uses swap space as its backing store too (10:43:47) braunr: but be aware that this part of the vm system is known to have deficiencies (10:44:14) braunr: which is why all mach based implementations have rewritten their default pager - (10:44:41) youpi: ArneBab: the intro is already in in my qemu image (10:45:11) mcsim: what kind of deficiencies? (10:45:16) braunr: bugs (10:45:39) braunr: and design issues, making anonymous memory fragmentation horrible -- cgit v1.2.3 From 7f37209273b41dcebd92d02fce63a21ee8a4c0c4 Mon Sep 17 00:00:00 2001 From: mcsim Date: Thu, 10 Nov 2011 20:07:21 +0100 Subject: --- user/Maksym_Planeta.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index 6f9bf3ec..0eece92d 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -51,7 +51,7 @@ License|/fdl]]."]]"""]] To debug tmpfs, using libraries from "$PWD"/lib and trace rpc: settrans -ca foo /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ tmpfs/tmpfs 1M - LD_LIBRARY_PATH="$PWD"/lib gdb tmpfs/tmpfs 698 + LD_LIBRARY_PATH="$PWD"/lib gdb tmpfs/tmpfs `pidof tmpfs` For debugging ext2fs: -- cgit v1.2.3 From 3984c2a6245a35ac7f9255ea244e2784bb47551e Mon Sep 17 00:00:00 2001 From: mcsim Date: Thu, 10 Nov 2011 22:23:06 +0100 Subject: --- user/Maksym_Planeta.mdwn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index 0eece92d..34a42f43 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -60,6 +60,11 @@ For debugging ext2fs: settrans --active --orphan ramdisk0 /usr/bin/env LD_LIBRARY_PATH="$PWD"/lib utils/rpctrace -I /usr/share/msgids/ \ ext2fs/ext2fs.static ramdisk0 +#Questions + +1. What are sequence numbers? What are they used for? +2. Is there any way to debug mach-defpager? When I set breakpoint to any function in it, pager never breaks. + #Conversations ## 8.11.11 -- cgit v1.2.3 From 232748f5b3c41f39f2b930a53c232f837203dc8b Mon Sep 17 00:00:00 2001 From: mcsim Date: Thu, 10 Nov 2011 22:33:47 +0100 Subject: --- user/Maksym_Planeta.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index 34a42f43..a62ad4ff 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -15,6 +15,8 @@ License|/fdl]]."]]"""]] [[defpager|http://www.bddebian.com:8888/~hurd-web/user/Maksym_Planeta/#defpager81111]] +[[http://www.mail-archive.com/bug-hurd@gnu.org/msg18859.html]] + ## Steps 1. Find out what causes crashes in tmpfs with defpager -- cgit v1.2.3 From b6767d264036fb95465e80948dffcac2721e72df Mon Sep 17 00:00:00 2001 From: musial Date: Fri, 11 Nov 2011 15:20:18 +0100 Subject: --- user/musial.mdwn | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 user/musial.mdwn (limited to 'user') diff --git a/user/musial.mdwn b/user/musial.mdwn new file mode 100644 index 00000000..68669f84 --- /dev/null +++ b/user/musial.mdwn @@ -0,0 +1,24 @@ +[[!meta copyright="Copyright © 2011 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +HERE STARTS YOUR NEW CONTENT -- remove everything from here on, including this +line. + +By creating this page, you agree to assign copyright for your contribution to +the Free Software Foundation, . The Free Software +Foundation promises to always use a free documentation license (as per our +criteria of free documentation) when publishing your contribution. We grant +you back all your rights under copyright, including the rights to copy, modify, +and redistribute your contributions. + +We're requiring these copyright assignments, so that we'll easily be able to +include your contributions in official GNU documentation, such as the GNU Hurd +Reference Manual, etc. Send email to if there are +questions. -- cgit v1.2.3 From 062f8b1f8f488f68a1138c7f3af65582c3849536 Mon Sep 17 00:00:00 2001 From: musial Date: Fri, 11 Nov 2011 15:24:20 +0100 Subject: --- user/musial.mdwn | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'user') diff --git a/user/musial.mdwn b/user/musial.mdwn index 68669f84..9775f67f 100644 --- a/user/musial.mdwn +++ b/user/musial.mdwn @@ -8,17 +8,11 @@ Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled [[GNU Free Documentation License|/fdl]]."]]"""]] -HERE STARTS YOUR NEW CONTENT -- remove everything from here on, including this -line. +Robert Musial -By creating this page, you agree to assign copyright for your contribution to -the Free Software Foundation, . The Free Software -Foundation promises to always use a free documentation license (as per our -criteria of free documentation) when publishing your contribution. We grant -you back all your rights under copyright, including the rights to copy, modify, -and redistribute your contributions. +Cleveland, OH -We're requiring these copyright assignments, so that we'll easily be able to -include your contributions in official GNU documentation, such as the GNU Hurd -Reference Manual, etc. Send email to if there are -questions. +musial [at] gnu [dot] org + +http://musial.sdf.org +http://github.com/musial -- cgit v1.2.3 From 55fdf0e148448b59bf26449d62dce269da72e250 Mon Sep 17 00:00:00 2001 From: musial Date: Fri, 11 Nov 2011 16:20:43 +0100 Subject: --- user/musial.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'user') diff --git a/user/musial.mdwn b/user/musial.mdwn index 9775f67f..24a526be 100644 --- a/user/musial.mdwn +++ b/user/musial.mdwn @@ -15,4 +15,5 @@ Cleveland, OH musial [at] gnu [dot] org http://musial.sdf.org + http://github.com/musial -- cgit v1.2.3 From bef3b8049a8bb5266b6d703e52f225599dead5b8 Mon Sep 17 00:00:00 2001 From: mcsim Date: Fri, 11 Nov 2011 22:05:08 +0100 Subject: --- user/Maksym_Planeta.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user') diff --git a/user/Maksym_Planeta.mdwn b/user/Maksym_Planeta.mdwn index a62ad4ff..c44a4fcb 100644 --- a/user/Maksym_Planeta.mdwn +++ b/user/Maksym_Planeta.mdwn @@ -23,6 +23,9 @@ License|/fdl]]."]]"""]] [[http://www.gnu.org/s/hurd/hurd/translator/tmpfs/notes_various.html]] +TODO: Consider deleting of parameter "port" in function mach-defpager/default_pager.c:pager_port_list_insert +since this parameter is unused + 2. Write own pager 6.11.11 Reading/writing for files that fit in vm_page_size works -- cgit v1.2.3