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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Jun 2022 15:50:22 +0200
From:   Christian König <ckoenig.leichtzumerken@...il.com>
To:     Sergey Senozhatsky <senozhatsky@...omium.org>,
        Christian König <christian.koenig@....com>
Cc:     Sumit Semwal <sumit.semwal@...aro.org>,
        Gustavo Padovan <gustavo@...ovan.org>,
        Tomasz Figa <tfiga@...omium.org>,
        Ricardo Ribalda <ribalda@...omium.org>,
        Christoph Hellwig <hch@...radead.org>,
        linux-media@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        linaro-mm-sig@...ts.linaro.org, linux-kernel@...r.kernel.org
Subject: Re: [Linaro-mm-sig] Re: [PATCH] dma-fence: allow dma fence to have
 their own lock



Am 30.05.22 um 17:45 schrieb Sergey Senozhatsky:
> On (22/05/30 16:55), Christian König wrote:
>> If you just want to create a single dma_fence which is also only bound to a
>> single context you can embed the lock into the fence without much problem.
>>
>> See how the dma_fence_array does that for example: https://elixir.bootlin.com/linux/latest/source/include/linux/dma-fence-array.h#L37
> Christian, I'm not sure I'm following you on the "embed the lock into the
> fence without much problem" part. If I understand it correctly this should
> be something like:
>
> 	fences = kmalloc_array(1, sizeof(*fences), GFP_KERNEL);
> 	for_each_fence(...) {
>
> 		// what spinlock should I use here?
>
> 		dma_fence_init(&fences[i], .. &lock ..);
> 		dma_fence_get(&fences[i]);
> 	}
> 	fence_array = dma_fence_array_create(1, fences, ....);
> 	sync_file_create(&fence_array->base);

Well no, that's the high level usage of the dma_fence_array.

What I meant was this here:

struct dma_fence_array {
     struct dma_fence base;

     spinlock_t lock;
...
};

Regards,
Christian.

> _______________________________________________
> Linaro-mm-sig mailing list -- linaro-mm-sig@...ts.linaro.org
> To unsubscribe send an email to linaro-mm-sig-leave@...ts.linaro.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ