Use PWAIT in esm(4/i386)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Use PWAIT in esm(4/i386)

Martin Pieuchot
Sleeping at PUSER when coming from a sysctl context is purely arbitrary.
I'd like to reduce the number of PUSER usages to help people understand
the current scheduler logic.

Ok?

Index: arch/i386/i386/esm.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/esm.c,v
retrieving revision 1.59
diff -u -p -r1.59 esm.c
--- arch/i386/i386/esm.c 8 Sep 2015 07:12:56 -0000 1.59
+++ arch/i386/i386/esm.c 1 Jun 2019 16:05:18 -0000
@@ -331,7 +331,7 @@ esm_watchdog(void *arg, int period)
  * should have a process context we can sleep in.
  */
  while (sc->sc_step != 0) {
- if (tsleep(sc, PUSER | PCATCH, "esm", 0) == EINTR) {
+ if (tsleep(sc, PWAIT | PCATCH, "esm", 0) == EINTR) {
  splx(s);
  return (sc->sc_wdog_period);
  }

Reply | Threaded
Open this post in threaded view
|

Re: Use PWAIT in esm(4/i386)

Mark Kettenis
> Date: Sun, 9 Jun 2019 12:02:22 -0300
> From: Martin Pieuchot <[hidden email]>
>
> Sleeping at PUSER when coming from a sysctl context is purely arbitrary.
> I'd like to reduce the number of PUSER usages to help people understand
> the current scheduler logic.
>
> Ok?

ok kettenis@

> Index: arch/i386/i386/esm.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/i386/i386/esm.c,v
> retrieving revision 1.59
> diff -u -p -r1.59 esm.c
> --- arch/i386/i386/esm.c 8 Sep 2015 07:12:56 -0000 1.59
> +++ arch/i386/i386/esm.c 1 Jun 2019 16:05:18 -0000
> @@ -331,7 +331,7 @@ esm_watchdog(void *arg, int period)
>   * should have a process context we can sleep in.
>   */
>   while (sc->sc_step != 0) {
> - if (tsleep(sc, PUSER | PCATCH, "esm", 0) == EINTR) {
> + if (tsleep(sc, PWAIT | PCATCH, "esm", 0) == EINTR) {
>   splx(s);
>   return (sc->sc_wdog_period);
>   }
>
>