about summary refs log tree commit homepage
path: root/dev.c
DateCommit message (Collapse)
2014-05-29dev: minor khash-related cleanups khash
This reduces unnecessary boilerplate due to switching khash.
2014-05-29try khash out for mapping mog_devids
There are no apparent benefits at the moment, but theoretically it can reduce the amount of allocations we do and improve locality.
2013-07-14ioq: reset internal queues during requeue/shutdown
This should avoid concurrency bugs where client may run in multiple threads if we switch to multi-threaded graceful shutdown.
2013-07-12ioq: rescale to match user-set aio_threads values
Users reducing or increasing thread counts should increase ioq capacity, otherwise there's no point in having more or less threads if they are synched to the ioq capacity.
2013-07-10ioq: implement and enable generic I/O queues
This will allow us to limit concurrency on a per-device basis with limited impact on HTTP header reading/parsing. This prevents pathological slowness on a single device from bringing down an entire host. This also allows users to more safely run with fewer aio_threads (e.g. 1:1 thread:device mapping) on fast devices with smaller low-level (kernel/hardware) I/O queues.
2013-07-10introduce generic I/O queue functionality
This replaces the fsck_queue internals with a generic ioq implementation which is based on the MogileFS devid, and not the operating system devid.
2013-07-10dev: shrink and cache-align struct mog_dev
We will have structures inside the dev struct accessed by multiple threads frequently, so keep it cache-aligned. To reduce memory usage for large-numbered devices, avoid storing the prefix on output and instead just rely on the printf-family of routines to generate stringified output in uncommon code paths.
2013-06-25svc: implement top-level by_mog_devid hash
This will allow us to lookup devices for per-(mog)device I/O queues.
2013-06-25fix devices/thread count if sidechannel is inactive
If the mogstored sidechannel is inactive (in HTTP-only mode), we should still count the number of devices correctly to correctly scale the number of worker threads.
2013-01-17copyright comment updates for 2013
gnulib did it for us in m4/gnulib-cache.m4, we'll match.
2012-12-09dev: log EIO error on close() of usage file
If a filesystem error occurs when close()-ing the usage file, ensure we log the error for debugging (and hope syslog writes to a different device!).
2012-12-06dev: increase precision of space calculation
The "long double" data type is present in C89 and may offer more precision than plain double on modern compilers. This change is unlikely to be noticeable right now, but may help some very large machines in the (far) future.
2012-12-06fix usage report on FSes w/ small fragment size
Under FreeBSD 9.0, fstatvfs() on a ZFS filesystem will return the smallest fragment size ZFS supports (512). Using integer arithmetic, dividing 512 by 1024 will result in zero. Thus, the easiest way to preserve the fractional component is to resort to floating point arithmetic: f_frsize / 1024.0 The division must happen first to minimize the possibility of overflow.
2012-12-03fail on ENOSPC when calling dprintf()
dprintf() may return a non-negative value and still set ENOSPC on partially-written data.
2012-11-08dev: improve error handling on usage file generation
Opening a usage file for writing can hit the FD limit, so ensure we retry on EMFILE/ENFILE/ENOMEM errors. This also improves diagnostics for failures of individual function calls.
2012-02-26dev: small cleanups
No point in using goto to just jump to the next statement, and need to trigger assert() on EBADF
2012-01-19enforce change permissions _after_ writing file
We don't want files to be globally readable/writable when writing is in-progress.
2012-01-19use *open_put instead of *open_excl for writing files
This gives necessary flexibility in choosing open(2) flags (for Content-Range: uploads) without further complicating things.
2012-01-11initial commit
Nuked old history since it was missing copyright/GPLv3 notices.