Age | Commit message (Collapse) | Author |
|
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.
|
|
* console-client/vga-dynafont.c (dynafont_new): When the bbox width of
the font is a multiple of 8, set width to 8. Reject any other value
than 8 or 9 with EINVAL.
|
|
* console-client/vga-support.c (vga_set_font_width): Fix setting the
`VGA_ATTR_MODE_LGE' flag.
|
|
|
|
Some "hardware" (such as kvm on linux 3.2) would hang when transferring
between video memory and unaligned main memory. This also allows
better optimized transfers anyway.
Thanks Petter Reinholdtsen for the report and patient tests.
* console-client/vga-support.c (vga_state): Force maximum alignment of
`videomem' and `fontmem' fields.
|
|
Previously, the mach-defpager used a "magic typecast" for object
lookups. It renamed the port to the address of the associated object,
and upon receiving a message it would cast the port name back to a
pointer.
While this might seem like an optimization, it actually makes the port
handling in the kernel less efficient. Ports with small continuous
names are stored in an array, while other ports get spilled in a splay
tree.
Replace the linked list of default_port_t objects with a hash table.
Do not rename the ports, rather use the hash table to lookup objects
associated with ports.
* mach-defpager/default_pager.c (struct pager_port): Replace queue
with hash table, remove count, move type declaration to priv.h.
(pager_port_list_init): Adjust accordingly.
(pager_port_list_insert): Likewise.
(pager_port_list_delete): Likewise.
(destroy_paging_partition): Replace queue_iterate with HURD_IHASH_ITERATE.
(S_default_pager_objects): Likewise.
(S_default_pager_object_pages): Likewise.
(seqnos_memory_object_create): Do not rename the port but store it in
the hash table.
(S_default_pager_object_create): Likewise.
* mach-defpager/priv.h (struct dstruct): Add fast-removal pointer.
(pnameof): Remove obsolete macro definition.
(dnameof): Likewise.
* mach-defpager/mig-decls.h (begin_using_default_pager): Replace the
magic typecast with a hash table lookup.
* mach-defpager/Makefile (HURDLIBS): Add ihash.
|
|
* mach-defpager/default_pager.c: Fix local includes.
* mach-defpager/main.c: Likewise.
* mach-defpager/setup.c: Likewise.
|
|
Previously, the receiver lookup was done manually in all the server
functions. Use mig translator functions instead.
* mach-defpager/mig-decls.h: New file.
* mach-defpager/mig-mutate.h: Likewise.
* mach-defpager/Makefile (MIGSFLAGS): Include mig-mutate.h.
* mach-defpager/mach-defpager.c: Fix receiver lookups, move type
definitions...
* mach-defpager/priv.h: ... here, so that they can be used in
mig-decls.h.
|
|
* hurd/default_pager.defs: Honor DEFAULT_PAGER_IMPORTS.
(default_pager_object_set_size): Fix receiver type.
|
|
Found using the Clang Static Analyzer.
* libdiskfs/fsys-getroot.c (diskfs_S_fsys_getroot): Fix string
termination.
|
|
* isofs/inode.c (read_symlink_hook): Use memcpy, also copy terminating
zero.
|
|
This patch releases the interlock before doing an rpc call, analogous
to 901c61a1d25e7c8963e51012760a82730eda1910.
* libpager/pager-attr.c (pager_change_attributes): Release interlock
before calling memory_object_change_attributes, to let the callbacks
take it.
|
|
* libpager/pager-attr.c: Fix comment.
* libpager/pager.h: Likewise.
|
|
* config.make.in (HAVE_LIBBZ2, HAVE_LIBZ): New variables.
* configure.ac (--without-libbz2, --without-libz): New options.
* ext2fs/Makefile (OTHERLIBS): Make -lbz2 and -lz optional.
* fatfs/Makefile (OTHERLIBS): Likewise.
* isofs/Makefile (OTHERLIBS): Likewise.
* libstore/Makefile (maybe_part): Remove variable.
(store-types): Add part, bunzip2 and gunzip support conditionnally.
(LDLIBS): Make -lbz2 and -lz optional.
(OBJS): Add GUNZIP_OBJS and BUNZIP2_OBJS optional.
|
|
* console-client/trans.c (netfs_attempt_lookup): Look for errors returned by
`readlink' before allocating a node.
(netfs_attempt_readlink): Look for errors returned by `readlink'.
|
|
* console-client/current-vcs.c (vcs_readlink): Return error returned by
`console_current_id' as a negative value.
|
|
* console-client/current-vcs.c (vcs_readlink): Return error as negative
values.
(vcs_read): Convert errors returned by vcs_readlink before returning
them.
|