* [PATCH] arm64: mm: Drop the unused cpu parameter
@ 2018-10-06 8:49 Shaokun Zhang
2018-10-09 11:57 ` Will Deacon
0 siblings, 1 reply; 3+ messages in thread
From: Shaokun Zhang @ 2018-10-06 8:49 UTC (permalink / raw)
To: linux-arm-kernel
Cpu parameter is never used in flush_context, remove it.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
---
arch/arm64/mm/context.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/mm/context.c b/arch/arm64/mm/context.c
index c127f94..009a7b2c 100644
--- a/arch/arm64/mm/context.c
+++ b/arch/arm64/mm/context.c
@@ -88,7 +88,7 @@ void verify_cpu_asid_bits(void)
}
}
-static void flush_context(unsigned int cpu)
+static void flush_context(void)
{
int i;
u64 asid;
@@ -142,7 +142,7 @@ static bool check_update_reserved_asid(u64 asid, u64 newasid)
return hit;
}
-static u64 new_context(struct mm_struct *mm, unsigned int cpu)
+static u64 new_context(struct mm_struct *mm)
{
static u32 cur_idx = 1;
u64 asid = atomic64_read(&mm->context.id);
@@ -180,7 +180,7 @@ static u64 new_context(struct mm_struct *mm, unsigned int cpu)
/* We're out of ASIDs, so increment the global generation count */
generation = atomic64_add_return_relaxed(ASID_FIRST_VERSION,
&asid_generation);
- flush_context(cpu);
+ flush_context();
/* We have more ASIDs than CPUs, so this will always succeed */
asid = find_next_zero_bit(asid_map, NUM_USER_ASIDS, 1);
@@ -223,7 +223,7 @@ void check_and_switch_context(struct mm_struct *mm, unsigned int cpu)
/* Check that our ASID belongs to the current generation. */
asid = atomic64_read(&mm->context.id);
if ((asid ^ atomic64_read(&asid_generation)) >> asid_bits) {
- asid = new_context(mm, cpu);
+ asid = new_context(mm);
atomic64_set(&mm->context.id, asid);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] arm64: mm: Drop the unused cpu parameter
2018-10-06 8:49 [PATCH] arm64: mm: Drop the unused cpu parameter Shaokun Zhang
@ 2018-10-09 11:57 ` Will Deacon
2018-10-09 13:53 ` Zhangshaokun
0 siblings, 1 reply; 3+ messages in thread
From: Will Deacon @ 2018-10-09 11:57 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Oct 06, 2018 at 04:49:04PM +0800, Shaokun Zhang wrote:
> Cpu parameter is never used in flush_context, remove it.
>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
> ---
> arch/arm64/mm/context.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Acked-by: Will Deacon <will.deacon@arm.com>
Curious, but does this actually result in better code generation, or does
GCC already figure out that the parameter is unused?
Will
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] arm64: mm: Drop the unused cpu parameter
2018-10-09 11:57 ` Will Deacon
@ 2018-10-09 13:53 ` Zhangshaokun
0 siblings, 0 replies; 3+ messages in thread
From: Zhangshaokun @ 2018-10-09 13:53 UTC (permalink / raw)
To: linux-arm-kernel
Hi Will,
On 2018/10/9 19:57, Will Deacon wrote:
> On Sat, Oct 06, 2018 at 04:49:04PM +0800, Shaokun Zhang wrote:
>> Cpu parameter is never used in flush_context, remove it.
>>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Will Deacon <will.deacon@arm.com>
>> Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
>> ---
>> arch/arm64/mm/context.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> Acked-by: Will Deacon <will.deacon@arm.com>
>
> Curious, but does this actually result in better code generation, or does
> GCC already figure out that the parameter is unused?
>
No hint from GCC compiler, the unused parameter is found when debug one
context switch issue and analyze the code. It is redundant and harmless
to remove it, a trivial patch.
Thanks,
Shaokun
> Will
>
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-09 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-06 8:49 [PATCH] arm64: mm: Drop the unused cpu parameter Shaokun Zhang
2018-10-09 11:57 ` Will Deacon
2018-10-09 13:53 ` Zhangshaokun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.