Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1421692

Re: [RFC 06/18] limits: present RLIMIT_CPU and RLIMIT_RTTIMER current status

From Alexey Dobriyan <adobriyan@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC 06/18] limits: present RLIMIT_CPU and RLIMIT_RTTIMER current status
Date 2016-06-14 11:20 +0200
Message-ID <rJSFP-2Rh-7@gated-at.bofh.it> (permalink)
References <rJG1X-2jr-7@gated-at.bofh.it> <rJG1Y-2jr-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jun 13, 2016 at 10:44 PM, Topi Miettinen <toiwoton@gmail.com> wrote:
> Present current cputimer status in /proc/self/limits.

> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -650,8 +650,30 @@ static int proc_pid_limits(struct seq_file *m, struct pid_namespace *ns,
> +               switch (i) {
> +               case RLIMIT_RTTIME:
> +               case RLIMIT_CPU:
> +                       if (rlim[i].rlim_max == RLIM_INFINITY)
> +                               seq_printf(m, "%-20s\n", "-");
> +                       else {
> +                               unsigned long long utime, ptime;
> +                               unsigned long psecs;
> +                               struct task_cputime cputime;
> +
> +                               thread_group_cputimer(task, &cputime);
> +                               utime = cputime_to_expires(cputime.utime);
> +                               ptime = utime + cputime_to_expires(cputime.stime);
> +                               psecs = cputime_to_secs(ptime);
> +                               if (i == RLIMIT_RTTIME)
> +                                       psecs *= USEC_PER_SEC;
> +                               seq_printf(m, "%-20lu\n", psecs);
> +                       }
> +                       break;

Let's keep rlimits file for rlimits.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC 00/18] Present useful limits to user Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
  [RFC 16/18] limits: track RLIMIT_NICE actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
  [RFC 03/18] memcontrol: present maximum used memory also for cgroup-v2 Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 03/18] memcontrol: present maximum used memory also for  cgroup-v2 Michal Hocko <mhocko@kernel.org> - 2016-06-14 09:10 +0200
      Re: [RFC 03/18] memcontrol: present maximum used memory also for  cgroup-v2 Topi Miettinen <toiwoton@gmail.com> - 2016-06-14 17:50 +0200
        Re: [RFC 03/18] memcontrol: present maximum used memory also for  cgroup-v2 Johannes Weiner <hannes@cmpxchg.org> - 2016-06-14 18:10 +0200
          Re: [RFC 03/18] memcontrol: present maximum used memory also for  cgroup-v2 Topi Miettinen <toiwoton@gmail.com> - 2016-06-14 19:20 +0200
            Re: [RFC 03/18] memcontrol: present maximum used memory also for  cgroup-v2 Michal Hocko <mhocko@kernel.org> - 2016-06-16 12:30 +0200
  [RFC 02/18] cgroup_pids: track maximum pids Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 02/18] cgroup_pids: track maximum pids Tejun Heo <tj@kernel.org> - 2016-06-13 23:20 +0200
      Re: [RFC 02/18] cgroup_pids: track maximum pids Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 23:30 +0200
        Re: [RFC 02/18] cgroup_pids: track maximum pids Tejun Heo <tj@kernel.org> - 2016-06-13 23:40 +0200
          Re: [RFC 02/18] cgroup_pids: track maximum pids Topi Miettinen <toiwoton@gmail.com> - 2016-06-14 00:00 +0200
            Re: [RFC 02/18] cgroup_pids: track maximum pids Tejun Heo <tj@kernel.org> - 2016-06-14 00:10 +0200
  [RFC 01/18] capabilities: track actually used capabilities Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 01/18] capabilities: track actually used capabilities Andy Lutomirski <luto@amacapital.net> - 2016-06-13 22:40 +0200
      Re: [RFC 01/18] capabilities: track actually used capabilities Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 22:50 +0200
        Re: [RFC 01/18] capabilities: track actually used capabilities Andy Lutomirski <luto@amacapital.net> - 2016-06-13 23:20 +0200
          Re: [RFC 01/18] capabilities: track actually used capabilities Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 23:50 +0200
  [RFC 18/18] proc: present VM_LOCKED memory in /proc/self/maps Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 18/18] proc: present VM_LOCKED memory in /proc/self/maps Kees Cook <kees@outflux.net> - 2016-06-13 23:00 +0200
      Re: [RFC 18/18] proc: present VM_LOCKED memory in /proc/self/maps Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 23:00 +0200
  [RFC 14/18] limits: track RLIMIT_SIGPENDING actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 14/18] limits: track RLIMIT_SIGPENDING actual max Oleg Nesterov <oleg@redhat.com> - 2016-06-14 17:00 +0200
      Re: [RFC 14/18] limits: track RLIMIT_SIGPENDING actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-14 18:00 +0200
  [RFC 05/18] limits: track and present RLIMIT_NOFILE actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 05/18] limits: track and present RLIMIT_NOFILE actual max Andy Lutomirski <luto@kernel.org> - 2016-06-13 22:50 +0200
      Re: [RFC 05/18] limits: track and present RLIMIT_NOFILE actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 23:20 +0200
        Re: [RFC 05/18] limits: track and present RLIMIT_NOFILE actual max Andy Lutomirski <luto@amacapital.net> - 2016-06-13 23:20 +0200
          Re: [RFC 05/18] limits: track and present RLIMIT_NOFILE actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-14 17:30 +0200
  [RFC 15/18] limits: track RLIMIT_MSGQUEUE actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 15/18] limits: track RLIMIT_MSGQUEUE actual max Doug Ledford <dledford@redhat.com> - 2016-06-17 22:00 +0200
  [RFC 06/18] limits: present RLIMIT_CPU and RLIMIT_RTTIMER current status Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 06/18] limits: present RLIMIT_CPU and RLIMIT_RTTIMER current status Alexey Dobriyan <adobriyan@gmail.com> - 2016-06-14 11:20 +0200
  [RFC 11/18] limits: track and present RLIMIT_NPROC actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 11/18] limits: track and present RLIMIT_NPROC actual max Jann Horn <jann@thejh.net> - 2016-06-14 00:30 +0200
      Re: [RFC 11/18] limits: track and present RLIMIT_NPROC actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-14 17:50 +0200
        Re: [RFC 11/18] limits: track and present RLIMIT_NPROC actual max Jann Horn <jann@thejh.net> - 2016-06-15 01:20 +0200
  [RFC 17/18] limits: track RLIMIT_RTPRIO actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
  [RFC 04/18] device_cgroup: track and present accessed devices Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
    Re: [RFC 04/18] device_cgroup: track and present accessed devices "Serge E. Hallyn" <serge@hallyn.com> - 2016-06-17 17:30 +0200
  [RFC 10/18] limits: track RLIMIT_STACK actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
  [RFC 08/18] limits: track RLIMIT_DATA actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
  [RFC 13/18] limits: track RLIMIT_AS actual max Topi Miettinen <toiwoton@gmail.com> - 2016-06-13 21:50 +0200
  Re: [RFC 00/18] Present useful limits to user Konstantin Khlebnikov <koct9i@gmail.com> - 2016-06-14 21:10 +0200
    Re: [RFC 00/18] Present useful limits to user Topi Miettinen <toiwoton@gmail.com> - 2016-06-14 21:50 +0200
    Re: [RFC 00/18] Present useful limits to user "Austin S. Hemmelgarn" <ahferroin7@gmail.com> - 2016-06-15 16:50 +0200
      Re: [RFC 00/18] Present useful limits to user Konstantin Khlebnikov <koct9i@gmail.com> - 2016-06-18 16:50 +0200
        Re: [RFC 00/18] Present useful limits to user Topi Miettinen <toiwoton@gmail.com> - 2016-06-19 08:40 +0200
        Re: [RFC 00/18] Present useful limits to user "Austin S. Hemmelgarn" <ahferroin7@gmail.com> - 2016-06-20 19:50 +0200

csiph-web