lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ab3720ec-b12b-4c0a-8e56-930753c709fd@kernel.dk>
Date: Mon, 21 Oct 2024 07:45:19 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Muchun Song <songmuchun@...edance.com>
Cc: josef@...icpanda.com, oleg@...hat.com, linux-block@...r.kernel.org,
 linux-kernel@...r.kernel.org, muchun.song@...ux.dev,
 Omar Sandoval <osandov@...ndov.com>
Subject: Re: [PATCH] block: remove redundant explicit memory barrier from
 rq_qos waiter and waker

On 10/21/24 2:52 AM, Muchun Song wrote:
> The memory barriers in list_del_init_careful() and list_empty_careful()
> in pairs already handle the proper ordering between data.got_token
> and data.wq.entry. So remove the redundant explicit barriers. And also
> change a "break" statement to "return" to avoid redundant calling of
> finish_wait().

Not sure why you didn't CC Omar on this one, as he literally just last
week fixed an issue related to this.

> 
> Signed-off-by: Muchun Song <songmuchun@...edance.com>
> ---
>  block/blk-rq-qos.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
> index dc510f493ba57..9b0aa7dd6779f 100644
> --- a/block/blk-rq-qos.c
> +++ b/block/blk-rq-qos.c
> @@ -218,7 +218,6 @@ static int rq_qos_wake_function(struct wait_queue_entry *curr,
>  		return -1;
>  
>  	data->got_token = true;
> -	smp_wmb();
>  	wake_up_process(data->task);
>  	list_del_init_careful(&curr->entry);
>  	return 1;
> @@ -274,10 +273,9 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data,
>  			 * which means we now have two. Put our local token
>  			 * and wake anyone else potentially waiting for one.
>  			 */
> -			smp_rmb();
>  			if (data.got_token)
>  				cleanup_cb(rqw, private_data);
> -			break;
> +			return;
>  		}
>  		io_schedule();
>  		has_sleeper = true;


-- 
Jens Axboe


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ