b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
db87967e5b0ca8fac6be77ba926ce785a3277773 |
|
05-Feb-2016 |
Vito Caputo <vito.caputo@coreos.com> |
journal: move mmap() ENOMEM loop to function
Introduces mmap_try_harder() |
6a49149028ded22d5eec6d96314a78ed4e8c79b0 |
|
05-Feb-2016 |
Vito Caputo <vito.caputo@coreos.com> |
journal: move window initialization to window_add |
739731cdace09ff179fdd75ae0714da0d81e384d |
|
03-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
journal: fix boolean handling in MMapCache
Let's use bitfields for our booleans, and don't try to apply binary OR or addition on them, because that's weird and we
should instead use logical OR only. |
f649045c10ace1b49cb6fbefdc33747a1aab28bc |
|
10-Dec-2015 |
Lennart Poettering <lennart@poettering.net> |
journal: make mmap_cache_unref() a NOP when NULL is passed, like all other destructors |
23e096cc60eb73f24b812e4ceba7c4c2c141e2db |
|
17-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: make macros for converting fds to pointers and back generic and use them everywhere |
cf0fbc49e67b55f8d346fc94de28c90113505297 |
|
16-Nov-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: sort includes
Sort the includes accoding to the new coding style. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
fa6ac76083b8ffc1309876459f54f9f0e2843731 |
|
05-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
journald: process SIGBUS for the memory maps we set up
Even though we use fallocate() it appears that file systems like btrfs
will trigger SIGBUS on certain low-disk-space situation. We should
handle that, hence catch the signal, add it to a list of invalidated
pages, and replace the page with an empty memory area. After each write
check if SIGBUS was triggered, and consider the write invalid if it was.
This should make journald a lot more robust with file systems where
fallocate() is not reliable, for example all CoW file systems
(btrfs...), where changing written data can fail with disk full errors.
https://bugzilla.redhat.com/show_bug.cgi?id=1045810 |
69adae5168da231c6cf319f708860954701b25ed |
|
13-Dec-2014 |
Michal Schmidt <mschmidt@redhat.com> |
journal: replace contexts hashmap with a plain array
try_context() is such a hot path that the hashmap lookup is expensive.
The number of contexts is small - it is the number of object types.
Using a hashmap is overkill. A plain array will do.
Before:
$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null
real 0m9.445s
user 0m9.228s
sys 0m0.213s
After:
$ time ./journalctl --since=2014-06-01 --until=2014-07-01 > /dev/null
real 0m5.438s
user 0m5.266s
sys 0m0.170s |
634ed0ee3466e5e5f78d3acbe9782650ff456288 |
|
13-Dec-2014 |
Michal Schmidt <mschmidt@redhat.com> |
journal: delete unused function mmap_cache_close_context
This never had any callers. Contexts are freed when the MMapCache is
freed. |
1b8951e5bd9b2bf1722098a861055cae0bb52088 |
|
13-Dec-2014 |
Michal Schmidt <mschmidt@redhat.com> |
journal: remove journal_file_object_keep/release functions
The only user is sd_journal_enumerate_unique() and, as explained in
the previous commit (fed67c38e3 "journal: map objects to context set by
caller, not by actual object type"), the use of them there is now
superfluous. Let's remove them.
This reverts major parts of commits:
ae97089d49 journal: fix access to munmapped memory in
sd_journal_enumerate_unique
06cc69d44c sd-journal: fix sd_journal_enumerate_unique skipping values
Tested with an "--enable-debug" build and "journalctl --list-boots".
It gives the expected number of results. Additionally, if I then revert
the previous commit ("journal: map objects to context set by caller, not
to actual object type"), it crashes with SIGSEGV, as expected. |
fad5a6c66e73d3df20846906121d52159e1f6bf4 |
|
13-Dec-2014 |
Michal Schmidt <mschmidt@redhat.com> |
journal: add debug mode for mmap-cache (--enable-debug=mmap-cache)
This is useful for exposing unsafe access to mmapped objects after
the context that they were mapped in was already moved.
For example:
journal_file_move_to_object(f1, OBJECT_DATA, p1, &o1);
journal_file_move_to_object(f2, OBJECT_DATA, p2, &o2);
t = o1->object.type; /* this usually works, but is unsafe */ |
06cc69d44c8ff2b652527357f28acd4cbe77c814 |
|
10-Oct-2014 |
Jan Janssen <medhefgo@web.de> |
sd-journal: fix sd_journal_enumerate_unique skipping values
sd_journal_enumerate_unique will lock its mmap window to prevent it
from being released by calling mmap_cache_get with keep_always=true.
This call may return windows that are wider, but compatible with the
parameters provided to it.
This can result in a mismatch where the window to be released cannot
properly be selected, because we have more than one window matching the
parameters of mmap_cache_release. Therefore, introduce a release_cookie
to be used when releasing the window.
https://bugs.freedesktop.org/show_bug.cgi?id=79380 |
d5099efc47d4e6ac60816b5381a5f607ab03f06e |
|
15-Sep-2014 |
Michal Schmidt <mschmidt@redhat.com> |
hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.
systemd keeps hundreds of hashmaps, so this saves a little bit of
memory. |
b67ddc7bbe31cde7f69f9814204d9bb1d4623c47 |
|
11-Sep-2014 |
Philippe De Swert <philippedeswert@gmail.com> |
journal: do not leak mmaps on OOM
After a section of memory is succesfully allocated, some of the following
actions can still fail due to lack of memory. In this case -ENOMEM is
returned without actually freeing the already mapped memory.
Found with coverity. Fixes: CID#1237762 |
ae97089d49d1795a35a443b7b830ee666028e733 |
|
11-Jan-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journal: fix access to munmapped memory in sd_journal_enumerate_unique
sd_j_e_u needs to keep a reference to an object while comparing it
with possibly duplicate objects in other files. Because the size of
mmap cache is limited, with enough files and object to compare to,
at some point the object being compared would be munmapped, resulting
in a segmentation fault.
Fix this issue by turning keep_always into a reference count that can
be increased and decreased. Other callers which set keep_always=true
are unmodified: their references are never released but are ignored
when the whole file is closed, which happens at some point. keep_always
is increased in sd_j_e_u and later on released. |
bf807d4dbf27c783db8dfd7f4eca321ae4be5b00 |
|
26-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
journald: keep statistics on how of we hit/miss the mmap cache |
71fda00f320379f5cbee8e118848de98caaa229d |
|
14-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use. |
8e6d9397b550f5617fc9231e3a275348cda23c89 |
|
02-Aug-2013 |
George McCollister <george.mccollister@gmail.com> |
journal: fix hashmap leak in mmap-cache
hashmap_free() wasn't being called on m->contexts and m->fds resulting
in a leak.
To reproduce do:
while(1) {
sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY);
sd_journal_close(j);
}
Memory usage will increase until OOM. |
6866780115a7c0af034f287d965f4bf6b02c1e6d |
|
09-May-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Rearrange a few fields to reduce holes |
44a6b1b68029833893f6e9cee35aa27a974038f6 |
|
03-May-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add __attribute__((const, pure, format)) in various places
I'm assuming that it's fine if a _const_ or _pure_ function
calls assert. It is assumed that the assert won't trigger,
and even if it does, it can only trigger on the first call
with a given set of parameters, and we don't care if the
compiler moves the order of calls. |
a2ab7ee6122a5006cafc45d7b81f726656fb65cc |
|
16-Oct-2012 |
Colin Guthrie <colin@mageia.org> |
journal: Set the last_unused pointer correctly when attaching an unused window
It seems the previous code was copy/pasted from context_detach_window()
but not updated. |
89de694724f376a6852e879fe987e7e531327654 |
|
16-Oct-2012 |
Colin Guthrie <colin@mageia.org> |
journal: Properly track the number of allocated windows.
Checks were already in place to make sure that the number of
windows was limited to 64, but the count was never incremented
or decremented. |
e18021f7daf6940e5fa87a35e320bb50fbd3e3ef |
|
21-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: always keep marked mmap windows around |
f801968466fed39d50d410b30ac828c26722cc95 |
|
21-Sep-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: completely rework the mmap cache as I too dumb to actually understand it
Instead of doing hand optimized fd bisect arrays just use plain old
hashmaps. Now I can understand my own code again. Yay!
As a side effect this should fix some bad memory accesses caused by
accesses after mmap(), introduced in 189. |
c53158818d8cdaf46b3f1b5299b9bda118a1043f |
|
13-Sep-2012 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
man: fix a bunch of typos in docs
https://bugs.freedesktop.org/show_bug.cgi?id=54501 |
fcde238921b857679363a95488a5a5af1dc1f243 |
|
21-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: be more careful when keeping around mmaps we still need |
84168d8068bb67dcd5468ab3b376535d81643aef |
|
18-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
mmap: resize arrays dynamically |
f65425cbc4385b4f5b20ded641cbb07ad6a0938f |
|
16-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: add superficial structure verifier |
beec00856158b703f2125a3d936080346a8a8de1 |
|
16-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: implement basic journal file verification logic |
16e9f408fa9a9626059bdd6c89dc175e06b9e976 |
|
16-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
journal: implement generic sharable mmap caching logic
instead of having one simple per-file cache implement an more
comprehensive one that works for multiple files and can actually
maintain multiple maps per file and per object type. |