All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Extensible heaps - needed for the future?
Date: Sun, 11 Dec 2005 20:35:14 +0100	[thread overview]
Message-ID: <439C7F72.90809@domain.hid> (raw)
In-Reply-To: <439C6CB9.6050605@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2341 bytes --]

Philippe Gerum wrote:
> Jan Kiszka wrote:
> 
>> Hi,
>>
>> I noticed that xnhead_extend() is not used at the moment [1], thus the
>> whole extent management is redundent for now. Are there plans to use it
>> in the future? Should we keep this feature?
>>
>> I'm asking as I still have the idea in my head of breaking up the heap
>> service and introducing a generic allocator interface to select
>> different heap allocators at compile time. So, should extensions be an
>> optional feature of an allocator?
> 
> 
> Keep in mind that the native API is a plain client of the abstract RTOS
> implemented by the nucleus, nothing more. What the native API does not
> use in this area would probably be useful to other clients though. For
> instance, the VRTX skin locally reimplements its own heap extension
> system that could be replaced by the nucleus one -- and should.
> 

I did not get your point yet. To ask more directly: what functionality
should a generic real-time allocator for arbitrary size objects should
provide then?

We currently have this situation regarding the heap core:

    xnheap_init(heap, heap_memory, heap_size, page_size)
    xnheap_destroy(heap, flush_handler, handler_cookie)

    xnheap_extend(heap, extent_memory, extent_size)

    block = xnheap_alloc(heap, size)
    xnheap_test_and_free(heap, block, release_check_function)

I did not list the other functions, which are more or less wrappers
around this core (i.e. they do not need to know how the heap memory is
managed internally).

For now I have two open topics on my list:

 o page_size is BSD-allocator specific, other algorithms may need other
   arguments. We will likely rather need good defaults (isn't the
   system's page size passed here anyway?) and maybe some other
   interface to tune them.

 o As far as I understood, xnhead_extend() adds another chunk of memory
   to an existing heap. That chunk is additionally considered when
   allocating some block from that heap. Side effect: the more chunks
   you add, the longer a search may become. As I did not find any user
   of this feature and as this inherent O(n) regarding the allocation
   requires careful usage anyway, I was wondering if it is actually
   useful. If a real-time heap is too small, I would rather reserve more
   initial size (just like XENO_OPT_SYS_HEAPSZ works).

Jan

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

      reply	other threads:[~2005-12-11 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-11 17:43 [Xenomai-core] Extensible heaps - needed for the future? Jan Kiszka
2005-12-11 18:15 ` Philippe Gerum
2005-12-11 19:35   ` Jan Kiszka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=439C7F72.90809@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.