* [linux-next:master 5063/5087] kernel/user.c:141:28: error: 'struct user_struct' has no member named 'epoll_watches'
@ 2021-08-03 22:55 kernel test robot
2021-08-04 0:06 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-08-03 22:55 UTC (permalink / raw)
To: Nicholas Piggin
Cc: kbuild-all, Linux Memory Management List, Mark Brown, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 4072 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: c3f7b3be172b39d90b4c5cb87a2231cc6c2c8dcf
commit: e75b894778116889e88995d0e5029c2e9f6d847c [5063/5087] fs/epoll: use a per-cpu counter for user's watches count
config: ia64-randconfig-r015-20210803 (attached as .config)
compiler: ia64-linux-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=e75b894778116889e88995d0e5029c2e9f6d847c
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout e75b894778116889e88995d0e5029c2e9f6d847c
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from arch/ia64/include/asm/pgtable.h:153,
from include/linux/pgtable.h:6,
from arch/ia64/include/asm/uaccess.h:40,
from include/linux/uaccess.h:11,
from arch/ia64/include/asm/sections.h:11,
from include/linux/interrupt.h:20,
from kernel/user.c:18:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:127:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
127 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
kernel/user.c: In function 'free_user':
>> kernel/user.c:141:28: error: 'struct user_struct' has no member named 'epoll_watches'
141 | percpu_counter_destroy(&up->epoll_watches);
| ^~
In file included from include/linux/sched/user.h:7,
from kernel/user.c:17:
kernel/user.c: In function 'alloc_uid':
kernel/user.c:189:31: error: 'struct user_struct' has no member named 'epoll_watches'
189 | if (percpu_counter_init(&new->epoll_watches, 0, GFP_KERNEL)) {
| ^~
include/linux/percpu_counter.h:38:25: note: in definition of macro 'percpu_counter_init'
38 | __percpu_counter_init(fbc, value, gfp, &__key); \
| ^~~
kernel/user.c:203:31: error: 'struct user_struct' has no member named 'epoll_watches'
203 | percpu_counter_destroy(&new->epoll_watches);
| ^~
In file included from include/linux/sched/user.h:7,
from kernel/user.c:17:
kernel/user.c: In function 'uid_cache_init':
kernel/user.c:225:36: error: 'struct user_struct' has no member named 'epoll_watches'
225 | if (percpu_counter_init(&root_user.epoll_watches, 0, GFP_KERNEL))
| ^
include/linux/percpu_counter.h:38:25: note: in definition of macro 'percpu_counter_init'
38 | __percpu_counter_init(fbc, value, gfp, &__key); \
| ^~~
vim +141 kernel/user.c
131
132 /* IRQs are disabled and uidhash_lock is held upon function entry.
133 * IRQ state (as stored in flags) is restored and uidhash_lock released
134 * upon function exit.
135 */
136 static void free_user(struct user_struct *up, unsigned long flags)
137 __releases(&uidhash_lock)
138 {
139 uid_hash_remove(up);
140 spin_unlock_irqrestore(&uidhash_lock, flags);
> 141 percpu_counter_destroy(&up->epoll_watches);
142 kmem_cache_free(uid_cachep, up);
143 }
144
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29851 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-next:master 5063/5087] kernel/user.c:141:28: error: 'struct user_struct' has no member named 'epoll_watches'
2021-08-03 22:55 [linux-next:master 5063/5087] kernel/user.c:141:28: error: 'struct user_struct' has no member named 'epoll_watches' kernel test robot
@ 2021-08-04 0:06 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2021-08-04 0:06 UTC (permalink / raw)
To: kernel test robot
Cc: Nicholas Piggin, kbuild-all, Linux Memory Management List, Mark Brown
On Wed, 4 Aug 2021 06:55:13 +0800 kernel test robot <lkp@intel.com> wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: c3f7b3be172b39d90b4c5cb87a2231cc6c2c8dcf
> commit: e75b894778116889e88995d0e5029c2e9f6d847c [5063/5087] fs/epoll: use a per-cpu counter for user's watches count
>
> ...
>
> kernel/user.c: In function 'free_user':
> >> kernel/user.c:141:28: error: 'struct user_struct' has no member named 'epoll_watches'
> 141 | percpu_counter_destroy(&up->epoll_watches);
> | ^~
not pretty, but...
--- a/kernel/user.c~fs-epoll-use-a-per-cpu-counter-for-users-watches-count-fix
+++ a/kernel/user.c
@@ -138,7 +138,9 @@ static void free_user(struct user_struct
{
uid_hash_remove(up);
spin_unlock_irqrestore(&uidhash_lock, flags);
+#ifdef CONFIG_EPOLL
percpu_counter_destroy(&up->epoll_watches);
+#endif
kmem_cache_free(uid_cachep, up);
}
@@ -186,10 +188,12 @@ struct user_struct *alloc_uid(kuid_t uid
new->uid = uid;
refcount_set(&new->__count, 1);
+#ifdef CONFIG_EPOLL
if (percpu_counter_init(&new->epoll_watches, 0, GFP_KERNEL)) {
kmem_cache_free(uid_cachep, new);
return NULL;
}
+#endif
ratelimit_state_init(&new->ratelimit, HZ, 100);
ratelimit_set_flags(&new->ratelimit, RATELIMIT_MSG_ON_RELEASE);
@@ -200,7 +204,9 @@ struct user_struct *alloc_uid(kuid_t uid
spin_lock_irq(&uidhash_lock);
up = uid_hash_find(uid, hashent);
if (up) {
+#ifdef CONFIG_EPOLL
percpu_counter_destroy(&new->epoll_watches);
+#endif
kmem_cache_free(uid_cachep, new);
} else {
uid_hash_insert(new, hashent);
@@ -222,8 +228,10 @@ static int __init uid_cache_init(void)
for(n = 0; n < UIDHASH_SZ; ++n)
INIT_HLIST_HEAD(uidhash_table + n);
+#ifdef CONFIG_EPOLL
if (percpu_counter_init(&root_user.epoll_watches, 0, GFP_KERNEL))
- panic("percpu cpunter alloc failed");
+ panic("percpu counter alloc failed");
+#endif
/* Insert the root user immediately (init already runs as root) */
spin_lock_irq(&uidhash_lock);
_
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-04 0:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 22:55 [linux-next:master 5063/5087] kernel/user.c:141:28: error: 'struct user_struct' has no member named 'epoll_watches' kernel test robot
2021-08-04 0:06 ` Andrew Morton
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).