Changeset 6c9b390 in rtems


Ignore:
Timestamp:
Nov 2, 2009, 9:50:06 AM (10 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, master
Children:
5ac15a5
Parents:
deb22fc
Message:

Fixed buffer recycling
Wake-up access waiters after sync

Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rdeb22fc r6c9b390  
     12009-11-02      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * libblock/src/bdbuf.c: Fixed buffer recycling.  See test
     4        "libtests/block03".
     5
     62009-11-02      Sebastian Huber <sebastian.huber@embedded-brains.de>
     7
     8        * libblock/src/bdbuf.c: Wake-up access waiters after sync.  See test
     9        "libtests/block04".
     10
    1112009-10-30      Glenn Humphrey <glenn.humphrey@oarcorp.com>
    212
  • cpukit/libblock/src/bdbuf.c

    rdeb22fc r6c9b390  
    11351135
    11361136    /*
    1137      * If this bd is already part of a group that supports the same number of
    1138      * BDs per group return it. If the bd is part of another group check the
    1139      * number of users and if 0 we can take this group and resize it.
     1137     * If nobody waits for this BD, we may recycle it.
    11401138     */
    1141     if (bd->group->bds_per_group == bds_per_group)
    1142     {
    1143       rtems_chain_extract (node);
    1144       return bd;
    1145     }
    1146 
    1147     if (bd->group->users == 0)
     1139    if (bd->waiters == 0)
    11481140    {
    11491141      /*
    1150        * We use the group to locate the start of the BDs for this group.
     1142       * If this bd is already part of a group that supports the same number of
     1143       * BDs per group return it. If the bd is part of another group check the
     1144       * number of users and if 0 we can take this group and resize it.
    11511145       */
    1152       rtems_bdbuf_group_realloc (bd->group, bds_per_group);
    1153       bd = (rtems_bdbuf_buffer*) rtems_chain_get (&bdbuf_cache.ready);
    1154       return bd;
     1146      if (bd->group->bds_per_group == bds_per_group)
     1147      {
     1148        rtems_chain_extract (node);
     1149        return bd;
     1150      }
     1151
     1152      if (bd->group->users == 0)
     1153      {
     1154        /*
     1155         * We use the group to locate the start of the BDs for this group.
     1156         */
     1157        rtems_bdbuf_group_realloc (bd->group, bds_per_group);
     1158        bd = (rtems_bdbuf_buffer*) rtems_chain_get (&bdbuf_cache.ready);
     1159        return bd;
     1160      }
    11551161    }
    11561162
     
    21602166  rtems_chain_append (&bdbuf_cache.sync, &bd->link);
    21612167
     2168  if (bd->waiters)
     2169    rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
     2170
    21622171  rtems_bdbuf_wake_swapper ();
    21632172
Note: See TracChangeset for help on using the changeset viewer.