Skip to content

Commit 452b94b

Browse files
committed
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>
1 parent a07a6e4 commit 452b94b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/swap_slots.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ int free_swap_slot(swp_entry_t entry)
267267
{
268268
struct swap_slots_cache *cache;
269269

270-
BUG_ON(!swap_slot_cache_initialized);
270+
WARN_ON_ONCE(!swap_slot_cache_initialized);
271271

272272
cache = &get_cpu_var(swp_slots);
273273
if (use_swap_slot_cache && cache->slots_ret) {

0 commit comments

Comments
 (0)