Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-03-19 19:00:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-03-19 19:00:47 -0700
commit452b94b8c8c7eb7dd0d0fa9a9776e0d02cd73b97 (patch)
tree6a16a4ba7501718b26fc68ac16570272908dbbb5
parenta07a6e4121f1d4e1bbaead8210404a7f37139267 (diff)
mm/swap: don't BUG_ON() due to uninitialized swap slot cache
This BUG_ON() triggered for me once at shutdown, and I don't see a reason for the check. The code correctly checks whether the swap slot cache is usable or not, so an uninitialized swap slot cache is not actually problematic afaik. I've temporarily just switched the BUG_ON() to a WARN_ON_ONCE(), since I'm not sure why that seemingly pointless check was there. I suspect the real fix is to just remove it entirely, but for now we'll warn about it but not bring the machine down. Cc: "Huang, Ying" <ying.huang@intel.com> Cc: Tim Chen <tim.c.chen@linux.intel.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/swap_slots.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/swap_slots.c b/mm/swap_slots.c
index 9b5bc86f96ad..7ebb23836f68 100644
--- a/mm/swap_slots.c
+++ b/mm/swap_slots.c
@@ -267,7 +267,7 @@ int free_swap_slot(swp_entry_t entry)
{
struct swap_slots_cache *cache;
- BUG_ON(!swap_slot_cache_initialized);
+ WARN_ON_ONCE(!swap_slot_cache_initialized);
cache = &get_cpu_var(swp_slots);
if (use_swap_slot_cache && cache->slots_ret) {