summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* benchmark hashfindhash-stat2Lucas De Marchi2013-09-251-29/+16
|
* use hashval in each itemLucas De Marchi2013-09-251-45/+30
|
* Add script to create performance tableLucas De Marchi2013-09-251-0/+77
|
* Allow to save figure directly to diskLucas De Marchi2013-09-252-4/+20
|
* parse-depmod: Allow to plot all at onceLucas De Marchi2013-09-251-20/+28
|
* Add resultsLucas De Marchi2013-09-2518-17053/+748
|
* scritps/plot-timing: Allow to give a name to chartLucas De Marchi2013-09-251-2/+8
|
* benchmark addLucas De Marchi2013-09-252-16/+48
|
* benchmark lookupLucas De Marchi2013-09-252-10/+33
|
* scripts/parse-timing: Make cutoff optionalLucas De Marchi2013-09-202-9/+21
|
* scripts: Plot hashfunc timingsLucas De Marchi2013-09-201-0/+41
|
* scripts/parse-depmod: use anchored textLucas De Marchi2013-09-201-8/+14
|
* scripts: Add scripts to parse hashfunc timingsLucas De Marchi2013-09-202-0/+78
|
* Benchmark hash timing per key lenLucas De Marchi2013-09-201-5/+22
|
* scripts: Add benchmark scripts and distribution logsLucas De Marchi2013-09-207-0/+85241
|
* fixup! Add hash functions for testLucas De Marchi2013-09-201-1/+1
|
* Dump hashesLucas De Marchi2013-09-203-0/+38
|
* Add hash functions for testLucas De Marchi2013-09-202-1/+147
|
* NEWS: add entriesLucas De Marchi2013-09-201-0/+8
|
* rmmod: remove --wait optionLucas De Marchi2013-09-201-11/+5
| | | | Let libkmod enforce KMOD_REMOVE_NOWAIT.
* libkmod: always pass O_NONBLOCK to kernelLucas De Marchi2013-09-203-11/+16
| | | | | Not passsing O_NONBLOCK to delete_module() is deprecated since kmod 11 and is being removed from the kernel. Force this flag in libkmod.
* libkmod-hash: always align n_buckets to power of 2Lucas De Marchi2013-09-201-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By aligning n_buckets to power of 2 we can turn the "bucket = hashval % n_buckets" into a less expensive bucket = hashval & (n_buckets - 1). This removes the DIV instruction as shown below. Before: xor %edx,%edx divl 0x8(%rbx) mov %edx,%eax add $0x1,%rax shl $0x4,%rax add %rbx,%rax After: lea -0x1(%rdi),%edx and %edx,%eax add $0x1,%rax shl $0x4,%rax add %rbx,%rax With a microbenchmark, measuring the time to locate the bucket (i.e. time_to_calculate_hashval + time_to_calculate_bucket_position) we have the results below (time in clock cycles): keylen before after 2-10 79.0 61.9 (-21.65%) 11-17 81.0 64.4 (-20.48%) 18-25 90.0 73.2 (-18.69%) 26-32 104.7 87.0 (-16.82%) 33-40 108.4 89.6 (-17.37%) 41-48 111.2 91.9 (-17.38%) 49-55 120.1 102.1 (-15.04%) 56-63 134.4 115.7 (-13.91%) As expected the gain is constant, regardless of the key length. The time to clculate the hashval varies with the key length, which explains the bigger gains for short keys.
* util: Add ALIGN_POWER2Lucas De Marchi2013-09-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add static inline function to align a value to it's next power of 2. This is commonly done by a SWAR like the one in: http://aggregate.org/MAGIC/#Next Largest Power of 2 However a microbench shows that the implementation herer is a faster. It doesn't really impact the possible user of this function, but it's interesting nonetheless. Using a x86_64 i7 Ivy Bridge it shows a ~4% advantage by using clz instead instead of the OR and SHL chain. And this is by using a BSR since Ivy Bridge doesn't have LZCNT. New Haswell processors have the LZCNT instruction which can make this even better. ARM also has a CLZ instruction so it should be better, too. Code used to test: ... v = val[i]; t1 = get_cycles(0); a = ALIGN_POWER2(v); t1 = get_cycles(t1); t2 = get_cycles(0); v = nlpo2(v); t2 = get_cycles(t2); printf("%u\t%llu\t%llu\t%d\n", v, t1, t2, v == a); ... In which val is an array of 20 random unsigned int, nlop2 is the SWAR implementation and get_cycles uses RDTSC to measure the performance. Averages: ALIGN_POWER2: 30 cycles nlop2: 31.4 cycles
* depmod: warn on invalid devname specificationTom Gundersen2013-09-101-3/+10
| | | | | | | | | | | | | | During the last merge window (3.12) a couple of modules gained devname aliases, but without the necessary major and minor information. These were then silently ignored when generating modules.devname. Complain loudly to avoid such errors sneaking in undetected in the future: depmod: ERROR: Module 'zram' has devname (zram) but lacks major and minor information. Ignoring. depmod: ERROR: Module 'uhid' has devname (uhid) but lacks major and minor information. Ignoring. Cc: Kay Sievers <kay@vrfy.org> Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* build: remove check for typeofLucas De Marchi2013-09-062-7/+0
| | | | | | | It's used in so many places without checking, that's really pointless to check for it in macro.h. Also remove AC_C_TYPEOF from configure.ac since we don't use -ansi.
* Add configure check for _Static_assert()Thomas Petazzoni2013-09-062-0/+11
| | | | | | | | | Commit 8efede20ef ("Use _Static_assert") introduced the usage of _Static_assert(). However, _Static_assert() is a fairly new thing, since it was introduced only in gcc 4.6. In order to support older compilers, this patch adds a configure.in test that checks whether _Static_assert() is usable or not, and adjust the behavior of the assert_cc() macro accordingly.
* Fix usage of readdir_r()Lucas De Marchi2013-08-293-64/+26
| | | | | | | | | | | | | | | | | | With readdir_r() we should be providing enough space to store the dir name. This could be accomplished by define an union like systemd does: union dirent_storage { struct dirent de; uint8_t storage[offsetof(struct dirent, d_name) + ((NAME_MAX + 1 + sizeof(long)) & ~(sizeof(long) - 1))]; }; However in all places that we use readdir_r() we have no concerns about reentrance nor we have problems with threads. Thus use the simpler readdir() instead. We also remove the error logging here (that could be added back by checking errno), but it was not adding much value so it's gone.
* testsuite: fix usage of reserved namesJohn Spencer2013-08-297-26/+26
| | | | | | | | | | | | stdout and stderr are names reserved for the implementation and musl uses them rightfully as macro - and the expansion causes (of course) unexpected results. rename the struct members stdout to out and stderr to err, to be 1) compliant 2) cause compilation to succeed. fixes build with musl libc.
* kmod 15v15Lucas De Marchi2013-08-223-3/+9
|
* libkmod: Fix getting param with no value from kcmdlineLucas De Marchi2013-08-131-1/+1
|
* testsuite: Add test for parameter with no value in kcmdlineLucas De Marchi2013-08-1314-0/+33
| | | | | Currently we fail to add the module option if the parameter doesn't have a value.
* depmod: add missing "else" clauseJan Engelhardt2013-08-092-2/+2
| | | | | | | | | | | It occurred to an openSUSE user that our mkinitrd would throw a warning when used with kmod: libkmod: conf_files_list: unsupported file mode /dev/null: 0x21b6 Grepping for the error message revealed that there might be a missing "else" keyword here, since it is unusual to put an "if" directly after closing brace.
* shell-completion: Make options accept '=' as last charLucas De Marchi2013-08-021-7/+29
|
* build: Install bash completion dataLucas De Marchi2013-07-302-2/+17
|
* shell-completion: Add kmod static-nodesLucas De Marchi2013-07-301-0/+25
|
* shell-completion: Add initial completion for kmodLucas De Marchi2013-07-302-1/+57
| | | | Based on journalctl and udevadm from systemd and adapted to kmod needs.
* NEWS: Add entriesLucas De Marchi2013-07-171-0/+10
|
* README: Move items from TODOLucas De Marchi2013-07-173-52/+58
| | | | | Put the differences between kmod and module-init-tools in the README file so it's more visible.
* static-nodes: create parent directories of output fileTom Gundersen2013-07-151-3/+9
| | | | Allows us to drop call to "mkdir -p" from the systemd service file.
* util: Add mkdir_parents()Lucas De Marchi2013-07-152-0/+12
| | | | Like mkdir_p, but discards the leaf, creating the parent directories.
* util: Add len arg to mkdir_p()Lucas De Marchi2013-07-153-6/+7
|
* static-nodes: don't fail if modules.devname not foundTom Gundersen2013-07-151-12/+19
| | | | | | | | In containers/VM's/initrd one might not have installed any modules and accompanying modules.devname Don't fail if this is the case, just warn. When used in systemd this means we don't get a failing unit on booting containers.
* util: Add mkdir_p implementation from testsuiteLucas De Marchi2013-07-156-109/+62
|
* testsuite: Fix mkdir_p corner casesLucas De Marchi2013-07-151-19/+32
| | | | | | | - Fix infinite loop when path is relative - Fix not considering EEXIST as a success - General refactor to mkdir_p so it never calls mkdir for an existing dir (given no one creates it from outside)
* Use "-internal" suffix instead of "-private"Lucas De Marchi2013-07-0414-21/+21
|
* tools: Do not link dynamically with libkmodLucas De Marchi2013-07-044-18/+13
| | | | | | | | | | | Instead of linking dynamically with libkmod, use libkmod-private.la. We disallow creating a static libkmod because we can't hide symbols there and it cause problems with external programs. However this should not prevent users that are only interested in the tools we provide not being able to ship only them keeping the library alone. Other projects also do this to allow our tools to use certain functions that should not be used outside of the project.
* kmod 14v14Lucas De Marchi2013-07-033-2/+21
|
* tools: Use test/kmod instead of kmod-nolibLucas De Marchi2013-07-025-16/+16
| | | | | | | | | | | | | | | | | | | | The reason to have a kmod-nolib binary is that we need to call kmod on test cases (or a symlink to it) and for testing things in tree. Since we are using libtool if we are dinamically linking to libkmod what we end up having is a shell script that (depending on the version *) changes argv[0] to contain an "lt-" prefix. Since this screws with our compat stuff, we had a kmod-nolib that links statically. This all workaround works fine iff we are using one of the compat commands, i.e. we are using the symlinks insmod, rmmod, modprobe, etc. However if we are actually trying the kmod binary, this doesn't work because we can't create a kmod symlink since there's already a kmod binary. So, completely give up on libtool fixing their mess. Now we create a tool/test/ directory and the symlinks and kmod is put there. * http://lists.gnu.org/archive/html/bug-libtool/2011-12/msg00023.html
* static-nodes: Better -f option descriptionLucas De Marchi2013-07-011-1/+1
|
* build-sys: do not allow --enable staticLucas De Marchi2013-06-061-0/+4
| | | | | | Do the same as done in systemd by Cristian Rodríguez <crrodriguez@opensuse.org>. We use private symbols, not namespaced. So don't pretend we support static linking.