No description
Find a file
Uladzislau Rezki (Sony) 9b81af9c84 rcu/tree: Defer kvfree_rcu() allocation to a clean context
[ Upstream commit 56292e8609 ]

The current memmory-allocation interface causes the following difficulties
for kvfree_rcu():

a) If built with CONFIG_PROVE_RAW_LOCK_NESTING, the lockdep will
   complain about violation of the nesting rules, as in "BUG: Invalid
   wait context".  This Kconfig option checks for proper raw_spinlock
   vs. spinlock nesting, in particular, it is not legal to acquire a
   spinlock_t while holding a raw_spinlock_t.

   This is a problem because kfree_rcu() uses raw_spinlock_t whereas the
   "page allocator" internally deals with spinlock_t to access to its
   zones. The code also can be broken from higher level of view:
   <snip>
       raw_spin_lock(&some_lock);
       kfree_rcu(some_pointer, some_field_offset);
   <snip>

b) If built with CONFIG_PREEMPT_RT, spinlock_t is converted into
   sleeplock.  This means that invoking the page allocator from atomic
   contexts results in "BUG: scheduling while atomic".

c) Please note that call_rcu() is already invoked from raw atomic context,
   so it is only reasonable to expaect that kfree_rcu() and kvfree_rcu()
   will also be called from atomic raw context.

This commit therefore defers page allocation to a clean context using the
combination of an hrtimer and a workqueue.  The hrtimer stage is required
in order to avoid deadlocks with the scheduler.  This deferred allocation
is required only when kvfree_rcu()'s per-CPU page cache is empty.

Link: https://lore.kernel.org/lkml/20200630164543.4mdcf6zb4zfclhln@linutronix.de/
Fixes: 3042f83f19 ("rcu: Support reclaim for head-less object")
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-30 11:53:17 +01:00
arch powerpc/powernv/sriov: fix unsigned int win compared to less than zero 2020-12-30 11:53:16 +01:00
block block-5.10-2020-12-05 2020-12-05 14:45:30 -08:00
certs .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
crypto crypto: Kconfig - CRYPTO_MANAGER_EXTRA_TESTS requires the manager 2020-12-30 11:53:09 +01:00
Documentation USB: UAS: introduce a quirk to set no_write_same 2020-12-21 13:30:08 +01:00
drivers scsi: ufs: Fix clkgating on/off 2020-12-30 11:53:17 +01:00
fs virtiofs fix leak in setup 2020-12-30 11:53:08 +01:00
include media: v4l2-fwnode: v4l2_fwnode_endpoint_parse caller must init vep argument 2020-12-30 11:53:11 +01:00
init initramfs: fix clang build failure 2020-12-11 14:02:14 -08:00
ipc ipc: adjust proc_ipc_sem_dointvec definition to match prototype 2020-09-05 12:14:29 -07:00
kernel rcu/tree: Defer kvfree_rcu() allocation to a clean context 2020-12-30 11:53:17 +01:00
lib selftest/fpu: avoid clang warning 2020-12-11 14:02:14 -08:00
LICENSES LICENSES/deprecated: add Zlib license text 2020-09-16 14:33:49 +02:00
mm mm/hugetlb: clear compound_nr before freeing gigantic pages 2020-12-11 14:02:14 -08:00
net Bluetooth: Fix: LL PRivacy BLE device fails to connect 2020-12-30 11:53:05 +01:00
samples Tracing fixes for 5.10-rc6 2020-12-01 15:30:18 -08:00
scripts scripts: kernel-doc: Restore anonymous enum parsing 2020-12-30 11:53:10 +01:00
security selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling 2020-12-30 11:53:03 +01:00
sound ASoC: intel: SND_SOC_INTEL_KEEMBAY should depend on ARCH_KEEMBAY 2020-12-30 11:53:14 +01:00
tools selftests/bpf: Fix broken riscv build 2020-12-30 11:53:15 +01:00
usr Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 13:29:39 -07:00
virt kvm: x86/mmu: Support dirty logging for the TDP MMU 2020-10-23 03:42:13 -04:00
.clang-format RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore .gitignore: docs: ignore sphinx_*/ directories 2020-09-10 10:44:31 -06:00
.mailmap mailmap: add two more addresses of Uwe Kleine-König 2020-12-06 10:19:07 -08:00
COPYING
CREDITS MAINTAINERS: Move Jason Cooper to CREDITS 2020-11-30 10:20:34 +01:00
Kbuild
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-10 15:30:13 -08:00
Makefile Linux 5.10.3 2020-12-26 16:02:46 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.