Re: [RFC PATCH 1/4] locking/percpu-rwsem: add freezable alternative to down_read

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

 



On Thu, 2025-03-27 at 10:06 -0400, James Bottomley wrote:
[...]
> -static void percpu_rwsem_wait(struct percpu_rw_semaphore *sem, bool
> reader)
> +static void percpu_rwsem_wait(struct percpu_rw_semaphore *sem, bool
> reader,
> +			      bool freeze)
>  {
>  	DEFINE_WAIT_FUNC(wq_entry, percpu_rwsem_wake_function);
>  	bool wait;
> @@ -156,7 +157,8 @@ static void percpu_rwsem_wait(struct
> percpu_rw_semaphore *sem, bool reader)
>  	spin_unlock_irq(&sem->waiters.lock);
>  
>  	while (wait) {
> -		set_current_state(TASK_UNINTERRUPTIBLE);
> +		set_current_state(TASK_UNINTERRUPTIBLE |
> +				  freeze ? TASK_FREEZABLE : 0);

This is a bit embarrassing, the bug I've been chasing is here: the ?
operator is lower in precedence than | meaning this expression always
evaluates to TASK_FREEZABLE and nothing else (which is why the process
goes into R state and never wakes up).

Let me fix that and redo all the testing.

Regards,

James






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux