linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: brookxu <brookxu.cn@gmail.com>
To: Tejun Heo <tj@kernel.org>
Cc: viro@zeniv.linux.org.uk, lizefan.x@bytedance.com,
	hannes@cmpxchg.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org
Subject: Re: [RFC PATCH v2 1/3] misc_cgroup: add support for nofile limit
Date: Wed, 28 Jul 2021 11:17:08 +0800	[thread overview]
Message-ID: <ca2bdc60-f117-e917-85b1-8c9ec0c6942f@gmail.com> (raw)
In-Reply-To: <YQA1D1GRiF9+px/s@mtj.duckdns.org>



Tejun Heo wrote on 2021/7/28 12:32 上午:
> Hello,
> 
> On Tue, Jul 27, 2021 at 11:18:00AM +0800, brookxu wrote:
>> 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. 
> 
> Yeah but that can be configured trivially through sysfs. The reason why the
> default limit is lowered is because we wanna prevent a part of system to
> consume all the memory through fds. With cgroups, we already have that
> protection and at least some systems already configure file-max to maximum,
> so I don't see a point in adding another interface to subdivide the
> artificial limit.
> 

Yeah we can adjust file-max through sysctl, but in many cases we adjust it according
to the actual load of the machine, not for abnormal tasks. Another problem is that in
practical applications, kmem_limit will cause some minor problems. In many cases,
kmem_limit is disabled. Limit_in_bytes mainly counts user pages and pagecache, which
may cause files_cache to be out of control. In this case, if file-max is set to MAX,
we may have a risk in the abnormal scene, which prevents us from recovering from the
abnormal scene. Maybe I missed something.

> Thanks.
> 

  reply	other threads:[~2021-07-28  3:17 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
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
2021-07-27  3:18   ` brookxu
2021-07-27 16:32     ` Tejun Heo
2021-07-28  3:17       ` brookxu [this message]
2021-07-28  7:41         ` Tejun Heo
2021-07-28  9:47           ` brookxu
2021-07-28 15:38             ` Tejun Heo
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=ca2bdc60-f117-e917-85b1-8c9ec0c6942f@gmail.com \
    --to=brookxu.cn@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).