increase timers allowed per-process

Review Request #2567 — Created May 26, 2020 and submitted

jbk
illumos-gate
12789
general

increase timers allowed per-process



  • 1
  • 0
  • 10
  • 2
  • 13
Description From Last Updated
why did we lose the comment about dropping p_lock here? It's unusual behaviour (and I'm not clear why we even ... jlevon jlevon
yuripv
  1. 
      
  2. Does using the assert()'s in test case make sense? Getting descriptive failure reason instead of a core seems better to me.

    1. I'll make it error out.

  3. usr/src/uts/common/os/timer.c (Diff revision 1)
     
     

    Not needed anymore?

    1. It either needs that or p needs __unused since it's only accessed in DEBUG builds (it'd be nice to have a __debugused or like that translates into nothing or __unused as appropriate, but probably needs it's own change.

    2. Hmm, does gcc really understand ARGSUSED? I thought it's lint-only, and thus can go.

  4. usr/src/uts/common/os/timer.c (Diff revision 1)
     
     

    And here we could check for != NULL and going to line 578, reducing indentation even further which helps readability.

    1. There's some additional SmartOS changes (that are LX specific) that build on this. I'd prefer to avoid changing this, as it'll make merging future illumos-gate stuff a pretty big headache.

    2. Yep, that was just a generic note as the code seems to hit the right margin :)

  5. usr/src/uts/common/os/timer.c (Diff revision 1)
     
     

    This else isn't really needed as we did 'goto' in other branch, removing it would help reduce indentation.

  6. 
      
jbk
jbk
jbk
jlevon
  1. 
      
  2. usr/src/uts/common/os/timer.c (Diff revision 4)
     
     

    Takes the lock without being named as such, and keeps it even on error? I'm not a fan! Please just take p_lock before its single call site, then make it assert its held when we call it.

    1. I reworked the code a bit so hopefully it's clearer.

  3. usr/src/uts/common/os/timer.c (Diff revision 4)
     
     

    inverting this check would reduce indentation of the rest, and make the common path more obvious

  4. usr/src/uts/common/os/timer.c (Diff revision 4)
     
     

    why did we lose the comment about dropping p_lock here? It's unusual behaviour (and I'm not clear why we even do it)

  5. 
      
jlevon
  1. 
      
  2. usr/src/uts/common/sys/timer.h (Diff revision 4)
     
     

    If we're going to document this we should clarify that this is clamped to a minimum of NCPUS * 4 ?

  3. 
      
danmcd
  1. 
      
  2. usr/src/uts/common/os/timer.c (Diff revision 4)
     
     

    NIT: Why the braces for a single-line return (NULL);?

    1. We are in general too brace-light rather than too brace-heavy, I feel. If we were to revise our C style in 2020, I'd be inclined to remove the need to think about it and just say braces everywhere.

  3. usr/src/uts/common/os/timer.c (Diff revision 4)
     
     

    Same nit here.

  4. usr/src/uts/common/sys/proc.h (Diff revision 4)
     
     

    NOTE TO SELF: There are a LOT of holes in "struct proc" that should probably cause a rearrangement.

  5. 
      
jbk
  1. 
      
  2. usr/src/uts/common/os/timer.c (Diff revision 4)
     
     

    I suspect the reason is to avoid holding p->p_lock while doing a KM_SLEEP alloc. However, that can be worked around fairly easily.

  3. usr/src/uts/common/os/timer.c (Diff revision 4)
     
     

    I can rearrange things here that I think make it easier to follow.

  4. usr/src/uts/common/os/timer.c (Diff revision 4)
     
     

    I think the idea is to avoid holding p->p_lock during a sleeping alloc.

  5. usr/src/uts/common/sys/timer.h (Diff revision 4)
     
     
  6. 
      
jbk
danmcd
  1. The two nits aren't enough to block this, and I like the post-John rewhack as well.

  2. 
      
jlevon
  1. 
      
  2. usr/src/uts/common/os/timer.c (Diff revision 5)
     
     

    nit, "have been"

  3. usr/src/uts/common/os/timer.c (Diff revision 5)
     
     

    nit, could reformat?

  4. 
      
jbk
jlevon
  1. Ship It!
  2. 
      
danmcd
  1. Ship It!
  2. 
      
jbk
Review request changed

Status: Closed (submitted)

Loading...