title: Is it safe to skip account_process_tick for a given task?
body: <p>I have a Linux <code>Loadable Kernel Module</code> where I hook <code>account_process_tick</code> Kernel function.</p>
  <p>This function checks if <code>tsk</code> has a <code>PF_INVISIBLE</code> flag and if it does then it returns <code>void</code> to skip the account process tick. If <code>tsk</code> doesn't have a <code>PF_INVISIBLE</code> flag then we return the original <code>account_process_tick</code> Kernel function.</p>
  <pre class="lang-c prettyprint-override"><code>/* This is our hook function for account_process_tick */
  static asmlinkage void hook_account_process_tick(struct task_struct *tsk, int user)
  {
      if (tsk-&gt;flags &amp; PF_INVISIBLE) {
          return;
      }
  
      return orig_account_process_tick(tsk, user);
  }
  </code></pre>
  <p>The goal of this code is to supress from commands like <code>top</code> the global CPU usage for given <code>tsk</code>.</p>
  <p>Everything works as expected. Now I would love to know if there's any caveat doing this. Would this make my system more unstable or even crash it? If we look at the Linux Kernel source code we can see that my code is skipping <a href="https://github.com/torvalds/linux/blob/26c19d0a8610fb233b31730fe26a31145f2d9796/include/linux/kernel_stat.h#L109" rel="nofollow noreferrer">vtime_flush</a> function for these <code>tsk</code>. How safe is this? Is important what <code>vtime_flush</code> does or it just computes the accounting time and then flushes it?</p>