[cats-devel] Re: [Spawner] prolonging limits

  • From: Alexander Klenin <klenin@xxxxxxxxx>
  • To: cats-devel@xxxxxxxxxxxxx
  • Date: Sat, 13 Jun 2015 10:02:27 +1000

On Fri, Jun 12, 2015 at 9:12 PM, Denis Rotanov <denis@xxxxxxxxxxx> wrote:

On 12.06.2015 19:32, Denis Rotanov wrote:

All user, processor and idleness time limits are being stored as micro
seconds in unsigned int. If I set e.g. user time limit to -d=1 then after
430 turns I'll get 430`000`000. And check_limits_proc multiplies that by 10
before comparison, which results in overflow. I wonder what I should do. I
see only two solutions 1. decrease granularity i.e. store at least
milliseconds. 2. at least unsigned long long instead of unsigned int.

I think I should not prolong limits by actually incrementing restriction
values, but to set flag like "do_prolong_limits_" and then in limits check
thread remember the current values of time props into `base_time_user` and
`base_time_processor` and drop the flag then. So I will compare (current -
base) vs. limit.

To be honest, I think all three changes you suggest are justified.

--
Alexander S. Klenin

Other related posts: