Re: [PATCH v10 07/14] unwind_user/deferred: Make unwind deferral requests NMI-safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 19 Jun 2025 10:34:15 +0200
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> Why can't we cmpxchg_local() the thing and avoid this horrible stuff?
> 
> static u64 get_timestamp(struct unwind_task_info *info)
> {
> 	u64 new, old = info->timestamp;
> 
> 	if (old)
> 		return old;
> 	
> 	new = local_clock();
> 	old = cmpxchg_local(&info->timestamp, old, new);
> 	if (old)
> 		return old;
> 	return new;
> }
> 
> Seems simple enough; what's wrong with it?

It's a 64 bit number where most 32 bit architectures don't have any
decent cmpxchg on 64 bit values. That's given me hell in the ring
buffer code :-p

-- Steve




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux