OSDN Git Service

dm writecache: add cond_resched to avoid CPU hangs
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 27 Mar 2020 11:22:36 +0000 (07:22 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 27 Mar 2020 18:36:50 +0000 (14:36 -0400)
commit1edaa447d958bec24c6a79685a5790d98976fd16
tree6ef766b371023a1835c2eedf5f439e866d5d053d
parent31843edab7cb3924006544b901c9cab33941b684
dm writecache: add cond_resched to avoid CPU hangs

Initializing a dm-writecache device can take a long time when the
persistent memory device is large.  Add cond_resched() to a few loops
to avoid warnings that the CPU is stuck.

Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-writecache.c