Re: [Xenomai-core] [PATCH v2 2/3] nucleus: Include all heaps in statistics

2009-10-20 Thread Philippe Gerum
On Mon, 2009-10-19 at 21:09 +0200, Jan Kiszka wrote:
 Gilles Chanteperdrix wrote:
  Jan Kiszka wrote:
  @@ -234,12 +239,65 @@ int xnheap_init(xnheap_t *heap,
   
 appendq(heap-extents, extent-link);
   
  +  vsnprintf(heap-name, sizeof(heap-name), name, args);
  +
  +  spin_lock(heapq_lock);
  +  appendq(heapq, heap-stat_link);
  +  spin_unlock(heapq_lock);
  
  You can not use a Linux spinlock in xnheap_init and xnheap_destroy:
  - this breaks the build for the simulator;
  - callers of xnheap_init and xnheap_destroy are not guaranteed to run on
  the root domain.
 
 Oh, yes, unfortunately. That callers appear to be fixable, but that's
 probably not worth it at this point.

There is nothing to fix here. It's part of the service definition to be
able to call it from primary mode.

  I will have to rewrite
 heap_read_proc to break out of nklock frequently. Also not nice, but
 less invasive.
 
 Jan
 
 ___
 Xenomai-core mailing list
 Xenomai-core@gna.org
 https://mail.gna.org/listinfo/xenomai-core
-- 
Philippe.



___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH v2 2/3] nucleus: Include all heaps in statistics

2009-10-20 Thread Jan Kiszka
Philippe Gerum wrote:
 On Mon, 2009-10-19 at 21:09 +0200, Jan Kiszka wrote:
 Gilles Chanteperdrix wrote:
 Jan Kiszka wrote:
 @@ -234,12 +239,65 @@ int xnheap_init(xnheap_t *heap,
  
appendq(heap-extents, extent-link);
  
 +  vsnprintf(heap-name, sizeof(heap-name), name, args);
 +
 +  spin_lock(heapq_lock);
 +  appendq(heapq, heap-stat_link);
 +  spin_unlock(heapq_lock);
 You can not use a Linux spinlock in xnheap_init and xnheap_destroy:
 - this breaks the build for the simulator;
 - callers of xnheap_init and xnheap_destroy are not guaranteed to run on
 the root domain.
 Oh, yes, unfortunately. That callers appear to be fixable, but that's
 probably not worth it at this point.
 
 There is nothing to fix here. It's part of the service definition to be
 able to call it from primary mode.

Strictly spoken not. But given that xnheap_init_mapped does not fulfill
this promise and that quite a few users have an either-or use of this
tuple, it doesn't buy us much to allow primary mode.

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH v2 2/3] nucleus: Include all heaps in statistics

2009-10-19 Thread Gilles Chanteperdrix
Jan Kiszka wrote:
 @@ -234,12 +239,65 @@ int xnheap_init(xnheap_t *heap,
  
   appendq(heap-extents, extent-link);
  
 + vsnprintf(heap-name, sizeof(heap-name), name, args);
 +
 + spin_lock(heapq_lock);
 + appendq(heapq, heap-stat_link);
 + spin_unlock(heapq_lock);

You can not use a Linux spinlock in xnheap_init and xnheap_destroy:
- this breaks the build for the simulator;
- callers of xnheap_init and xnheap_destroy are not guaranteed to run on
the root domain.

-- 
Gilles.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH v2 2/3] nucleus: Include all heaps in statistics

2009-10-19 Thread Jan Kiszka
Gilles Chanteperdrix wrote:
 Jan Kiszka wrote:
 @@ -234,12 +239,65 @@ int xnheap_init(xnheap_t *heap,
  
  appendq(heap-extents, extent-link);
  
 +vsnprintf(heap-name, sizeof(heap-name), name, args);
 +
 +spin_lock(heapq_lock);
 +appendq(heapq, heap-stat_link);
 +spin_unlock(heapq_lock);
 
 You can not use a Linux spinlock in xnheap_init and xnheap_destroy:
 - this breaks the build for the simulator;
 - callers of xnheap_init and xnheap_destroy are not guaranteed to run on
 the root domain.

Oh, yes, unfortunately. That callers appear to be fixable, but that's
probably not worth it at this point. I will have to rewrite
heap_read_proc to break out of nklock frequently. Also not nice, but
less invasive.

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core