From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbdCHOte (ORCPT ); Wed, 8 Mar 2017 09:49:34 -0500 Received: from mail-ua0-f182.google.com ([209.85.217.182]:33384 "EHLO mail-ua0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbdCHOtc (ORCPT ); Wed, 8 Mar 2017 09:49:32 -0500 Date: Tue, 7 Mar 2017 15:48:25 -0500 From: Tejun Heo To: Krzysztof Opasiak Cc: lizefan@huawei.com, hannes@cmpxchg.org, =?utf-8?Q?=C5=81ukasz?= Stelmach , linux-kernel@vger.kernel.org, Karol Lewandowski , cgroups@vger.kernel.org Subject: Re: counting file descriptors with a cgroup controller Message-ID: <20170307204825.GH31179@htj.duckdns.org> References: <87poihtaya.fsf%l.stelmach@samsung.com> <9a57890c-d9e9-5719-e155-ce1161795a02@samsung.com> <20170306185820.GA19696@htj.duckdns.org> <7fbd9c4c-76ca-4073-9afa-1ab54364ec79@samsung.com> <20170307194134.GE31179@htj.duckdns.org> <9ee62e45-6645-454b-11b5-85be746bc81a@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ee62e45-6645-454b-11b5-85be746bc81a@samsung.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Mar 07, 2017 at 09:06:49PM +0100, Krzysztof Opasiak wrote: > Personally, I don't want to use rlimit for this as it ends up returning > error code from for example open() when we hit the limit. This may lead to > some unpredictable crashes in services (esp. those poor proprietary binary > blobs). Instead of injecting errors to service we would like to just get > notification that this service has more opened fds than it should and ask it > to restart in a polite way. > > For memory seems to be quite easy to achieve as we can just get eventfd > notification when application passes given memory usage using memory cgroup > controller. Maybe you know some efficient method to do the same for fds? So, if all you wanna do is reliably detecting open(2) failures, can't you do that with bpf tracing? Thanks. -- tejun