lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [task #6957] make mem_free work with NO_SYS=1 to free pbufs


From: Simon Goldschmidt
Subject: [lwip-devel] [task #6957] make mem_free work with NO_SYS=1 to free pbufs from interrupt context
Date: Thu, 31 May 2007 08:17:50 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

URL:
  <http://savannah.nongnu.org/task/?6957>

                 Summary: make mem_free work with NO_SYS=1 to free pbufs from
interrupt context
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: goldsimon
            Submitted on: Donnerstag 31.05.2007 um 08:17
                Category: None
         Should Start On: Donnerstag 31.05.2007 um 00:00
   Should be Finished on: Donnerstag 31.05.2007 um 00:00
                Priority: 1 - Later
                  Status: None
                 Privacy: Public
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                  Effort: 0.00

    _______________________________________________________

Details:

With the current implementation, with NO_SYS=1, the heap is not protected
from concurrent access at all. In a no-sys, interrupt driven system, we have
SYS_ARCH_PROTECT to protect things like the memp pools, but have chosen not
to use this to protect the heap as it turns off interrupts for too long. The
downside is that (if we have no semaphores) the heap is not protected at all,
which means packets can't be freed (e.g. in a TX interrupt routine) if they
are of type PBUF_RAM (as most TX packets are).

We could solve this by looking if the heap is blocked and return 0 on
mem_malloc if so (that shouldn't happen so often since you don't alloc from a
heap in interrupt context). mem_free could put the mem-structs on some kind of
list that gets freed if the other context leaves the blocked region. That
blocking could be done with a 'bool' that is locked by SYS_ARCH_PROTECT.

Any other ideas?




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?6957>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]