diff options
author | Tim Chen <tim.c.chen@linux.intel.com> | 2017-05-03 17:54:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-03 18:52:10 -0400 |
commit | 9b7a814327a314c56c0e68654c76d99bd2938084 (patch) | |
tree | bb960ea71be69691b4ff1280fea4d4e93e3e9174 | |
parent | 9927e3887642b976d9b391cd77d71388aa521e54 (diff) |
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/swap_slots.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/swap_slots.c b/mm/swap_slots.c index b1ccb58ad397..aa1c415f4abd 100644 --- a/mm/swap_slots.c +++ b/mm/swap_slots.c | |||
@@ -241,8 +241,10 @@ int enable_swap_slots_cache(void) | |||
241 | 241 | ||
242 | ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "swap_slots_cache", | 242 | ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "swap_slots_cache", |
243 | alloc_swap_slot_cache, free_slot_cache); | 243 | alloc_swap_slot_cache, free_slot_cache); |
244 | if (ret < 0) | 244 | if (WARN_ONCE(ret < 0, "Cache allocation failed (%s), operating " |
245 | "without swap slots cache.\n", __func__)) | ||
245 | goto out_unlock; | 246 | goto out_unlock; |
247 | |||
246 | swap_slot_cache_initialized = true; | 248 | swap_slot_cache_initialized = true; |
247 | __reenable_swap_slots_cache(); | 249 | __reenable_swap_slots_cache(); |
248 | out_unlock: | 250 | out_unlock: |