[PATCH] libports: fix notify_port_t receiver lookups

2014-04-07 Thread Justus Winter
-mutate.h b/devnode/mig-mutate.h new file mode 100644 index 000..f692236 --- /dev/null +++ b/devnode/mig-mutate.h @@ -0,0 +1,25 @@ +/* + Copyright (C) 2014 Free Software Foundation, Inc. + Written by Justus Winter. + + This file is part of the GNU Hurd. + + The GNU Hurd is free software

Please merge the random translator into the Hurd repository

2014-04-07 Thread Justus Winter
Dear maintainer :) please merge the random translator (found in [0]) into the main Hurd repository. 0: git://git.sv.gnu.org/hurd/incubator.git, branch random Rationale: The random translator provides /dev/{,u}random that provide cryptographically secure random numbers. A lot of software depend

Add a new exec_exec_file_name RPC

2014-04-07 Thread Justus Winter
Hi :) this is a rebased patch series created by Emilio Pozuelo Monfort. I've slightly amended the first patch. This patch series makes the fakeroot translator usable, more precisely the execution of interpreted scripts within the fakeroot environment. Both the patch series and my amendment have r

[PATCH 1/3] Add a new exec_exec_file_name RPC

2014-04-07 Thread Justus Winter
d-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- doc/hurd.texi | 8 ++--- exec/exec.c | 48 ++--- exec/hashexec.c | 95 + exec/priv.h | 4 ++- hurd/exec.defs | 19 ++-- 5 fi

[PATCH 3/3] Use the new _hurd_exec_file_name function

2014-04-07 Thread Justus Winter
From: Emilio Pozuelo Monfort * configure.in: Check for _hurd_exec_file_name. * utils/fakeauth.c: Call _hurd_exec_file_name instead of _hurd_exec if it's available. * utils/rpctrace.c: Likewise. * utils/shd.c: Likewise. Signed-off-by: Jeremie Koenig Signed-off-by: Justus Winter

[PATCH 2/3] Add a file_exec_file_name RPC

2014-04-07 Thread Justus Winter
-by: Jeremie Koenig Signed-off-by: Justus Winter <4win...@informatik.uni-hamburg.de> --- TODO | 2 +- doc/hurd.texi | 16 exec/hashexec.c | 32 ++- hurd/fs.defs | 28 +++--

Re: Add a new exec_exec_file_name RPC

2014-04-08 Thread Justus Winter
Hi, Quoting Samuel Thibault (2014-04-08 02:18:13) > Well, I'm not the one to be convinced: it's only Roland which can ack > the glibc part, and thus the whole idea of the RPC addition. One "just" > needs to explain him why we really need it. I thought that this patch series was necessary for fak

Re: Add a new exec_exec_file_name RPC

2014-04-08 Thread Justus Winter
Quoting Samuel Thibault (2014-04-08 13:50:28) > Justus Winter, le Tue 08 Apr 2014 13:46:26 +0200, a écrit : > > Quoting Samuel Thibault (2014-04-08 02:18:13) > > > Well, I'm not the one to be convinced: it's only Roland which can ack > > > the glibc par

[PATCH] include: make the device_t types translation functions mutable

2014-04-09 Thread Justus Winter
Make the intran, outtran and destructor functions mutable using preprocessor macros. Make it possible to inject imports using the DEVICE_IMPORTS macro. This way, userspace servers can provide their own translation functions. * include/device/device_types.defs: Honor DEVICE_IMPORTS. (device_t): M

[PATCH 1/2] hurd: add a new type interrupt_t for the interrupt protocol

2014-04-09 Thread Justus Winter
* hurd/hurd_types.defs (interrupt_t): New type. * hurd/hurd_types.h (interrupt_t): Likewise. * hurd/interrupt.defs (interrupt_operation): Use the new type. --- hurd/hurd_types.defs | 12 hurd/hurd_types.h| 1 + hurd/interrupt.defs | 6 +- 3 files changed, 18 insertions(+),

[PATCH 2/2] libports: fix receiver lookup

2014-04-09 Thread Justus Winter
* libports/interrupt-operation.c (ports_S_interrupt_operation): Fix receiver lookup. * libports/mig-mutate.h: Add mutators. * libports/ports.h: Remove superfluous declarations. --- libports/interrupt-operation.c | 4 +--- libports/mig-mutate.h | 7 +++ libports/ports.h |

[PATCH] eth-filter: remove invalid port deallocation

2014-04-09 Thread Justus Winter
* eth-filter/filter.c (ds_device_open): Remove invalid port deallocation. --- eth-filter/filter.c | 1 - 1 file changed, 1 deletion(-) diff --git a/eth-filter/filter.c b/eth-filter/filter.c index f3d58dd..04bf7b1 100644 --- a/eth-filter/filter.c +++ b/eth-filter/filter.c @@ -348,7 +348,6 @@ ds_de

Re: problem on shut-down

2014-04-10 Thread Justus Winter
Quoting Riccardo Mottola (2014-04-09 23:35:16) > Hi, > > I was able to investigate this more. I have the inconveninece that at > every HURD shtudown (even if graceful) I lookse my date&time in the bios... > > Justus Winter wrote: > >> Sometimes bugs can't be

[PATCH] include: fix the definition of device_open

2014-04-11 Thread Justus Winter
Previously, every userspace server implementing the device protocol filtered the device definitions to replace the device_t type with mach_port_send_t to make the device argument of device_open polymorphic. Rather than doing that, which makes it impossible to use translation functions, fix the def

[PATCH] boot: remove the ourdevice hack

2014-04-11 Thread Justus Winter
Previously, the device definitions were filtered using sed to replace the device_t type with mach_port_send_t to make the device argument of device_open polymorphic. Rather than doing that, which makes it impossible to use translation functions, the definition of device_open has been amended. * b

Cleaning up dde for the Hurd (was: Hurd support in libpcap)

2014-04-11 Thread Justus Winter
Hi :) Quoting Richard Braun (2014-04-11 11:42:47) > On Thu, Apr 10, 2014 at 02:01:17AM +0200, Richard Braun wrote: > > The first issue that can be noticed is that, despite the filter being > > filled with both NETF_IN and NETF_OUT, only incoming packets seem > > to be captured. This is probably a

[PATCH 4/6] libmachdev: remove unused function

2014-04-11 Thread Justus Winter
* libmachdev/ds_routines.c (mach_device_reference): Remove unused function. --- libmachdev/ds_routines.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index a1fb058..66e5756 100644 --- a/libmachdev/ds_routines.c +++ b/libmachdev/ds_rou

[PATCH 2/6] eth-multiplexer: fix receiver lookups

2014-04-11 Thread Justus Winter
ev); return err; } diff --git a/eth-multiplexer/mig-decls.h b/eth-multiplexer/mig-decls.h new file mode 100644 index 000..a68e2ec --- /dev/null +++ b/eth-multiplexer/mig-decls.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2014 Free Software Foundation, Inc. + Written by Justus Winter. + + Th

[PATCH 1/6] eth-filter: fix receiver lookups

2014-04-11 Thread Justus Winter
ON; proxy = user->proxy; - ports_port_deref (user); if (proxy->device == NULL) { diff --git a/eth-filter/mig-decls.h b/eth-filter/mig-decls.h new file mode 100644 index 000..0bb29a6 --- /dev/null +++ b/eth-filter/mig-decls.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2014 Free

dde cleanups

2014-04-11 Thread Justus Winter
Here are some patches for the dde stuff currently residing in the incubator repo. Justus

[PATCH 6/6] libmachdev: fix function declaration

2014-04-11 Thread Justus Winter
* libmachdev/ds_routines.c: Include mig-generated device_S.h. (ds_device_intr_register): Fix function declaration. --- libmachdev/ds_routines.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c index e415cdb..bbf5488 100644 --

[PATCH 5/6] libmachdev: fix receiver lookups

2014-04-11 Thread Justus Winter
CH_PORT_NULL) + if (device == NULL) return D_NO_SUCH_DEVICE; return D_INVALID_OPERATION; diff --git a/libmachdev/mig-decls.h b/libmachdev/mig-decls.h new file mode 100644 index 000..1d137cd --- /dev/null +++ b/libmachdev/mig-decls.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2014

[PATCH 3/6] libmachdev: avoid doing pointer arithmetic to get the port_info

2014-04-11 Thread Justus Winter
Previously, mach_convert_port_to_device would return a pointer to struct emul_device, which is embedded in struct mach_device. In order to get to the port_info structure which is right before that, device_to_pi would subtract offsetof (struct mach_device, dev) from the pointer. Avoid that by maki

[PATCH 2/8] devnode: fix argp_program_version, remove argp_program_bug_address

2014-04-11 Thread Justus Winter
* devnode/devnode.c: Fix argp_program_version, remove argp_program_bug_address. --- devnode/devnode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devnode/devnode.c b/devnode/devnode.c index 101675d..dbbd40e 100644 --- a/devnode/devnode.c +++ b/devnode/devnode.c @@ -35,

[PATCH 1/8] devnode: remove the ourdevice hack

2014-04-11 Thread Justus Winter
Previously, the device definitions were filtered using sed to replace the device_t type with mach_port_send_t to make the device argument of device_open polymorphic. Rather than doing that, which makes it impossible to use translation functions, the definition of device_open has been amended. * d

[PATCH 4/8] eth-multiplexer: fix argp_program_version, remove argp_program_bug_address

2014-04-11 Thread Justus Winter
* eth-multiplexer/multiplexer.c: Fix argp_program_version, remove argp_program_bug_address. --- eth-multiplexer/multiplexer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eth-multiplexer/multiplexer.c b/eth-multiplexer/multiplexer.c index c36ab78..a133f45 100644 --- a/e

[PATCH 3/8] eth-filter: fix argp_program_version, remove argp_program_bug_address

2014-04-11 Thread Justus Winter
* eth-filter/filter.c: Fix argp_program_version, remove argp_program_bug_address. --- eth-filter/filter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eth-filter/filter.c b/eth-filter/filter.c index 8c76c7b..7a25c10 100644 --- a/eth-filter/filter.c +++ b/eth-filter/filt

[PATCH 7/8] eth-filter: improve the demuxer function

2014-04-11 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 8/8] eth-multiplexer: improve the demuxer function

2014-04-11 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 6/8] libmachdev: improve the demuxer functions

2014-04-11 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

[PATCH 5/8] devnode: improve the demuxer function

2014-04-11 Thread Justus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need t

Re: [PATCH] include: fix the definition of device_open

2014-04-11 Thread Justus Winter
Quoting Samuel Thibault (2014-04-11 22:27:09) > Justus Winter, le Fri 11 Apr 2014 09:32:30 +0200, a écrit : > > Previously, every userspace server implementing the device protocol > > filtered the device definitions to replace the device_t type with > > mach_port_send_t to mak

Re: [PATCH] include: fix the definition of device_open

2014-04-12 Thread Justus Winter
Quoting Justus Winter (2014-04-11 23:11:59) > Quoting Samuel Thibault (2014-04-11 22:27:09) > > Justus Winter, le Fri 11 Apr 2014 09:32:30 +0200, a écrit : > > > Previously, every userspace server implementing the device protocol > > > filtered the device definitions t

Re: [PATCH 1/6] eth-filter: fix receiver lookups

2014-04-12 Thread Justus Winter
Quoting Samuel Thibault (2014-04-11 22:25:26) > Justus Winter, le Fri 11 Apr 2014 15:34:09 +0200, a écrit : > > -DIST_FILES = ourdevice.defs notify.defs > > +DIST_FILES = device.defs notify.defs > > Mmm, why keeping device.defs? Shouldn't we be using the one from >

[PATCH] console-client: drop DIST_FILES from Makefile

2014-04-12 Thread Justus Winter
Since 50bfb9acf98d5f4c0c5948cc28285e990b40b659 git is used to produce dist tarballs. * console-client/Makefile (DIST_FILES): Do not set obsolete variable. --- console-client/Makefile | 4 1 file changed, 4 deletions(-) diff --git a/console-client/Makefile b/console-client/Makefile index 65a

Re: [PATCH 5/6] libmachdev: fix receiver lookups

2014-04-12 Thread Justus Winter
Quoting Samuel Thibault (2014-04-12 09:19:54) > Justus Winter, le Fri 11 Apr 2014 15:34:13 +0200, a écrit : > > --- a/libmachdev/device.defs > > +++ b/libmachdev/device.defs > > That being said, I guess we should be using gnumach's .defs? Yes, some day, but for now th

[PATCH] kern: set the name of tasks created during the bootstrap

2014-04-13 Thread Justus Winter
* kern/bootstrap.c (boot_script_task_create): Set the name of newly created tasks. --- kern/bootstrap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 7cfff3a..d919e90 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -800,6 +800,7 @@ boot_scrip

[PATCH 1/6] libmachdev: fix device_open

2014-04-13 Thread Justus Winter
device_open used to explicitly call ds_device_open_reply instead of just letting the mig-generated wrapper around ds_device_open generate the return message. There is really no need for that. * libmachdev/net.c: Do not include device_reply_U.h. (device_open): Do not call ds_device_open_reply. Set

more dde fixes

2014-04-13 Thread Justus Winter
Some more fixes for the code in the dde branch of the incubator. Justus

[PATCH 3/6] libmachdev: make the two port buckets clearly distinct

2014-04-13 Thread Justus Winter
libmachdev uses two port buckets previously both named port_bucket. Rename the one containing device_t ports to device_bucket to clearly distinguish them. * libmachdev/ds_routines.c (port_bucket): Rename to device_bucket. * libmachdev/mig-decls.h: Likewise. --- libmachdev/ds_routines.c | 8 --

[PATCH 2/6] libmachdev: remove mach_device_deallocate

2014-04-13 Thread Justus Winter
mach_device_deallocate just called ports_port_deref. However, the reference counting is done by the translation functions, explicitly reducing the reference count is just wrong. * libmachdev/ds_routines.c (mach_device_deallocate): Remove now unused function. (ds_device_close): Drop spurious call

[PATCH 4/6] libmachdev: drop unused declarations

2014-04-13 Thread Justus Winter
* libmachdev/net.c (linux_intr_pri): Drop unused declaration. (port_bucket): Likewise. (dev_class): Likewise. --- libmachdev/net.c | 4 1 file changed, 4 deletions(-) diff --git a/libmachdev/net.c b/libmachdev/net.c index 300d946..6037e2f 100644 --- a/libmachdev/net.c +++ b/libmachdev/net.c

[PATCH 6/6] libmachdev: add, fix and use declaration for create_device_port

2014-04-13 Thread Justus Winter
* libmachdev/ds_routines.c (create_device_port): Fix the type of the size parameter. Make it return error_t. * libmachdev/ds_routines.h (create_device_port): Add declaration. * libmachdev/net.c: Include ds_routines.h. * libmachdev/block.c: Include ds_routines.h. --- libmachdev/block.c | 1 +

[PATCH 5/6] libmachdev: add missing includes

2014-04-13 Thread Justus Winter
Include the mig-generated X_S.h files so that the X_routine functions can be inlined into the demuxer functions. * libmachdev/ds_routines.c: Add missing include of notify_S.h * libmachdev/trivfs_server.c: Add missing include of device_S.h, and notify_S.h. --- libmachdev/ds_routines.c | 1 + lib

[PATCH] Include the MIG-generated server header files

2014-04-15 Thread Justus Winter
This enables the compiler to check that the server function declarations match MIGs expectations. Fix a few oddities along the way. * console-client/trans.c: Include MIG-generated server header file(s). * console/console.c: Likewise. Also, fix declarations. * console/mutations.h (TIOCTL_IMPORTS)

Include fixes for the Hurd

2014-04-15 Thread Justus Winter
Hi :) here is a patch that will help prevent me from doing mistakes like [0] in the future. Oh, and it will make fakeroot faster. 0: f1aa15a509d4249b19bb3d7f1f388829dd5135f8 Cheers, Justus

Re: GCC's -fsplit-stack disturbing Mach's vm_allocate

2014-04-25 Thread Justus Winter
Quoting Svante Signell (2014-04-24 10:39:10) > On Fri, 2014-04-18 at 10:03 +0200, Samuel Thibault wrote: > > Samuel Thibault, le Thu 17 Apr 2014 00:03:45 +0200, a écrit : > > > Thomas Schwinge, le Wed 09 Apr 2014 09:36:42 +0200, a écrit : > > > > Well, the first step is to verify that TARGET_THREAD

Re: your mail

2014-04-26 Thread Justus Winter
Quoting Solal (2014-04-24 09:53:45) > ../device/net_io.c:1184:5: error: function definition is not allowed here > { > ^ > 4 warnings and 1 error generated. You stumbled across the only file in gnumach containing nested functions. Maybe your compiler just does not support them? Justus

Re: your mail

2014-04-26 Thread Justus Winter
Quoting Solal (2014-04-26 10:06:59) > What's nested functions? It is a gcc extension: http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html > That's as closures in JavaScript? Yes. Justus

Re: GCC's -fsplit-stack disturbing Mach's vm_allocate

2014-04-26 Thread Justus Winter
Quoting Svante Signell (2014-04-26 13:59:57) > > For reference, here are my notes about one of these crashes (Svante, > > is this still current?): > > Yes it is, thanks for your help so far. Is the rpctrace bug you > mentioned that the wrong ports are reported? > > > ~~~ snip ~~~ > > [...] > > ta

Re: your mail

2014-04-26 Thread Justus Winter
Hi :) Quoting Solal (2014-04-26 11:29:06) > How active them on LLVM? You don't: http://clang.llvm.org/docs/UsersManual.html#gcc-extensions-not-implemented-yet You could propose a patch to turn this into a normal function. Or you could use gcc. Justus

Re: your mail

2014-04-26 Thread Justus Winter
Hey Solal :) Quoting Solal (2014-04-26 16:09:03) > I've tried to compile GCC but that's still LLVM which I call when I type > "gcc". My mind-reading device tells me that you are using "Mac OS X 10.9". Entering "installing gcc on mac os x 10.9" into a popular search engine turned up various hits,

[PATCH 3/9] libports: reduce malloc overhead in _ports_bucket_class_iterate

2014-04-28 Thread Justus Winter
_ports_bucket_class_iterate creates a snapshot of the buckets hash table. This is done so that the lock protecting the hash table can be released while we iterate over the snapshot. Formerly, a linked list was used to store the snapshot. As the maximal number of items is known, using an array is

[PATCH 2/9] libports: work around bugs in server termination

2014-04-28 Thread Justus Winter
Some servers use ports_manage_port_operations_one_thread to process requests and terminate when it returns. Since many of them don't detach before shutting down, a client may receive an error if its request arrived while the server is shutting down. Prevent those spurious errors by forcing ports_ma

[PATCH 1/9] libdiskfs: set the default sync interval to 30 seconds

2014-04-28 Thread Justus Winter
The default sync interval has been changed in 9e55fdd7 from 30 to 5 seconds. This change was not reflected in the documentation. At least for current hardware, using 30 seconds instead of just 5 alleviates the thread-storm problem. Make 30 seconds the default again. * libdiskfs/priv.h (DEFAULT_

[PATCH 4/9] exec: abbreviate the task name if necessary

2014-04-28 Thread Justus Winter
* exec/exec.c (do_exec): If the formatted task name exceeds TASK_NAME_SIZE, abbreviate it. --- exec/exec.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/exec/exec.c b/exec/exec.c index 935762e..b068f5e 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -1168,9 +11

[PATCH 6/9] ext2fs: simplify expression

2014-04-28 Thread Justus Winter
* ext2fs/pager.c (add_pager_max_prot): Simplify expression. --- ext2fs/pager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext2fs/pager.c b/ext2fs/pager.c index 6e99c83..9116b8c 100644 --- a/ext2fs/pager.c +++ b/ext2fs/pager.c @@ -1453,8 +1453,7 @@ diskfs_max_user_pager_p

let's make libpager single-threaded

2014-04-28 Thread Justus Winter
Hi :) tl;dr: How many pager threads does it take to skrew in a light bulb? One. [PATCH 1/9] libdiskfs: set the default sync interval to 30 seconds Well, I made this one before I knew that the thread-storm problem might just be gone with this patch series. Still, we should either apply this patc

[PATCH 9/9] libpager: remove all the unused seqno parameters

2014-04-28 Thread Justus Winter
* libpager/Makefile (MIGSFLAGS): Drop -DSEQNOS. * libpager/chg-compl.c: Adjust accordingly. * libpager/data-request.c: Likewise. * libpager/data-return.c: Likewise. * libpager/data-unlock.c: Likewise. * libpager/demuxer.c: Likewise. * libpager/lock-completed.c: Likewise. * libpager/no-senders.c: Li

[PATCH 8/9] libpager: make libpager single-threaded

2014-04-28 Thread Justus Winter
Previously, libpager used multiple threads to service requests to memory objects. This has proven to be problematic, as paging requests often arrive in batches, resulting in the creation of many hundred threads. Furthermore, the semantic of paging requests requires that the requests to an object

[PATCH 5/9] ext2fs: fix type of inum

2014-04-28 Thread Justus Winter
Previously, inum was of type int, whereas dino_ref expects ino_t. On Hurd/x86 the former is 32 bit wide, the latter 64. If dino_ref is inlined, this does not seem to pose a problem, but if ext2fs is compiled with -O0, this most likely results in an invalid memory access. * ext2fs/ialloc.c (ext2_

[PATCH 7/9] ext2fs: use two distinct pager buckets for the disk and file pager

2014-04-28 Thread Justus Winter
ext2fs has two kinds of pagers. One for the files, one for the disk. Previously, both were in the same port bucket. If a request for a file pager arrives, it most likely touches some metadata (like the superblock). This is in turn backed by the disk pager, so another request is generated for the

Re: [PATCH 5/9] ext2fs: fix type of inum

2014-04-28 Thread Justus Winter
Quoting Samuel Thibault (2014-04-28 12:34:43) > Justus Winter, le Mon 28 Apr 2014 12:20:00 +0200, a écrit : > > Previously, inum was of type int, whereas dino_ref expects ino_t. On > > Hurd/x86 the former is 32 bit wide, the latter 64. If dino_ref is > > inlined, this do

[bug #18883] nice/getpriority/setpriority enforces even nice values

2014-04-28 Thread Justus Winter
Follow-up Comment #1, bug #18883 (project hurd): Contrary to its documentation, my gnumach has actually 50 priorities: shed.h: #define NRQS50 /* 50 run queues per cpu */ [...] #define invalid_pri(pri) (((pri) < 0) || ((pri) >= NRQS)) So we can actually have a bijective m

[PATCH] libports: reduce malloc overhead in _ports_bucket_class_iterate

2014-04-29 Thread Justus Winter
_ports_bucket_class_iterate creates a snapshot of the buckets hash table. This is done so that the lock protecting the hash table can be released while we iterate over the snapshot. Formerly, a linked list was used to store the snapshot. As the maximal number of items is known, using an array is

[bug #15329] exec doesn't like zip'ed binaries

2014-04-29 Thread Justus Winter
Update of bug #15329 (project hurd): Status: In Progress => Wont Fix ___ Follow-up Comment #4: Support for zipped binaries has been removed in 23ca8f5f942f831ec5be3667fd0a29873fae2912 and b2e27f

[PATCH 1/4] fatfs: simplify expression

2014-04-30 Thread Justus Winter
* fatfs/pager.c (add_pager_max_prot): Simplify expression. --- fatfs/pager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fatfs/pager.c b/fatfs/pager.c index 8146e64..6180aac 100644 --- a/fatfs/pager.c +++ b/fatfs/pager.c @@ -1008,8 +1008,7 @@ diskfs_max_user_pager_prot ()

[PATCH 2/4] ext2fs: improve diskfs_node_iterate

2014-04-30 Thread Justus Winter
Currently, diskfs_node_iterate iterates twice over all nodes in the cache. The first time only to determine the number of nodes currently in the cache. Simply count them instead. * ext2fs/inode.c (nodehash_nr_items): New variable. (diskfs_cached_lookup): Increment nodehash_nr_items. (diskfs_node

[PATCH 3/4] fatfs: improve diskfs_node_iterate

2014-04-30 Thread Justus Winter
Currently, diskfs_node_iterate iterates twice over all nodes in the cache. The first time only to determine the number of nodes currently in the cache. Simply count them instead. * fatfs/inode.c (nodehash_nr_items): New variable. (diskfs_cached_lookup): Increment nodehash_nr_items. (diskfs_cache

[PATCH 4/4] tmpfs: improve diskfs_node_iterate

2014-04-30 Thread Justus Winter
Currently, diskfs_node_iterate iterates twice over all nodes. The first time only to determine the number of nodes. Simply count them instead. * tmpfs/node.c (all_nodes_nr_items): New variable. (diskfs_free_node): Decrement all_nodes_nr_items. (diskfs_node_norefs): Likewise. (diskfs_cached_looku

[PATCH 1/2] doc: fix the number of priorities

2014-04-30 Thread Justus Winter
The number of priorities has been changed from 32 to 50 in 6a234201081156e6d5742e7eeabb68418b518fad. * doc/mach.texi: Update accordingly. --- doc/mach.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/mach.texi b/doc/mach.texi index d089224..49c0d67 100644 --- a/d

[PATCH 2/2] Install the mach_debug header files

2014-04-30 Thread Justus Winter
The task_set_name RPC introduced in 877a319c changed include/mach/gnumach.defs to include mach_debug/mach_debug_types.defs. Previously though, the debug headers were not installed. * Makefrag.am: Install the mach_debug header files. --- Makefrag.am | 15 --- 1 file changed, 12 inserti

[PATCH 2/2] kern: include the MIG-generated server headers for MACHINE_SERVER

2014-04-30 Thread Justus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the ipc_kobject_server function. * kern/ipc_kobject.c: Include the MIG-generated server headers for the machin

[PATCH 1/2] include: do not guard the host_slab_info RPC with MACH_VM_DEBUG

2014-04-30 Thread Justus Winter
Previously, the definition of the host_slab_info RPC was guarded with MACH_VM_DEBUG, even though it is not at all concerned with the VM subsystem. Furthermore, there was no "skip" directive for host_slab_info. The function host_slab_info is guarded with MACH_DEBUG. The server for the RPCs in mac

[PATCH 1/2] i386: fix MACHINE_SERVER_HEADER

2014-04-30 Thread Justus Winter
Commit b6dab094 introduced a way to include the MIG-generated server files for the machine specific interface in ipc_kobject.c. This broke out-of-tree builds. Here, 'machine' is a symlink to '../i386/i386', it points into the source tree. The MIG-generated files however are put in the build tree

[PATCH 2/2] vm: make struct vm_map fit into a cache line

2014-04-30 Thread Justus Winter
Currently, the size of struct vm_map is 68 bytes. By using a bit field for the boolean flags, it can be made fit into a cache line. * vm/vm_map.h (struct vm_map): Use a bit field for the boolean flags wait_for_space and wiring_required. --- vm/vm_map.h | 7 +-- 1 file changed, 5 insertions(+

Re: chroot in its own ext2fs?

2014-05-02 Thread Justus Winter
Hi :) Quoting Samuel Thibault (2014-05-02 02:22:01) > Does anybody remember precisely why chroots should have their own > ext2fs? I can build packages fine from inside a chroot which doesn't > have its own ext2fs, for instance. I thought only subhurds need their own translator? Justus

[PATCH 2/3] i386: add io_map_cached

2014-05-02 Thread Justus Winter
io_map_cached is like io_map, but reuses the old mapping if it is applicable. * i386/i386/io_map.c: Add io_map_cached. --- i386/i386/io_map.c | 29 + 1 file changed, 29 insertions(+) diff --git a/i386/i386/io_map.c b/i386/i386/io_map.c index 74e0b47..03d7152 100644 --

[PATCH 1/3] ddb: add "halt" command

2014-05-02 Thread Justus Winter
* ddb/db_command.c (db_command_table): Add "halt" command. * i386/i386/db_interface.h (db_halt_cpu): New declaration. * i386/i386at/model_dep.c (db_halt_cpu): New function. --- ddb/db_command.c | 1 + i386/i386/db_interface.h | 2 ++ i386/i386at/model_dep.c | 5 + 3 files changed, 8 i

forgot i386/i386at/acpihalt.h

2014-05-02 Thread Justus Winter
I forgot to add i386/i386at/acpihalt.h.

Re: [PATCH 3/3] i386: use ACPI to power off the machine

2014-05-03 Thread Justus Winter
Quoting Justus Winter (2014-05-03 01:33:14) > This is a mostly verbatim copy of acpihalt.c from GRUB2 with a little > bit of glue code. > [...] > * i386/i386at/acpihalt.c: Likewise. > (grub_acpi_halt): Map physical addresses. Hum. Maybe I'm holding stuff wrong. A little

assertion failure in the glibc

2014-05-05 Thread Justus Winter
/* Hi :) I believe I have found two problems in the glibc. 1. hurd_check_cancel takes 'lock', and then asserts that 'critical_section_lock' is not taken. However, hurd_thread_cancel first takes 'critical_section_lock' and then 'lock'. This program demonstrates this by spinning on both

Re: let's make libpager single-threaded

2014-05-05 Thread Justus Winter
Quoting Samuel Thibault (2014-05-05 16:55:19) > Richard Braun, le Mon 28 Apr 2014 16:55:17 +0200, a écrit : > > But it's certainly on the right path and shouldn't be far from being > > reliable (or at least, a lot more reliable than the current code). We encountered two problems: 1. netdde kept c

[PATCH 1/2] libports: unlock _ports_lock on malloc failure

2014-05-05 Thread Justus Winter
* libports/bucket-iterate.c (_ports_bucket_class_iterate): Unlock _ports_lock on malloc failure. --- libports/bucket-iterate.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c index 498cf13..babc204 100644 --- a/libports/

[PATCH 2/2] fatfs: use two distinct pager buckets for the disk and file pager

2014-05-05 Thread Justus Winter
fatfs has two kinds of pagers. One for the files, one for the disk. Previously, both were in the same port bucket. If a request for a file pager arrives, it most likely touches some metadata (like the superblock). This is in turn backed by the disk pager, so another request is generated for the

[PATCH 05/11] libdiskfs: lock-less reference counting for peropen objects

2014-05-12 Thread Justus Winter
* libdiskfs/diskfs.h (struct peropen): Use refcount_t for field refcnt. * libdiskfs/peropen-make.c (diskfs_make_peropen): Initialize refcnt. * libdiskfs/peropen-rele.c (diskfs_release_peropen): Adjust accordingly. * libdiskfs/protid-make.c (diskfs_start_protid): Likewise. Also, the node must no lo

[PATCH 06/11] libtrivfs: lock-less reference counting for trivfs_peropen objects

2014-05-12 Thread Justus Winter
* libtrivfs/trivfs.h (struct trivfs_peropen): Use refcount_t for field refcnt. (struct trivfs_control): Remove unused field lock. * libtrivfs/cntl-create.c (trivfs_create_control): Drop the mutex initialization. * libtrivfs/io-reauthenticate.c (trivfs_S_io_reauthenticate): Adjust accordingly. * lib

[PATCH 04/11] libports: lock-less reference counting for port_info objects

2014-05-12 Thread Justus Winter
* libports/ports.h (struct port_info): Use the new type. * libports/lookup-port.c: No need to lock _ports_lock anymore. * libports/bucket-iterate.c: Likewise. * libports/complete-deallocate.c: Check if someone reacquired a reference through a hash table lookup. * libports/create-internal.c: Use the

[PATCH 01/11] ext2fs: cache the superblock

2014-05-12 Thread Justus Winter
Previously, the superblock was mmaped and a pointer stored in sblock by map_hypermetadata. This memory is backed by our disk pager. This is rather unfortunate, as this means that whenever we read a value from that location, we might generate a request our disk pager. This amplifies the so-called

[PATCH 10/11] ext2fs: improve {enable,disable}_caching

2014-05-12 Thread Justus Winter
* ext2fs/pager.c (enable_caching, disable_caching): Iterate over the pager class instead of over both pager buckets. --- ext2fs/pager.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext2fs/pager.c b/ext2fs/pager.c index 017efcc..6328f3b 100644 --- a/ext2fs/pager.c +++ b

[PATCH 02/11] libports: use a single hash table

2014-05-12 Thread Justus Winter
Previously, libports used a hash table per port bucket. This makes looking up a port difficult if one does not know the port bucket, as one has to iterate over all buckets and do a hash table lookup each. Having to iterate over the buckets makes it necessary to keep a list of all buckets, which h

[PATCH 07/11] libihash: use an integer hash function on the keys

2014-05-12 Thread Justus Winter
Use an integer hash function to derive the index from the key. This should reduce the number of collisions. * libihash/ihash.c (hash_int32): New function. (find_index): Use hash_int32 on the key to derive the index. (add_one): Likewise. --- libihash/ihash.c | 23 +-- 1 file c

[PATCH 11/11] fatfs: improve {enable,disable}_caching

2014-05-12 Thread Justus Winter
* fatfs/pager.c (enable_caching, disable_caching): Iterate over the pager class instead of over both pager buckets. --- fatfs/pager.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fatfs/pager.c b/fatfs/pager.c index f855ecf..7aa5c5e 100644 --- a/fatfs/pager.c +++ b/f

[PATCH 09/11] libihash: use linear probing and fast modulo operation

2014-05-12 Thread Justus Winter
libihash uses open addressing. Previously, quadratic probing in both directions was used to resolve collisions. Quadratic probing might result in a less efficient use of caches. Also, prime numbers of the form 4 * i + 3 were used as array sizes. This was used in combination with the integer modu

[PATCH 08/11] libihash: reduce the default maximum load factor to 75%

2014-05-12 Thread Justus Winter
* libihash/ihash.h (HURD_IHASH_MAX_LOAD_DEFAULT): Set to 75. --- libihash/ihash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libihash/ihash.h b/libihash/ihash.h index 3ca5ec3..6bdc925 100644 --- a/libihash/ihash.h +++ b/libihash/ihash.h @@ -94,7 +94,7 @@ typedef struct hur

[PATCH 03/11] include: add lock-less reference counting primitives

2014-05-12 Thread Justus Winter
/null +++ b/include/refcount.h @@ -0,0 +1,174 @@ +/* Lock-less reference counting primitives + + Copyright (C) 2014 Free Software Foundation, Inc. + + Written by Justus Winter <4win...@informatik.uni-hamburg.de> + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; y

[PATCH 08/11] libihash: reduce the default maximum load factor to 75%

2014-05-12 Thread Justus Winter
The performance of hash tables depend critically on a low number of hash collisions. As the table fills up, the chance of collisions necessarily raises. Previously, libihash resized the hash table when the load exceeded 80%. This seems a bit optimistic (e. g. java.util.Hashtable uses 75% as defa

Re: [PATCH 02/11] libports: use a single hash table

2014-05-13 Thread Justus Winter
Quoting Samuel Thibault (2014-05-13 01:00:30) > Justus Winter, le Mon 12 May 2014 12:05:40 +0200, a écrit : > > Previously, libports used a hash table per port bucket. This makes > > looking up a port difficult if one does not know the port bucket, as > > one has to iterate

Re: [PATCH 03/11] include: add lock-less reference counting primitives

2014-05-13 Thread Justus Winter
Quoting Samuel Thibault (2014-05-13 01:04:13) > Justus Winter, le Mon 12 May 2014 12:05:41 +0200, a écrit : > > +/* An opaque type. You must not access these values directly. */ > > +typedef uint64_t refcounts_t; > > + > > +/* Instead, the functions manipulating r

Re: [PATCH 03/11] include: add lock-less reference counting primitives

2014-05-13 Thread Justus Winter
Quoting Neal H. Walfield (2014-05-13 09:44:21) > At Mon, 12 May 2014 12:05:41 +0200, > Justus Winter wrote: > > +/* Decrement REF. Return the result of the operation. This function > > + uses atomic operations. It is not required to serialize calls to > > + this f

<    3   4   5   6   7   8   9   10   11   12   >