Hi brookxu,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on cgroup/for-next]
[also build test ERROR on linux/master linus/master v5.14-rc2 next-20210722]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/brookxu/misc_cgroup-add-support-...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
config: x86_64-randconfig-a003-20210722 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
#
https://github.com/0day-ci/linux/commit/5f2344b35ac15d834c4b76284f89f68c6...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
brookxu/misc_cgroup-add-support-for-nofile-limit/20210722-174033
git checkout 5f2344b35ac15d834c4b76284f89f68c68634638
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/file_table.c: In function 'file_free':
> fs/file_table.c:58:29: error: implicit declaration of function
'css_misc' [-Werror=implicit-function-declaration]
58 | struct
misc_cg *misc_cg = css_misc(f->f_css);
| ^~~~~~~~
> fs/file_table.c:58:39: error: 'struct file' has no member
named 'f_css'
58 | struct misc_cg *misc_cg = css_misc(f->f_css);
| ^~
fs/file_table.c: In function 'alloc_empty_file':
fs/file_table.c:170:4: error: 'struct file' has no member named
'f_css'
170 | f->f_css = &misc_cg->css;
| ^~
> fs/file_table.c:170:22: error: invalid use of undefined type
'struct misc_cg'
170 | f->f_css = &misc_cg->css;
| ^~
cc1: some warnings being treated as errors
vim +/css_misc +58 fs/file_table.c
53
54 static inline void file_free(struct file *f)
55 {
56 security_file_free(f);
57 if (!(f->f_mode & FMODE_NOACCOUNT)) {
58 struct misc_cg *misc_cg = css_misc(f->f_css);
59
60 misc_cg_uncharge(MISC_CG_RES_NOFILE, misc_cg, 1);
61 put_misc_cg(misc_cg);
62
63 percpu_counter_dec(&nr_files);
64 }
65 call_rcu(&f->f_u.fu_rcuhead, file_free_rcu);
66 }
67
68 /*
69 * Return the total number of open files in the system
70 */
71 static long get_nr_files(void)
72 {
73 return percpu_counter_read_positive(&nr_files);
74 }
75
76 /*
77 * Return the maximum number of open files in the system
78 */
79 unsigned long get_max_files(void)
80 {
81 return files_stat.max_files;
82 }
83 EXPORT_SYMBOL_GPL(get_max_files);
84
85 /*
86 * Handle nr_files sysctl
87 */
88 #if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS)
89 int proc_nr_files(struct ctl_table *table, int write,
90 void *buffer, size_t *lenp, loff_t *ppos)
91 {
92 files_stat.nr_files = get_nr_files();
93 return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
94 }
95 #else
96 int proc_nr_files(struct ctl_table *table, int write,
97 void *buffer, size_t *lenp, loff_t *ppos)
98 {
99 return -ENOSYS;
100 }
101 #endif
102
103 static struct file *__alloc_file(int flags, const struct cred *cred)
104 {
105 struct file *f;
106 int error;
107
108 f = kmem_cache_zalloc(filp_cachep, GFP_KERNEL);
109 if (unlikely(!f))
110 return ERR_PTR(-ENOMEM);
111
112 f->f_cred = get_cred(cred);
113 error = security_file_alloc(f);
114 if (unlikely(error)) {
115 file_free_rcu(&f->f_u.fu_rcuhead);
116 return ERR_PTR(error);
117 }
118
119 atomic_long_set(&f->f_count, 1);
120 rwlock_init(&f->f_owner.lock);
121 spin_lock_init(&f->f_lock);
122 mutex_init(&f->f_pos_lock);
123 f->f_flags = flags;
124 f->f_mode = OPEN_FMODE(flags);
125 /* f->f_version: 0 */
126
127 return f;
128 }
129
130 /* Find an unused file structure and return a pointer to it.
131 * Returns an error pointer if some error happend e.g. we over file
132 * structures limit, run out of memory or operation is not permitted.
133 *
134 * Be very careful using this. You are responsible for
135 * getting write access to any mount that you might assign
136 * to this filp, if it is opened for write. If this is not
137 * done, you will imbalance int the mount's writer count
138 * and a warning at __fput() time.
139 */
140 struct file *alloc_empty_file(int flags, const struct cred *cred)
141 {
142 static long old_max;
143 struct file *f;
144
145 /*
146 * Privileged users can go above max_files
147 */
148 if (get_nr_files() >= files_stat.max_files && !capable(CAP_SYS_ADMIN))
{
149 /*
150 * percpu_counters are inaccurate. Do an expensive check before
151 * we go and fail.
152 */
153 if (percpu_counter_sum_positive(&nr_files) >= files_stat.max_files)
154 goto over;
155 }
156
157 f = __alloc_file(flags, cred);
158 if (!IS_ERR(f)) {
159 struct misc_cg *misc_cg = get_current_misc_cg();
160 int ret;
161
162 ret = misc_cg_try_charge(MISC_CG_RES_NOFILE, misc_cg, 1);
163 if (ret < 0) {
164 put_misc_cg(misc_cg);
165 file_free(f);
166 goto out;
167 }
168
169 percpu_counter_inc(&nr_files);
170 f->f_css = &misc_cg->css;
171 }
172
173 return f;
174
175 over:
176 /* Ran out of filps - report that */
177 if (get_nr_files() > old_max) {
178 pr_info("VFS: file-max limit %lu reached\n", get_max_files());
179 old_max = get_nr_files();
180 }
181 out:
182 return ERR_PTR(-ENFILE);
183 }
184
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org