On platforms with memory encryption, alloc_cc_shared_pages_node() transitions the allocated memory to the shared state. set_memory_decrypted() may sleep, so the transition must run from a sleepable context. Cc: Andrew Morton Signed-off-by: Aneesh Kumar K.V (Arm) --- mm/cc_shared.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/cc_shared.c b/mm/cc_shared.c index 40c130cce74b..e70c26df2d06 100644 --- a/mm/cc_shared.c +++ b/mm/cc_shared.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -106,6 +107,8 @@ static int __alloc_cc_shared_pages_node(int nid, gfp_t gfp, unsigned int order; int ret; + might_sleep(); + ret = cc_shared_calc_layout(requested, &layout); if (ret) return ret; -- 2.43.0