[Xenomai-git] New commits on branch wip/heapmem
URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e1f60e82c09119b63bab8674356ae744aa460cdd Author: Philippe Gerum Date: Sun Apr 22 19:50:57 2018 +0200 copperplate/heapobj: enable heapmem for private memory Make HEAPMEM the default private memory allocator for real-time configurations (cobalt || (mercury && non-debug)). This setting can be reverted by passing --with-localmem=tlsf. URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f20c742f6585fd53e5ff12be6b04d5081ec4a158 Author: Philippe Gerum Date: Sun Apr 22 18:20:04 2018 +0200 testsuite/smokey: add test suite for memory allocators URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ebc1dbb901e4db2a3175ecf4fda668201d47227b Author: Philippe Gerum Date: Mon Apr 23 10:47:28 2018 +0200 copperplate/heapobj-pshared: add helper to return the total heap size URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=99cad85489858b0557f4461bf85bcb7d66a93559 Author: Philippe Gerum Date: Fri Apr 13 12:15:15 2018 +0200 boilerplate: add heapmem allocator This is the umpteenth incarnation of the McKusick allocator, aimed at replacing other allocators which have serious issues: - TLSF is fast but not that good when it comes to memory overhead with small sizes (i.e. < 512 bytes) on 64bit. - heapobj-pshared has decent overhead figures but may be insanely slow at deallocating blocks from large, hot heaps. - the Cobalt core allocator is even worse than heapobj-pshared in deallocating blocks, although the system heap should be generally small enough not to trigger the most pathological cases in practice, hopefully. Nevertheless, the performances are unacceptable. The original McKusick algorithm implements a quick fit allocation scheme, based on bucket management of ^2-sized chunks, which automatically switches to a page-based allocation method for blocks larger than twice the base page size. This variant maintains the free page list in AVL trees for fast lookups of multi-page memory ranges, and pages holding bucketed memory have a quick allocation bitmap to manage their blocks internally. The current implementation can replace TLSF for delivering process-local memory with similar performances but lesser overhead with small sizes. Most importantly, a kernel variant of HEAPMEM should replace the Cobalt core allocator. Likewise, heapobj-pshared which is beyond repair should be replaced with a process-shareable variant as well, assuming the average size and allocation patterns of real-time objects are similar in all contexts. URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=43347d7fee5dd752eb0c93ac3d5568e5ac80b810 Author: Philippe Gerum Date: Mon Apr 23 10:28:49 2018 +0200 boilerplate: compiler: add more helpers and attribute tags URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1c556dc7b8f8bd5fe7bd981a0e8ecb715f44b8aa Author: Philippe Gerum Date: Mon Apr 23 18:29:46 2018 +0200 smokey: add helper to retrieve size expr URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=94a220039395ef6d89d911ce3aec86744b5607d6 Author: Philippe Gerum Date: Mon Apr 23 18:03:07 2018 +0200 smokey: argument accessors using variables URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=138588cba6f58af2b98c011833e5678c4365001c Author: Gilles Chanteperdrix Date: Tue Jul 12 20:29:22 2016 +0200 boilerplate/avl: merge pshared support for AVL trees Make the AVL tree usable in shared memory when AVL_SHARED is defined at build time, switching to offset-based memory references. Gilles published this code in July 2016 as part of his personal toolkit for hobby projects aka 'libchutils'. URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=171beb05487c7e34ea04db82fda6782d6ad89ffa Author: Norbert Lange Date: Wed Apr 25 15:05:00 2018 +0200 demo/posix, testsuite/smokey: silences some compiler warnings Signed-off-by: Norbert Lange URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bc646282da46d32ce4c203aa477b72ea294ae535 Author: Jan Kiszka Date: Wed Apr 18 14:51:00 2018 +0200 cobalt/synch: Clear PP boost prior to handing over the ownership Otherwise we first add the synch object to the new owner's boost list before we remove it from the old one's, corrupting the list. Signed-off-by: Jan Kiszka URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=95193cce02aae6d075662d749370c8bff962ab33 Author: Jan Kiszka Date: Wed Apr 18 14:51:00 2018 +0200 testsuite/smokey: Add handover test for prio-ceiling mutexes This triggers a bug in the PP implementation. Signed-off-by: Jan Kiszka URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=a8ee84d645eb98de10d855cb18e318479ba8395f Author: Philippe Gerum Date
[Xenomai-git] Philippe Gerum : copperplate/registry: switch back to private memory for fs objects
Module: xenomai-3 Branch: stable-3.0.x Commit: 3568a12e797aa35d80650dff3acabcc14ce081ac URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3568a12e797aa35d80650dff3acabcc14ce081ac Author: Philippe Gerum Date: Sat Apr 28 18:45:15 2018 +0200 copperplate/registry: switch back to private memory for fs objects Partially revert #8e606e681, keeping registry_add_dir/file() routines free from Cobalt mode switches, a property which some applications might assume when creating specific rt objects (e.g. Alchemy's mutexes, condvars). --- lib/copperplate/registry.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/copperplate/registry.c b/lib/copperplate/registry.c index 0f675ef..1d15448 100644 --- a/lib/copperplate/registry.c +++ b/lib/copperplate/registry.c @@ -116,13 +116,13 @@ int registry_add_dir(const char *fmt, ...) write_lock_safe(&p->lock, state); - d = __STD(malloc(sizeof(*d))); + d = pvmalloc(sizeof(*d)); if (d == NULL) { ret = -ENOMEM; goto done; } pvholder_init(&d->link); - d->path = strdup(path); + d->path = pvstrdup(path); if (strcmp(path, "/")) { d->basename = d->path + (basename - path) + 1; @@ -149,8 +149,8 @@ int registry_add_dir(const char *fmt, ...) &pvhash_operations); if (ret) { fail: - __STD(free(d->path)); - __STD(free(d)); + pvfree(d->path); + pvfree(d); } done: write_unlock_safe(&p->lock, state); @@ -203,7 +203,7 @@ int registry_add_file(struct fsobj *fsobj, int mode, const char *fmt, ...) if (basename == NULL) return __bt(-EINVAL); - fsobj->path = strdup(path); + fsobj->path = pvstrdup(path); fsobj->basename = fsobj->path + (basename - path) + 1; fsobj->mode = mode & O_ACCMODE; __RT(clock_gettime(CLOCK_COPPERPLATE, &fsobj->ctime)); @@ -224,7 +224,7 @@ int registry_add_file(struct fsobj *fsobj, int mode, const char *fmt, ...) ret = -ENOENT; fail: pvhash_remove(&p->files, &fsobj->hobj, &pvhash_operations); - __STD(free(fsobj->path)); + pvfree(fsobj->path); fsobj->path = NULL; goto done; } @@ -263,7 +263,7 @@ void registry_destroy_file(struct fsobj *fsobj) pvlist_remove(&fsobj->link); d->nfiles--; assert(d->nfiles >= 0); - __STD(free(fsobj->path)); + pvfree(fsobj->path); __RT(pthread_mutex_unlock(&fsobj->lock)); out: __RT(pthread_mutex_destroy(&fsobj->lock)); @@ -693,7 +693,7 @@ static int spawn_daemon(const char *sessdir, int flags) break; } - __STD(free(path)); + free(path); return ret; } ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] New commits on branch next
URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=171beb05487c7e34ea04db82fda6782d6ad89ffa Author: Norbert Lange Date: Wed Apr 25 15:05:00 2018 +0200 demo/posix, testsuite/smokey: silences some compiler warnings Signed-off-by: Norbert Lange URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bc646282da46d32ce4c203aa477b72ea294ae535 Author: Jan Kiszka Date: Wed Apr 18 14:51:00 2018 +0200 cobalt/synch: Clear PP boost prior to handing over the ownership Otherwise we first add the synch object to the new owner's boost list before we remove it from the old one's, corrupting the list. Signed-off-by: Jan Kiszka URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=95193cce02aae6d075662d749370c8bff962ab33 Author: Jan Kiszka Date: Wed Apr 18 14:51:00 2018 +0200 testsuite/smokey: Add handover test for prio-ceiling mutexes This triggers a bug in the PP implementation. Signed-off-by: Jan Kiszka URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=a8ee84d645eb98de10d855cb18e318479ba8395f Author: Philippe Gerum Date: Fri Mar 30 15:01:40 2018 +0200 net/via-rhine: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ed9d0be858e53610815e57690f203e9bc529a05f Author: Philippe Gerum Date: Fri Mar 30 15:01:30 2018 +0200 net/tulip: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6a975b12ed597e09f93b13ad56b660c8bd1dca59 Author: Philippe Gerum Date: Fri Mar 30 15:01:23 2018 +0200 net/r8169: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=14dd76a323de2723d13178ebae449c2a33d95efc Author: Philippe Gerum Date: Fri Mar 30 15:01:10 2018 +0200 net/pcnet32: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=94a5b3d5700bbe61838216f28539d5606ec3afb5 Author: Philippe Gerum Date: Fri Mar 30 15:01:02 2018 +0200 net/natsemi: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6e53e8f7b66afa4ca89207a49f19fe7fb72d98de Author: Philippe Gerum Date: Fri Mar 30 15:00:56 2018 +0200 net/macb: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=83826bcbd3a8fff7297cdab1700c2c50e600 Author: Philippe Gerum Date: Fri Mar 30 15:00:48 2018 +0200 net/fec: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b7b544b524c0169ac5fd608977204be95b4cdd5e Author: Philippe Gerum Date: Fri Mar 30 15:00:39 2018 +0200 net/eepro100: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=15f034e80f756d1cdbff4988e49ba75899aaf371 Author: Philippe Gerum Date: Fri Mar 30 15:00:26 2018 +0200 net/e1000: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=85545ab5b754a70827de6bb29266b628371a6946 Author: Philippe Gerum Date: Fri Mar 30 15:00:02 2018 +0200 net/at91: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7fb9353344e52c5a09e5cbf206176321e0ee9d41 Author: Philippe Gerum Date: Fri Mar 30 14:59:51 2018 +0200 net/8139too: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c534c1e8c3050b133eb39abf96783941fee82f62 Author: Philippe Gerum Date: Fri Mar 30 13:09:19 2018 +0200 net/igb: add adapter symlink into sysfs attributes URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6dbf0c470f4e50e65c8c6a4565f7ddd1e6275000 Author: Philippe Gerum Date: Fri Mar 30 12:53:34 2018 +0200 net: create sysfs nodes for net devices Each rtnet device registered with the stack is represented by a node into /sys/devices/virtual/rtnet/. Setting the address of the real device probed by the kernel into the rtnet_device.sysbind field before calling rt_register_rtnetdev(), causes the "adapter" symlink to be installed in the newly created attribute directory, pointing at that device. e.g. static int probe_handler(struct pci_dev *pdev, const struct pci_device_id *ent) { ... rtdev->sysbind = &pdev->dev; ... ret = rt_register_rtnetdev(rtdev); ... } $ ls -l /sys/devices/virtual/rtnet/ total 0 drwxr-xr-x2 root root 0 Mar 30 12:50 enp1s0 drwxr-xr-x2 root root 0 Mar 30 12:50 rtlo $ ls -l /sys/devices/virtual/rtnet/enp1s0/ total 0 lrwxrwxrwx1 root root 0 Mar 30 12:51 adapter -> ../../../pci:00/:00:13.0/:01:00.0 lrwxrwxrwx1 root root 0 Mar 30 12:51 subsystem -> ../../../../class/rtnet -rw-r--r--1
[Xenomai-git] Philippe Gerum : boilerplate/tlsf: raise the fixed private heap size to 64k
Module: xenomai-3 Branch: stable-3.0.x Commit: 04565eeb83633f431a5303e0f15132ecc485c93e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=04565eeb83633f431a5303e0f15132ecc485c93e Author: Philippe Gerum Date: Sat Apr 28 18:28:10 2018 +0200 boilerplate/tlsf: raise the fixed private heap size to 64k When --enable-pshared is passed, we currently have no mean to specify the size of the private heap managed by TLSF. Until this issue is fixed, increase the fixed size of the private heap to 64k, so that running OOM in the few remaining code spots calling the pvmalloc* API becomes unlikely. --- lib/boilerplate/tlsf/tlsf.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/boilerplate/tlsf/tlsf.h b/lib/boilerplate/tlsf/tlsf.h index 766b992..aac4769 100644 --- a/lib/boilerplate/tlsf/tlsf.h +++ b/lib/boilerplate/tlsf/tlsf.h @@ -22,7 +22,7 @@ #include /* A basic heap size which won't be rejected by init_memory_pool(). */ -#define MIN_TLSF_HEAPSZ 8192 +#define MIN_TLSF_HEAPSZ 65536 extern size_t init_memory_pool(size_t, void *); extern size_t get_used_size(void *); ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git