summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/swapfile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 775c385490a5..095d43838d4e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1072,6 +1072,12 @@ static void swap_reclaim_full_clusters(struct swap_info_struct *si, bool force)
swap_cluster_unlock(ci);
if (to_scan <= 0)
break;
+
+ /*
+ * When 'force' is false, 'to_scan' is initialized to 1.
+ * The loop breaks above, making this cond_resched() unreachable
+ * in atomic contexts.
+ */
cond_resched();
}
}