cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Krzysztof Opasiak <k.opasiak@samsung.com>
Cc: lizefan@huawei.com, hannes@cmpxchg.org,
	"Łukasz Stelmach" <l.stelmach@samsung.com>,
	linux-kernel@vger.kernel.org,
	"Karol Lewandowski" <k.lewandowsk@samsung.com>,
	cgroups@vger.kernel.org
Subject: Re: counting file descriptors with a cgroup controller
Date: Wed, 8 Mar 2017 13:59:47 -0500	[thread overview]
Message-ID: <20170308185947.GA9976@htj.duckdns.org> (raw)
In-Reply-To: <50e07c29-295a-62fd-e0ad-7e52d5b55c7d@samsung.com>

On Wed, Mar 08, 2017 at 10:52:18AM +0100, Krzysztof Opasiak wrote:
> Well detecting failures of open is not enough and it has couple of problems:
> 
> 1) open(2) is not the only syscall which creates fd. In addition to other
> syscalls like socket(2), dup(2), some ioctl() on drivers (for example video)
> also creates fds. I'm not sure if we have any other mechanism than grep
> through kernel source to find out which ioctl() creates fd or and which not.
> 
> 2) As far as I know (I'm not a bpf specialist so please correct me if I'm
> wrong), with bpf we are able only to detect such events but we are unable to
> prevent them from getting to caller. It means that service will know that it
> run out of fds and will need to handle this properly. If there is a bug in
> this error path service may crash.
> What we would like to get is just a notification to external process that
> some limit has been reached without returning error to service itself.
> 
> 3) Theoretically we could do this using bpf or syscall auditing and count
> fds for each userspace process or check /proc/<PID> after each notification
> but it's getting very heavy for production environment.

We simply can't design the kernel to accomodate bandaid workarounds
for grossly misbehaving applications.  If you can find something which
can solve the problem using wider scope tools like bpf, seccomp, and
what not, great.  If not, too bad, but we can't burdern everyone else
with workarounds for the extremely specific and contrived issues that
you're seeing.

Thanks.

-- 
tejun

      reply	other threads:[~2017-03-08 18:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170217093725eucas1p12478baf297d25303f3020f4973fbf3b0@eucas1p1.samsung.com>
     [not found] ` <87poihtaya.fsf%l.stelmach@samsung.com>
     [not found]   ` <9a57890c-d9e9-5719-e155-ce1161795a02@samsung.com>
     [not found]     ` <9a57890c-d9e9-5719-e155-ce1161795a02-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2017-03-06 18:58       ` counting file descriptors with a cgroup controller Tejun Heo
     [not found]         ` <20170306185820.GA19696-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2017-03-07 11:19           ` Krzysztof Opasiak
2017-03-07 19:41             ` Tejun Heo
     [not found]               ` <20170307194134.GE31179-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2017-03-07 20:06                 ` Krzysztof Opasiak
     [not found]                   ` <9ee62e45-6645-454b-11b5-85be746bc81a-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2017-03-07 20:48                     ` Tejun Heo
     [not found]                       ` <20170307204825.GH31179-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2017-03-08  2:59                         ` Parav Pandit
     [not found]                           ` <CAG53R5VQrm-c-F8GdqJ9fx4n+=QU5n3gT-9adx4HqRO_R8BOaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-08 10:19                             ` Krzysztof Opasiak
2017-03-08  9:52                       ` Krzysztof Opasiak
2017-03-08 18:59                         ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170308185947.GA9976@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=k.lewandowsk@samsung.com \
    --cc=k.opasiak@samsung.com \
    --cc=l.stelmach@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).