From: Rick Lindsley <hidden> Date: 2019-05-06 00:22:23
When the memset code was added to pgd_alloc(), it failed to consider that kmem_cache_alloc() can return NULL. It's uncommon, but not impossible under heavy memory contention.
Signed-off-by: Rick Lindsley <redacted>
Fixes: cf266dbcd2a7 ("Zero PGD pages on allocation")
@@ -81,6 +81,10 @@ static inline pgd_t *pgd_alloc(struct mm
pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
pgtable_gfp_flags(mm, GFP_KERNEL));
+
+ if (unlikely(!pgd))
+ return pgd;
+
/*
* Don't scan the PGD for pointers, it contains references to PUDs but
* those references are not full pointers and so can't be recognised by
From: Michael Ellerman <hidden> Date: 2019-05-06 11:35:21
Rick Lindsley [off-list ref] writes:
When the memset code was added to pgd_alloc(), it failed to consider
that kmem_cache_alloc() can return NULL. It's uncommon, but not
impossible under heavy memory contention.
Can you post an oops log? Just so if someone hits it they can possibly
recognise it from the back trace etc.
Signed-off-by: Rick Lindsley <redacted>
Fixes: cf266dbcd2a7 ("Zero PGD pages on allocation")
I don't have that commit. Did you mean:
Fixes: fc5c2f4a55a2 ("powerpc/mm/hash64: Zero PGD pages on allocation")
cheers
@@ -81,6 +81,10 @@ static inline pgd_t *pgd_alloc(struct mm
pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
pgtable_gfp_flags(mm, GFP_KERNEL));
+
+ if (unlikely(!pgd))
+ return pgd;
+
/*
* Don't scan the PGD for pointers, it contains references to PUDs but
* those references are not full pointers and so can't be recognised by
From: Michael Ellerman <hidden> Date: 2019-05-09 15:36:25
On Mon, 2019-05-06 at 00:20:43 UTC, Rick Lindsley wrote:
When the memset code was added to pgd_alloc(), it failed to consider that kmem_cache_alloc() can return NULL. It's uncommon, but not impossible under heavy memory contention.
Signed-off-by: Rick Lindsley <redacted>
Fixes: cf266dbcd2a7 ("Zero PGD pages on allocation")