Message ID | 1548307220-19756-3-git-send-email-anshuman.khandual@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64/mm: Enable accounting for page table pages | expand |
On Thu, Jan 24, 2019 at 10:50:16AM +0530, Anshuman Khandual wrote: > 'pgd_cache' is created for allocating non PAGE_SIZE based PGD pointers. In > such cases ensure that the kmem cache object is allocated before proceeding > further with boot. > > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > --- > arch/arm64/mm/pgd.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c > index 289f911..8cb4e39 100644 > --- a/arch/arm64/mm/pgd.c > +++ b/arch/arm64/mm/pgd.c > @@ -62,4 +62,5 @@ void __init pgd_cache_init(void) > */ > pgd_cache = kmem_cache_create("pgd_cache", PGD_SIZE, PGD_SIZE, > SLAB_PANIC, NULL); > + BUG_ON(!pgd_cache); Isn't SLAB_PANIC sufficient here?
On 01/24/2019 08:46 PM, Catalin Marinas wrote: > On Thu, Jan 24, 2019 at 10:50:16AM +0530, Anshuman Khandual wrote: >> 'pgd_cache' is created for allocating non PAGE_SIZE based PGD pointers. In >> such cases ensure that the kmem cache object is allocated before proceeding >> further with boot. >> >> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> >> --- >> arch/arm64/mm/pgd.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c >> index 289f911..8cb4e39 100644 >> --- a/arch/arm64/mm/pgd.c >> +++ b/arch/arm64/mm/pgd.c >> @@ -62,4 +62,5 @@ void __init pgd_cache_init(void) >> */ >> pgd_cache = kmem_cache_create("pgd_cache", PGD_SIZE, PGD_SIZE, >> SLAB_PANIC, NULL); >> + BUG_ON(!pgd_cache); > > Isn't SLAB_PANIC sufficient here? It should be sufficient as it calls panic(). Please drop this patch from consideration.
diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c index 289f911..8cb4e39 100644 --- a/arch/arm64/mm/pgd.c +++ b/arch/arm64/mm/pgd.c @@ -62,4 +62,5 @@ void __init pgd_cache_init(void) */ pgd_cache = kmem_cache_create("pgd_cache", PGD_SIZE, PGD_SIZE, SLAB_PANIC, NULL); + BUG_ON(!pgd_cache); }
'pgd_cache' is created for allocating non PAGE_SIZE based PGD pointers. In such cases ensure that the kmem cache object is allocated before proceeding further with boot. Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> --- arch/arm64/mm/pgd.c | 1 + 1 file changed, 1 insertion(+)