summaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm/pgd.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-27 14:11:07 +0100
committerTakashi Iwai <tiwai@suse.de>2014-10-27 14:11:07 +0100
commit85c24cd8d3676cbae9e8809e894e68025c6d497e (patch)
tree024c4b655c1a8e6943ed8e75b64be38980508cfe /arch/arm64/mm/pgd.c
parent49d776ffb50f2e428aafb6a6576e58e80f1e886c (diff)
parentd1d0b6b668818571122d30d68a0b3f768bd83a52 (diff)
downloadblackbird-op-linux-85c24cd8d3676cbae9e8809e894e68025c6d497e.tar.gz
blackbird-op-linux-85c24cd8d3676cbae9e8809e894e68025c6d497e.zip
Merge branch 'for-linus' into for-next
Merged upstream branch to make further fireworks development easier (and avoid conflicts earlier). Conflicts: sound/firewire/bebob/bebob_focusrite.c
Diffstat (limited to 'arch/arm64/mm/pgd.c')
-rw-r--r--arch/arm64/mm/pgd.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c
index 62c6101df260..6682b361d3ac 100644
--- a/arch/arm64/mm/pgd.c
+++ b/arch/arm64/mm/pgd.c
@@ -30,12 +30,14 @@
#define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t))
+static struct kmem_cache *pgd_cache;
+
pgd_t *pgd_alloc(struct mm_struct *mm)
{
if (PGD_SIZE == PAGE_SIZE)
return (pgd_t *)get_zeroed_page(GFP_KERNEL);
else
- return kzalloc(PGD_SIZE, GFP_KERNEL);
+ return kmem_cache_zalloc(pgd_cache, GFP_KERNEL);
}
void pgd_free(struct mm_struct *mm, pgd_t *pgd)
@@ -43,5 +45,17 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd)
if (PGD_SIZE == PAGE_SIZE)
free_page((unsigned long)pgd);
else
- kfree(pgd);
+ kmem_cache_free(pgd_cache, pgd);
+}
+
+static int __init pgd_cache_init(void)
+{
+ /*
+ * Naturally aligned pgds required by the architecture.
+ */
+ if (PGD_SIZE != PAGE_SIZE)
+ pgd_cache = kmem_cache_create("pgd_cache", PGD_SIZE, PGD_SIZE,
+ SLAB_PANIC, NULL);
+ return 0;
}
+core_initcall(pgd_cache_init);
OpenPOWER on IntegriCloud