Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1421692
| Path | csiph.com!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Alexey Dobriyan <adobriyan@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [RFC 06/18] limits: present RLIMIT_CPU and RLIMIT_RTTIMER current status |
| Date | Tue, 14 Jun 2016 11:20:01 +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> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ipCRqjK8uZXWY9cSjOD3gHZCNjZj2nTbPOj+hPvxomA=; b=wvyLxkc4HKjHLUKkDUQG9628h7Nq3qNWBP4gohRkhE+k+lzCyMAbARWTkAc6VQOY3U 4FV/UDcfFU05BjPVQPu7CX8DR9CYItTs4WCB+1i/q8DWONeuo0BYNg4nd6yRiYgWIBE8 v8jVKivIkdAdEWFOm64ciJSES2B76qsMFJ5GWremlgh8jW/w9ORDcKeUgv1VLkBpYz9d t0vUFQwL4SbSgqpGhRsSxkVC+G0pp8A7Z42gwfsk9UxMGbLxZQOW7QNqlwh4zku+3mYc /TQ3cDL3EW4bwvZ6a548VXeJtsZ9ip8dqyZ7y+k9lHtCyh6QUKXBIH/FG6nWPTgE+qSU c5Vg== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ipCRqjK8uZXWY9cSjOD3gHZCNjZj2nTbPOj+hPvxomA=; b=A1CtyN+4ZI/J52IFLRC1+CFo7b4ZGP9ByI0m2gKGLs+KbgScN95xwDTHLL3Z4X7V6+ qKJj0wk8mTZ5hOIKXogNl73diNaE26UFB52qc6DapiJmqsKSLvniQCpVtW1nLKU1SYxK zmZL8twkwBQW3B8cT038cCyooVWfi6MIgfx43ppUCl50eCISsk/trMJqNO9ev0pEfp4m lT9bplQiowciF11AleYzX6TKWyghXJxLz7jFi6E1YbsLho5j1tGUmGDOor8+MH0p/QdV MqkNIqmcSdwvUgwwR/1kVst1M532V6gr0nRLWZr1V3ns9XOuiG7QQ8cpmpfeNMIDKfZt M2HQ== |
| X-Gm-Message-State | ALyK8tL2UqalNnLDQ3OSlUSdNJI7cT6C2mlQ8Sqp5mLNvktu4diabCCW7Q+yEzdpnihD6aj9/5gWhkGZbDM+2Q== |
| X-Received | by 10.28.195.135 with SMTP id t129mr3729789wmf.78.1465895691757; Tue, 14 Jun 2016 02:14:51 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 27 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Linux Kernel <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Kees Cook <keescook@chromium.org>, Al Viro <viro@zeniv.linux.org.uk>, John Stultz <john.stultz@linaro.org>, Janis Danisevskis <jdanis@google.com>, Calvin Owens <calvinowens@fb.com>, Jann Horn <jann@thejh.net> |
| X-Original-Date | Tue, 14 Jun 2016 12:14:51 +0300 |
| X-Original-Message-ID | <CACVxJT_GOooEqFpGMRA=k7eLUzBG3YqqUqjogUnHbS3J=mYU-w@mail.gmail.com> |
| X-Original-References | <1465847065-3577-1-git-send-email-toiwoton@gmail.com> <1465847065-3577-7-git-send-email-toiwoton@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1421692 |
Show key headers only | 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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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