Add logic to reset the replenish the sporadic scheduler when a task is resumed

This commit is contained in:
Gregory Nutt 2015-07-24 09:54:28 -06:00
parent 39192c3537
commit 9d98177daa
14 changed files with 43 additions and 109 deletions

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/arm/up_unblocktask.c
*
* Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -93,13 +93,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv6-m/up_unblocktask.c
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -91,13 +91,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/arm_unblocktask.c
*
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -93,13 +93,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-m/up_unblocktask.c
*
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -92,13 +92,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/avr/src/avr/up_unblocktask.c
*
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -92,13 +92,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/avr/src/avr32/up_unblocktask.c
*
* Copyright (C) 2010, 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2010, 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -93,13 +93,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/hc/src/common/up_unblocktask.c
*
* Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -93,13 +93,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/mips/src/mips32/up_unblocktask.c
*
* Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -95,13 +95,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -330,14 +330,12 @@ void up_unblock_task(struct tcb_s *tcb)
struct tcb_s *rtcb = current_task;
/* Remove the task from the blocked task list */
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
/* Reset scheduler parameters */
sched_resume_scheduler(tcb);
// Add the task in the correct location in the prioritized
// g_readytorun task list.

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_unblocktask.c
*
* Copyright (C) 2008-2009, 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -93,13 +93,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/sim/src/up_unblocktask.c
*
* Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -47,18 +47,6 @@
#include "sched/sched.h"
#include "up_internal.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@ -94,13 +82,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/x86/src/common/up_unblocktask.c
*
* Copyright (C) 2011, 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -92,13 +92,9 @@ void up_unblock_task(struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* common/up_unblocktask.c
*
* Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -96,13 +96,9 @@ void up_unblock_task(FAR struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/src/common/up_unblocktask.c
*
* Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -98,13 +98,9 @@ void up_unblock_task(FAR struct tcb_s *tcb)
sched_removeblocked(tcb);
/* Reset its timeslice. This is only meaningful for round
* robin tasks but it doesn't here to do it for everything
*/
/* Reset scheduler parameters */
#if CONFIG_RR_INTERVAL > 0
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
#endif
sched_resume_scheduler(tcb);
/* Add the task in the correct location in the prioritized
* g_readytorun task list