Skip to content
Snippets Groups Projects
Commit 452b94b8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a07a6e41
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment