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] [day] [month] [year] [list]
Message-ID: <20230706143946.GA15131@lst.de>
Date:   Thu, 6 Jul 2023 16:39:46 +0200
From:   Christoph Hellwig <hch@....de>
To:     Chengming Zhou <chengming.zhou@...ux.dev>
Cc:     Christoph Hellwig <hch@....de>, axboe@...nel.dk,
        ming.lei@...hat.com, tj@...nel.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Chengming Zhou <zhouchengming@...edance.com>
Subject: Re: [PATCH v2 1/4] blk-mq: use percpu csd to remote complete
 instead of per-rq csd

On Thu, Jul 06, 2023 at 10:23:49PM +0800, Chengming Zhou wrote:
> Yes, should I change like below? Looks like much long code. :-)
> 
> if (llist_add(&rq->ipi_list, &per_cpu(blk_cpu_done, cpu)))
> 	smp_call_function_single_async(cpu, &per_cpu(blk_cpu_csd, cpu));

Doesn't look bad too me.

>
> 
> > 
> > But I think this code has a rpboem when it is preemptd between
> > the llist_add and smp_call_function_single_async.  We either need a
> > get_cpu/put_cpu around them, or instroduce a structure with the list
> > and csd, and then you can use one pointer from per_cpu and still ensure
> > the list and csd are for the same CPU.
> > 
> 
> cpu = rq->mq_ctx->cpu; So it's certainly the same CPU, right?

You're right of couse - cpu is the submitting cpu and not the current
one and thus not affected by preemption.  Sorry for the noise.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ