mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 063/102] mm/swap_slots.c: add warning if swap slots cache failed to initialize
@ 2017-05-03 21:54 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-05-03 21:54 UTC (permalink / raw)
  To: akpm, mm-commits, tim.c.chen, torvalds

From: Tim Chen <tim.c.chen@linux.intel.com>
Subject: mm/swap_slots.c: add warning if swap slots cache failed to initialize

Add a warning diagnostics to user if we failed to allocate swap slots
cache and use it.

[akpm@linux-foundation.org: use WARN_ONCE return value, fix grammar in message]
Link: http://lkml.kernel.org/r/20170328234827.GA10107@linux.intel.com
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/swap_slots.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -puN mm/swap_slots.c~swap-add-warning-if-swap-slots-cache-failed-to-initialize mm/swap_slots.c
--- a/mm/swap_slots.c~swap-add-warning-if-swap-slots-cache-failed-to-initialize
+++ a/mm/swap_slots.c
@@ -241,8 +241,10 @@ int enable_swap_slots_cache(void)
 
 	ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "swap_slots_cache",
 				alloc_swap_slot_cache, free_slot_cache);
-	if (ret < 0)
+	if (WARN_ONCE(ret < 0, "Cache allocation failed (%s), operating "
+			       "without swap slots cache.\n", __func__))
 		goto out_unlock;
+
 	swap_slot_cache_initialized = true;
 	__reenable_swap_slots_cache();
 out_unlock:
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-03 21:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 21:54 [patch 063/102] mm/swap_slots.c: add warning if swap slots cache failed to initialize akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).