Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/common/linux Fix post-cancellation case of ...



details:   https://anonhg.NetBSD.org/src/rev/6155e9ea0bb7
branches:  trunk
changeset: 366370:6155e9ea0bb7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 15:06:20 2018 +0000

description:
Fix post-cancellation case of queue_delayed_work.

Request the callout queue immediately, as if it hadn't been cancelled
at all, rather than reschedule for the next tick.

diffstat:

 sys/external/bsd/common/linux/linux_work.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 6aba18abdc2f -r 6155e9ea0bb7 sys/external/bsd/common/linux/linux_work.c
--- a/sys/external/bsd/common/linux/linux_work.c        Mon Aug 27 15:06:02 2018 +0000
+++ b/sys/external/bsd/common/linux/linux_work.c        Mon Aug 27 15:06:20 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_work.c,v 1.39 2018/08/27 15:06:02 riastradh Exp $        */
+/*     $NetBSD: linux_work.c,v 1.40 2018/08/27 15:06:20 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.39 2018/08/27 15:06:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.40 2018/08/27 15:06:20 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -869,8 +869,12 @@
                         * Scheduled and the callout began, but it was
                         * cancelled.  Reschedule it.
                         */
-                       dw->dw_state = DELAYED_WORK_RESCHEDULED;
-                       dw->dw_resched = MIN(INT_MAX, ticks);
+                       if (ticks == 0) {
+                               dw->dw_state = DELAYED_WORK_SCHEDULED;
+                       } else {
+                               dw->dw_state = DELAYED_WORK_RESCHEDULED;
+                               dw->dw_resched = MIN(INT_MAX, ticks);
+                       }
                        newly_queued = true;
                        break;
                default:



Home | Main Index | Thread Index | Old Index