Commit 3f4fefc1 authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Todd Kjos
Browse files

FROMLIST: percpu-rwsem: enable percpu_sem destruction in atomic context



Calling percpu_free_rwsem in atomic context results in "scheduling while
atomic" bug being triggered:

BUG: scheduling while atomic: klogd/158/0x00000002
...
  __schedule_bug+0x191/0x290
  schedule_debug+0x97/0x180
  __schedule+0xdc/0xba0
  schedule+0xda/0x250
  schedule_timeout+0x92/0x2d0
  __wait_for_common+0x25b/0x430
  wait_for_completion+0x1f/0x30
  rcu_barrier+0x440/0x4f0
  rcu_sync_dtor+0xaa/0x190
  percpu_free_rwsem+0x41/0x80

Introduce percpu_rwsem_destroy function to perform semaphore destruction
in a worker thread.

Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
Signed-off-by: default avatarMichel Lespinasse <michel@lespinasse.org>
Link: https://lore.kernel.org/all/20220128131006.67712-23-michel@lespinasse.org/


Bug: 161210518
Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
Change-Id: Ic6df09ff048755cd862d340c89a83dfe8efa1bfb
parent 009020e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment