Age | Commit message (Collapse) | Author |
|
* 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 longer be locked, adjust comment accordingly.
(diskfs_create_protid): Likewise.
|
|
Add a node 'slabinfo' to the root directory that contains information
about the slab allocator used in GNU Mach.
The formatting code has been taken from Richard Braun's standalone
client available here:
git://darnassus.sceen.net/rbraun/slabinfo.git
* rootdir.c (rootdir_gc_slabinfo): New function.
(rootdir_entries): Add node 'slabinfo'.
* Makefile (OBJS): Add mach_debugUser.o.
(rootdir.o): Add an explicit dependency on mach_debug_U.h.
Furthermore, add rules to create both functions.
|
|
* include/Makefile (installhdrs): Add refcount.h.
|
|
As of recently, fakeroot would fail to create symlinks:
% fakeroot-hurd ln -s foo a
ln: failed to create symbolic link ‘a’: Operation not permitted
Fix this by overriding fshelp_isowner.
Various netfs functions will call fshelp_isowner to check whether USER
is allowed to do some operation. As fakeroot is not running within
the fakeauth'ed environment, USER contains the real user.
I have no explanation why this ever worked.
* trans/fakeroot.c (fshelp_isowner): New function.
|
|
* include/refcount.h: New file.
|
|
* libihash/ihash.c (hurd_ihash_add): Move the code computing the load
factor of the hash table...
* libihash/ihash.h (hurd_ihash_get_load): ... here, together with the
comment describing the method and the rationale for chosing binary
percent.
|
|
* libihash/ihash.c (hurd_ihash_add): Fix typo.
|
|
* proc/hash.c (reqport_find): Move this function...
* proc/proc.h (process_drop): ... and this...
* proc/mig-decls.h: ... here and rename them.
* proc/mig-mutate.h: Update accordingly.
|
|
* trans/fakeroot.c (main): Use C99-style struct initialization to
initialize argp. This avoids a warning about missing field
initializers.
|
|
* trans/fakeroot.c (netfs_attempt_chown): Fix comparison between
signed and unsigned integer expressions.
|
|
A spurious semicolon caused a control flow bug in check_openmodes,
leading to a port leak.
* trans/fakeroot.c (check_openmodes): Remove spurious semicolon.
|
|
Expressing the maximum load in binary percent (where 128b% corresponds
to 100%) allows us to use fast binary scaling to determine if the
maximum load has been reached without losing precision.
Furthermore, the previously used expression 'ht->nr_items * 100'
overflows int at 2^25 (unsigned int at 2^26). When a hash table
reached that limit, it would fail to resize and fill up the table.
This change fixes that.
* libihash/ihash.c (hurd_ihash_set_max_load): Update the comment.
(hurd_ihash_add): Use fast binary scaling to determine the current
load.
* libihash/ihash.h (struct hurd_ihash): Update comment for max_load.
(hurd_ihash_set_max_load): Update the comment.
|
|
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 modulo operation for
hashing. It has been known for some time that libihash suffers from
collisions, so a integer hash function is now applied to the keys to
derive the index.
Use linear probing instead. Also, use powers of two for the array
sizes, so a bit mask can be used for the modulo operation.
* libihash/ihash.c (ihash_sizes, ihash_nsizes): Remove.
(find_index): Use linear probing and fast modulo operation.
(add_one): Likewise.
* libihash/ihash.h (HURD_IHASH_MIN_SIZE): New macro.
|
|
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.
|
|
Previously, int was used for the field max_load of struct hurd_ihash.
There is no reason for this as far as I can tell. Furthermore,
hurd_ihash_set_max_load takes an unsigned int max_load.
* libihash/ihash.h (struct hurd_ihash): Use unsigned int for field
max_load.
|
|
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 default).
* libihash/ihash.h (HURD_IHASH_MAX_LOAD_DEFAULT): Set to 75.
|
|
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 thread-storm problem.
Rather than relying on a mmaped region of memory, just use the data
loaded by get_hypermetadata.
* ext2fs/hyper.c (get_hypermetadata): Do not free sblock.
(mapped_sblock): New variable.
(map_hypermetadata): Map the superblock to mapped_sblock instead.
(diskfs_set_hypermetadata): Copy superblock into mapped_superblock.
* ext2fs/ext2fs.h (get_hypermetadata, map_hypermetadata): Adjust
comments accordingly.
|
|
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 disk pager.
Seperate all pagers clearly by using two port buckets. This will
enable us to use a single thread per port bucket in the future.
* fatfs/pager.c (pager_bucket): Rename to...
(disk_pager_bucket): ... this to make the change explicit at every
occurrence.
(file_pager_bucket): New variable.
(service_paging_requests): New function.
(create_fat_pager): Also create the file pager.
(diskfs_get_filemap): Handout pagers from the file_pager_bucket.
(diskfs_shutdown_pager): This is only concerned with the file pager.
Simplify code accordingly.
(diskfs_sync_everything): Likewise.
(diskfs_pager_users): Likewise.
(diskfs_max_user_pager_prot): Likewise.
(disable_caching): Iterate over both buckets.
(enable_caching): Likewise.
|
|
* libports/bucket-iterate.c (_ports_bucket_class_iterate): Unlock
_ports_lock on malloc failure.
|
|
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 disk pager.
Seperate all pagers clearly by using two port buckets. This will
enable us to use a single thread per port bucket in the future.
* ext2fs/pager.c (pager_bucket): Rename to...
(disk_pager_bucket): ... this to make the change explicit at every
occurrence.
(file_pager_bucket): New variable.
(service_paging_requests): New function.
(create_disk_pager): Also create the file pager.
(diskfs_get_filemap): Handout pagers from the file_pager_bucket.
(diskfs_shutdown_pager): This is only concerned with the file pager.
Simplify code accordingly.
(diskfs_sync_everything): Likewise.
(diskfs_pager_users): Likewise.
(diskfs_max_user_pager_prot): Likewise.
(disable_caching): Iterate over both buckets.
(enable_caching): Likewise.
|
|
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_lookup): Increment all_nodes_nr_items.
(diskfs_node_iterate): Fix type of sum_nodes, use all_nodes_nr_items.
|
|
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_cached_lookup_in_dirbuf): Likewise.
(diskfs_node_norefs): Decrement nodehash_nr_items.
(diskfs_node_iterate): Fix the type of num_nodes, use nodehash_nr_items.
|
|
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_norefs): Decrement nodehash_nr_items.
(diskfs_node_iterate): Fix the type of num_nodes, use nodehash_nr_items.
|
|
* fatfs/pager.c (add_pager_max_prot): Simplify expression.
|
|
_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 much simpler.
_ports_bucket_class_iterate implements both ports_bucket_iterate and
ports_class_iterate. For this change might make ports_class_iterate
less efficient memory-wise if the number of ports belonging to the
class is low with respect to the number of ports in the bucket. If
this happens, we allocate too much. Alleviate this by releasing
unused memory.
On the other hand, the array representation is more compact.
Furthermore a survey of the Hurd code revealed that
ports_class_iterate is rarely used, while ports_bucket_iterate is used
more often, most prominently in paging code.
* libports/bucket-iterate.c (_ports_bucket_class_iterate): Use an
array instead of a linked list.
|
|
* ext2fs/pager.c (add_pager_max_prot): Simplify expression.
|
|
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_alloc_inode): Use type ino_t for inum.
|
|
* exec/exec.c (do_exec): If the formatted task name exceeds
TASK_NAME_SIZE, abbreviate it.
|
|
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_manage_port_operations_one_thread not to return.
This is the same change as 235491231bdd1fd93507c835767503f047e10b91
introduced for ports_manage_port_operations_multithread.
* libports/manage-one-thread.c
(ports_manage_port_operations_one_thread): Force timeout to 0.
|
|
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_SYNC_INTERVAL): Set to 30 seconds.
|
|
following 7cb7fa6b3a0d02985b4a51f7823bc1cb631d6bfa
* proc/mgt.c (S_proc_exception_raise): Do not dereference e on returning
EINVAL, the translation functions does it for us.
|
|
|
|
* utils/rpctrace.c (rewrite_right): Explain why the unknown send right
error happens on fork().
|
|
GNU libc has provided the 'crypt' function in libcrypt for a long time,
making this check unnecessary.
* configure.ac: Remove libcrypt check and 'LIBCRYPT' substitution.
* config.make.in (LIBCRYPT): Remove.
* trans/Makefile (password-LDLIBS): Change $(LIBCRYPT) to -lcrypt.
* utils/Makefile (login-LDLIBS, addauth-LDLIBS, setauth-LDLIBS):
Likewise.
|
|
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): Just use libnetfs/priv.h.
* console/priv.h: Delete now unused file.
* ext2fs/storeinfo.c: Include MIG-generated server header file(s).
* fatfs/inode.c: Likewise.
* fatfs/main.c: Likewise. Also, fix declaration.
* isofs/inode.c: Likewise.
* libdiskfs/boot-start.c: Likewise.
* libdiskfs/file-chg.c: Include the correct MIG-generated server header file.
* libdiskfs/file-chmod.c: Include MIG-generated server header file(s).
* libdiskfs/file-get-fs-opts.c: Likewise.
* libdiskfs/init-startup.c: Likewise.
* libnetfs/file-get-children.c: Likewise.
* libnetfs/file-getcontrol.c: Include the correct MIG-generated server
header file.
* libnetfs/file-set-translator.c: Include MIG-generated server header file(s).
* libnetfs/fsstubs.c: Likewise.
* libtrivfs/file-access.c: Likewise.
* libtrivfs/file-chauthor.c: Likewise.
* libtrivfs/file-chflags.c: Likewise.
* libtrivfs/file-chg.c: Likewise.
* libtrivfs/file-chmod.c: Likewise.
* libtrivfs/file-chown.c: Likewise.
* libtrivfs/file-exec.c: Likewise.
* libtrivfs/file-get-children.c: Likewise.
* libtrivfs/file-get-fs-options.c: Likewise.
* libtrivfs/file-get-source.c: Likewise.
* libtrivfs/file-get-storage-info.c: Likewise.
* libtrivfs/file-get-trans.c: Likewise.
* libtrivfs/file-get-transcntl.c: Likewise.
* libtrivfs/file-getcontrol.c: Likewise.
* libtrivfs/file-getfh.c: Likewise.
* libtrivfs/file-getlinknode.c: Likewise.
* libtrivfs/file-lock.c: Likewise.
* libtrivfs/file-reparent.c: Likewise.
* libtrivfs/file-set-size.c: Likewise.
* libtrivfs/file-set-trans.c: Likewise.
* libtrivfs/file-statfs.c: Likewise.
* libtrivfs/file-sync.c: Likewise.
* libtrivfs/file-syncfs.c: Likewise.
* libtrivfs/file-utimes.c: Likewise.
* libtrivfs/fsys-forward.c: Likewise.
* libtrivfs/fsys-get-options.c: Likewise.
* libtrivfs/fsys-getroot.c: Likewise.
* libtrivfs/fsys-goaway.c: Likewise.
* libtrivfs/fsys-set-options.c: Likewise.
* libtrivfs/fsys-stubs.c: Likewise.
* libtrivfs/fsys-syncfs.c: Likewise.
* libtrivfs/io-async-icky.c: Likewise.
* libtrivfs/io-async.c: Likewise.
* libtrivfs/io-duplicate.c: Likewise.
* libtrivfs/io-identity.c: Likewise.
* libtrivfs/io-map.c: Likewise.
* libtrivfs/io-modes-get.c: Likewise.
* libtrivfs/io-modes-off.c: Likewise.
* libtrivfs/io-modes-on.c: Likewise.
* libtrivfs/io-modes-set.c: Likewise.
* libtrivfs/io-owner-get.c: Likewise.
* libtrivfs/io-owner-mod.c: Likewise.
* libtrivfs/io-pathconf.c: Likewise.
* libtrivfs/io-read.c: Likewise.
* libtrivfs/io-readable.c: Likewise.
* libtrivfs/io-reauthenticate.c: Likewise.
* libtrivfs/io-restrict-auth.c: Likewise.
* libtrivfs/io-revoke.c: Likewise.
* libtrivfs/io-seek.c: Likewise.
* libtrivfs/io-select.c: Likewise.
* libtrivfs/io-stat.c: Likewise.
* libtrivfs/io-stubs.c: Likewise.
* libtrivfs/io-version.c: Likewise.
* libtrivfs/io-write.c: Likewise.
* pfinet/tunnel.c: Likewise.
* storeio/io.c: Likewise.
* storeio/storeio.c: Likewise.
* term/users.c: Likewise.
* tmpfs/node.c: Likewise.
* trans/fakeroot.c: Likewise. Also, include all server headers that provide
the X_server_routine functions...
(netfs_demuxer): ... that were previously declared here.
* trans/fifo.c: Include MIG-generated server header file(s).
* trans/firmlink.c: Likewise.
* trans/hello-mt.c: Likewise.
* trans/hello.c: Likewise.
* trans/magic.c: Likewise.
* trans/mtab.c: Likewise.
* trans/new-fifo.c: Likewise.
* trans/null.c: Likewise.
* trans/proxy-defpager.c: Likewise.
* trans/streamio.c: Likewise.
* libdiskfs/fsmutations.h: Qualify the import with the libraries path.
Without this change, out-of-tree builds would no longer work.
* libnetfs/mutations.h: Likewise.
* libtrivfs/mig-mutate.h: Likewise.
|
|
This fixes one more occurence of a notify_port_t receiver lookup that
I overlooked in 5a4926dd52aed56913cbe10592063ff0da753700.
* libpager/no-senders.c: Include "notify_S.h" so that the compiler can
spot such mistakes in the future.
(_pager_do_seqnos_mach_notify_no_senders): Fix receiver lookup.
|
|
* libpager/mig-mutate.h: Add mutators.
* libpager/notify-stubs.c: Adjust accordingly.
|
|
This complements e9687ec4ff525ae4a88314ba4ae97da770bd012f.
* console/display.c: Fix receiver lookups, adjust function declarations.
* console/mutations.h: Add NOTIFY mutators.
|
|
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.
* boot/Makefile: Remove the ourdevice hack.
* boot/boot.c: Adjust the include accordingly.
|
|
Since 50bfb9acf98d5f4c0c5948cc28285e990b40b659 git is used to produce
dist tarballs.
* console-client/Makefile (DIST_FILES): Do not set obsolete variable.
|
|
* libports/interrupt-operation.c (ports_S_interrupt_operation): Fix
receiver lookup.
* libports/mig-mutate.h: Add mutators.
* libports/ports.h: Remove superfluous declarations.
|
|
* hurd/hurd_types.defs (interrupt_t): New type.
* hurd/hurd_types.h (interrupt_t): Likewise.
* hurd/interrupt.defs (interrupt_operation): Use the new type.
|
|
* mig-decls.h: New file.
* mig-mutate.h: Likewise.
* Makefile (MIGSFLAGS): Use mig-mutate.h.
* random.c (S_startup_dosync): Fix the receiver lookup.
|
|
* libports/Makefile (MIGSFLAGS): Include mig-mutate.h.
* libports/mig-decls.h: New file.
* libports/mig-mutate.h: Likewise.
* libports/notify-dead-name.c: Fix receiver lookups.
* libports/notify-no-senders.c: Likewise.
* libports/notify-msg-accepted.c: Adjust function declaration.
* libports/notify-port-deleted.c: Likewise.
* libports/notify-port-destroyed.c: Likewise.
* libports/notify-send-once.c: Likewise.
* libports/ports.h: Likewise.
* proc/Makefile (MIGSFLAGS): Include mig-mutate.h, move PROCESS mutators...
* proc/mig-mutate.h: ... into a new file, add NOTIFY mutators.
* proc/notify.c: Fix receiver lookups, adjust function declarations.
* term/devio.c (ports_do_mach_notify_send_once): Adjust accordingly.
|
|
* libdiskfs/Makefile (exec_startup-MIGSFLAGS): New variable.
* libdiskfs/diskfs.h (struct bootinfo): New struct declaration.
(diskfs_begin_using_bootinfo_port): New function.
(diskfs_end_using_bootinfo): Likewise.
* libdiskfs/fsmutations.h: Add mutators for exec_startup_t.
* libdiskfs/priv.h (bootinfo_t): New type declaration to appease mig.
* libdiskfs/boot-start.c (S_exec_startup_get_info): Fix receiver lookup.
|
|
* exec/Makefile (exec_startup-MIGSFLAGS): New variable.
* exec/execmutations.h: Add mutators for exec_startup_t.
* exec/mig-decls.h: New file.
* exec/priv.h (bootinfo_t): New type declaration to appease mig.
* exec/exec.c (S_exec_startup_get_info): Fix receiver lookup.
|
|
* hurd/hurd_types.defs (exec_startup_t): New type.
* hurd/hurd_types.h (exec_startup_t): Likewise.
* hurd/exec_startup.defs: Honor EXEC_STARTUP_IMPORTS.
(exec_startup_get_info): Use the new type as receiver.
|
|
|
|
Thanks Cyril Roelandt for finding the issue.
* libdiskfs/dir-renamed.c (diskfs_rename_dir): On diskfs_lookup error,
set fnp to NULL to avoid unlocking it spuriously.
|
|
Previously, the receiver lookup was done manually in all the server
functions. Use mig translator functions instead.
* libpager/mig-decls.h: New file.
* libpager/mig-mutate.h: Likewise.
* libpager/Makefile (MIGSFLAGS): Include mig-mutate.h.
* libpager/chg-compl.c: Fix receiver lookups.
* libpager/data-request.c: Likewise.
* libpager/data-return.c: Likewise.
* libpager/data-unlock.c: Likewise.
* libpager/lock-completed.c: Likewise.
* libpager/object-init.c: Likewise.
* libpager/object-terminate.c: Likewise.
* libpager/stubs.c: Likewise.
* libpager/seqnos.c (_pager_update_seqno): Move the actual
functionality...
(_pager_update_seqno_p): ... into a new function that can be called
with a pointer to struct pager.
* libpager/priv.h (_pager_update_seqno_p): New declaration.
|