linux-stable/kernel
Alexey Gladkov b6c3365289 Use atomic_t for ucounts reference counting
The current implementation of the ucounts reference counter requires the
use of spin_lock. We're going to use get_ucounts() in more performance
critical areas like a handling of RLIMIT_SIGPENDING.

Now we need to use spin_lock only if we want to change the hashtable.

v10:
* Always try to put ucounts in case we cannot increase ucounts->count.
  This will allow to cover the case when all consumers will return
  ucounts at once.

v9:
* Use a negative value to check that the ucounts->count is close to
  overflow.

Signed-off-by: Alexey Gladkov <legion@kernel.org>
Link: https://lkml.kernel.org/r/94d1dbecab060a6b116b0a2d1accd8ca1bbb4f5f.1619094428.git.legion@kernel.org
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
2021-04-30 14:14:01 -05:00
..
bpf bpf: Tighten speculative pointer arithmetic mask 2021-04-16 23:52:01 +02:00
cgroup idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
configs
debug kgdb: fix to kill breakpoints on initmem after boot 2021-02-26 09:41:05 -08:00
dma Merge branch 'stable/for-linus-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-02-26 13:59:32 -08:00
entry preempt/dynamic: Fix typo in macro conditional statement 2021-04-19 20:02:57 +02:00
events perf/core: Flush PMU internal buffers for per-CPU events 2021-03-06 12:52:39 +01:00
gcov Revert "gcov: clang: fix clang-11+ build" 2021-04-19 15:08:49 -07:00
irq genirq: Disable interrupts for force threaded handlers 2021-03-21 00:17:52 +01:00
kcsan
livepatch kallsyms: refactor {,module_}kallsyms_on_each_symbol 2021-02-08 12:22:08 +01:00
locking locking/qrwlock: Fix ordering in queued_write_lock_slowpath() 2021-04-17 13:40:50 +02:00
power PM: EM: postpone creating the debugfs dir till fs_initcall 2021-03-23 19:53:48 +01:00
printk Merge branch 'printk-rework' into for-linus 2021-02-22 13:43:55 +01:00
rcu Scheduler updates for v5.12: 2021-02-21 12:35:04 -08:00
sched sched/membarrier: fix missing local execution of ipi_sync_rq_state() 2021-03-06 12:40:21 +01:00
time kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data() 2021-03-16 22:13:10 +01:00
trace tracing: Fix tp_printk command line and trace events 2021-04-20 14:38:35 -07:00
.gitignore
acct.c
async.c
audit.c
audit.h
audit_fsnotify.c audit_alloc_mark(): don't open-code ERR_CAST() 2021-02-23 10:25:27 -05:00
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
backtracetest.c
bounds.c
capability.c
compat.c
configs.c
context_tracking.c
cpu.c
cpu_pm.c
crash_core.c
crash_dump.c
cred.c Add a reference to ucounts for each cred 2021-04-30 14:14:00 -05:00
delayacct.c
dma.c
exec_domain.c
exit.c
extable.c
fail_function.c
fork.c Add a reference to ucounts for each cred 2021-04-30 14:14:00 -05:00
freezer.c Revert "kernel: freezer should treat PF_IO_WORKER like PF_KTHREAD for freezing" 2021-03-27 14:09:10 -06:00
futex.c kernel, fs: Introduce and use set_restart_fn() and arch_set_restart_data() 2021-03-16 22:13:10 +01:00
gen_kheaders.sh
groups.c groups: simplify struct group_info allocation 2021-02-26 09:41:03 -08:00
hung_task.c
iomem.c
irq_work.c
jump_label.c static_call: Fix static_call_update() sanity check 2021-03-19 13:16:44 +01:00
kallsyms.c kallsyms: only build {,module_}kallsyms_on_each_symbol when required 2021-02-08 12:24:04 +01:00
kcmp.c
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt preempt: Introduce CONFIG_PREEMPT_DYNAMIC 2021-02-17 14:12:24 +01:00
kcov.c
kexec.c
kexec_core.c Merge branch 'work.elf-compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2021-02-21 09:29:23 -08:00
kexec_elf.c
kexec_file.c ima: Free IMA measurement buffer after kexec syscall 2021-02-10 15:49:38 -05:00
kexec_internal.h kexec: move machine_kexec_post_load() to public interface 2021-02-22 12:33:26 +00:00
kheaders.c
kmod.c
kprobes.c kprobes: Fix to delay the kprobes jump optimization 2021-02-19 14:57:12 -05:00
ksysfs.c
kthread.c
latencytop.c
Makefile kcmp: Support selection of SYS_kcmp without CHECKPOINT_RESTORE 2021-02-16 09:59:41 +01:00
module-internal.h
module.c module: potential uninitialized return in module_kallsyms_on_each_symbol() 2021-02-10 16:57:04 +01:00
module_signature.c
module_signing.c
notifier.c
nsproxy.c
padata.c
panic.c
params.c
pid.c
pid_namespace.c
profile.c
ptrace.c Revert "kernel: treat PF_IO_WORKER like PF_KTHREAD for ptrace/signals" 2021-03-27 14:09:10 -06:00
range.c
reboot.c Revert "PM: ACPI: reboot: Use S5 for reboot" 2021-03-18 16:58:02 +01:00
regset.c
relay.c
resource.c
resource_kunit.c
rseq.c
scftorture.c
scs.c
seccomp.c seccomp: Improve performace by optimizing rmb() 2021-02-10 12:40:11 -08:00
signal.c Revert "signal: don't allow STOP on PF_IO_WORKER threads" 2021-03-27 14:09:11 -06:00
smp.c smp: Process pending softirqs in flush_smp_call_function_from_idle() 2021-02-17 14:12:42 +01:00
smpboot.c
smpboot.h
softirq.c softirq: Move do_softirq_own_stack() to generic asm header 2021-02-10 23:34:16 +01:00
stackleak.c
stacktrace.c
static_call.c static_call: Fix static_call_update() sanity check 2021-03-19 13:16:44 +01:00
stop_machine.c
sys.c Add a reference to ucounts for each cred 2021-04-30 14:14:00 -05:00
sys_ni.c
sysctl-test.c
sysctl.c sysctl.c: fix underflow value setting risk in vm_table 2021-02-26 09:41:03 -08:00
task_work.c
taskstats.c
test_kprobes.c
torture.c
tracepoint.c tracepoints: Code clean up 2021-02-09 12:27:29 -05:00
tsacct.c
ucount.c Use atomic_t for ucounts reference counting 2021-04-30 14:14:01 -05:00
uid16.c
uid16.h
umh.c
up.c
user-return-notifier.c
user.c
user_namespace.c Add a reference to ucounts for each cred 2021-04-30 14:14:00 -05:00
usermode_driver.c bpf: Fix umd memory leak in copy_process() 2021-03-19 22:23:19 +01:00
utsname.c
utsname_sysctl.c
watch_queue.c watch_queue: rectify kernel-doc for init_watch() 2021-01-26 11:16:34 +00:00
watchdog.c workqueue/watchdog: Make unbound workqueues aware of touch_softlockup_watchdog() 2021-04-04 13:26:49 -04:00
watchdog_hld.c
workqueue.c workqueue/watchdog: Make unbound workqueues aware of touch_softlockup_watchdog() 2021-04-04 13:26:49 -04:00
workqueue_internal.h