* [PATCH] arm64: mm: Use better bitmap_zalloc()
@ 2021-05-29 11:15 Kefeng Wang
2021-06-01 18:21 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Kefeng Wang @ 2021-05-29 11:15 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: Kefeng Wang, Catalin Marinas, Will Deacon
Use better bitmap_zalloc() to allocate bitmap.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/arm64/mm/context.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm/context.c
index 001737a8f309..cd72576ae2b7 100644
--- a/arch/arm64/mm/context.c
+++ b/arch/arm64/mm/context.c
@@ -402,14 +402,12 @@ static int asids_init(void)
{
asid_bits = get_cpu_asid_bits();
atomic64_set(&asid_generation, ASID_FIRST_VERSION);
- asid_map = kcalloc(BITS_TO_LONGS(NUM_USER_ASIDS), sizeof(*asid_map),
- GFP_KERNEL);
+ asid_map = bitmap_zalloc(NUM_USER_ASIDS, GFP_KERNEL);
if (!asid_map)
panic("Failed to allocate bitmap for %lu ASIDs\n",
NUM_USER_ASIDS);
- pinned_asid_map = kcalloc(BITS_TO_LONGS(NUM_USER_ASIDS),
- sizeof(*pinned_asid_map), GFP_KERNEL);
+ pinned_asid_map = bitmap_zalloc(NUM_USER_ASIDS, GFP_KERNEL);
nr_pinned_asids = 0;
/*
--
2.26.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: mm: Use better bitmap_zalloc()
2021-05-29 11:15 [PATCH] arm64: mm: Use better bitmap_zalloc() Kefeng Wang
@ 2021-06-01 18:21 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2021-06-01 18:21 UTC (permalink / raw)
To: linux-arm-kernel, Kefeng Wang; +Cc: catalin.marinas, kernel-team, Will Deacon
On Sat, 29 May 2021 19:15:10 +0800, Kefeng Wang wrote:
> Use better bitmap_zalloc() to allocate bitmap.
Applied to arm64 (for-next/mm), thanks!
[1/1] arm64: mm: Use better bitmap_zalloc()
https://git.kernel.org/arm64/c/5ae632ed356c
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-01 18:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 11:15 [PATCH] arm64: mm: Use better bitmap_zalloc() Kefeng Wang
2021-06-01 18:21 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).