Changeset 6fb003f in rtems-libbsd


Ignore:
Timestamp:
Jul 26, 2018, 10:03:45 AM (10 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
b5f8d4831d66364b7391e3660560cb9bbecada2e, 31b5c87357cee83d6a3419c5d801a9bf16912714
Children:
3df89c0
Parents:
94b5368
Message:

Fix sporadic test failures via uma_timeout()

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sys/vm/uma.h

    r94b5368 r6fb003f  
    696696void uma_reclaim_worker(void *);
    697697
     698#ifdef __rtems__
     699void rtems_uma_drain_timeout(void);
     700#endif /* __rtems__ */
    698701#endif  /* _VM_UMA_H_ */
  • freebsd/sys/vm/uma_core.c

    r94b5368 r6fb003f  
    38153815#endif  /* DDB */
    38163816#endif /* __rtems__ */
     3817#ifdef __rtems__
     3818/*
     3819 * This is a helper routine for test programs.  The uma_timeout() may need some
     3820 * dynamic memory.  This could disturb out of memory tests.
     3821 */
     3822void
     3823rtems_uma_drain_timeout(void)
     3824{
     3825
     3826        callout_drain(&uma_callout);
     3827}
     3828#endif /* __rtems__ */
  • testsuite/syscalls01/test_main.c

    r94b5368 r6fb003f  
    11/*
    2  * Copyright (c) 2013 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2013, 2018 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    3939#include <sys/time.h>
    4040#include <sys/filio.h>
     41#include <vm/uma.h>
    4142#include <netinet/in.h>
    4243#include <arpa/inet.h>
     
    16001601}
    16011602
    1602 static void set_self_prio(rtems_task_priority prio)
    1603 {
    1604   rtems_status_code sc;
    1605 
    1606   sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio);
    1607   assert(sc == RTEMS_SUCCESSFUL);
    1608 }
    1609 
    16101603static void
    16111604test_main(void)
     
    16131606
    16141607        /*
    1615          * No interruptions by the timer server.  The uma_timeout() may need
    1616          * some dynamic memory.  This could disturb the no memory tests.
     1608         * Stop interferences of uma_timeout() which may need some dynamic
     1609         * memory.  This could disturb the no memory tests.
    16171610         */
    1618         set_self_prio(1);
     1611        rtems_uma_drain_timeout();
    16191612
    16201613        /* Must be first test to ensure resource checks work */
  • testsuite/thread01/test_main.c

    r94b5368 r6fb003f  
    11/*
    2  * Copyright (c) 2013-2014 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2013, 2018 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    4444#include <sys/errno.h>
    4545
     46#include <vm/uma.h>
     47
    4648#include <rtems/bsd/bsd.h>
    4749
     
    285287test_main(void)
    286288{
     289
    287290        main_task_id = rtems_task_self();
     291
     292        /*
     293         * Stop interferences of uma_timeout() which may need some dynamic
     294         * memory.  This could disturb the no memory tests.
     295         */
     296        rtems_uma_drain_timeout();
    288297
    289298        test_non_bsd_thread();
Note: See TracChangeset for help on using the changeset viewer.