Linux cgroups development
 help / color / mirror / Atom feed
From: brookxu <brookxu.cn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
	lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC PATCH v2 1/3] misc_cgroup: add support for nofile limit
Date: Tue, 27 Jul 2021 11:18:00 +0800	[thread overview]
Message-ID: <b2ff6f80-8ec6-e260-ec42-2113e8ce0a18@gmail.com> (raw)
In-Reply-To: <YP8ovYqISzKC43mt-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>


Thanks for your time.

Tejun Heo wrote on 2021/7/27 5:27:
> On Thu, Jul 22, 2021 at 11:20:17PM +0800, brookxu wrote:
>> From: Chunguang Xu <brookxu-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
>>
>> Since the global open files are limited, in order to avoid the
>> abnormal behavior of some containers from generating too many
>> files, causing other containers to be unavailable, we need to
>> limit the open files of some containers.
>>
>> v2: fix compile error while CONFIG_CGROUP_MISC not set.
>>
>> Signed-off-by: Chunguang Xu <brookxu-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
>> Reported-by: kernel test robot <lkp-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> This is different from pid in that there's no actual limit on how many open
> files there can be in the system other than the total amount of available
> memory. I don't see why this would need a separate limit outside of memory
> control. A couple machines I looked at all have file-max at LONG_MAX by
> default too.

According to files_maxfiles_init(), we only allow about 10% of free memory to
create filps, and each filp occupies about 1K of cache. In this way, on a 16G
memory machine, the maximum usable filp is about 1,604,644. In general
scenarios, this may not be a big problem, but if the task is abnormal, it will
very likely become a bottleneck and affect other modules. 

> Thanks.
> 

  parent reply	other threads:[~2021-07-27  3:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 15:20 [RFC PATCH v2 1/3] misc_cgroup: add support for nofile limit brookxu
2021-07-22 15:20 ` [RFC PATCH v2 2/3] misc_cgroup: add failcnt counter brookxu
     [not found] ` <3fd94563b4949ffbfe10e7d18ac1df3852b103a6.1626966339.git.brookxu-1Nz4purKYjRBDgjK7y7TUQ@public.gmane.org>
2021-07-22 15:20   ` [RFC PATCH v2 3/3] misc_cgroup: delete failed logs to avoid log flooding brookxu
2021-07-26 21:27 ` [RFC PATCH v2 1/3] misc_cgroup: add support for nofile limit Tejun Heo
     [not found]   ` <YP8ovYqISzKC43mt-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2021-07-27  3:18     ` brookxu [this message]
     [not found]       ` <b2ff6f80-8ec6-e260-ec42-2113e8ce0a18-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2021-07-27 16:32         ` Tejun Heo
2021-07-28  3:17           ` brookxu
2021-07-28  7:41             ` Tejun Heo
     [not found]               ` <YQEKNPrrOuyxTarN-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2021-07-28  9:47                 ` brookxu
2021-07-28 15:38                   ` Tejun Heo
     [not found]                     ` <YQF5/8Zb/iY5DS7f-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2021-07-29  6:37                       ` brookxu

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=b2ff6f80-8ec6-e260-ec42-2113e8ce0a18@gmail.com \
    --to=brookxu.cn-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lizefan.x-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    /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