lkml.org 
[lkml]   [2017]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v3 for 4.15 08/24] Provide cpu_opv system call
On Mon, 20 Nov 2017, Mathieu Desnoyers wrote:
> ----- On Nov 20, 2017, at 12:48 PM, Thomas Gleixner tglx@linutronix.de wrote:
> The use-case for 4k memcpy operation is a per-cpu ring buffer where
> the rseq fast-path does the following:
>
> - ring buffer push: in the rseq asm instruction sequence, a memcpy of a
> given structure (limited to 4k in size) into a ring buffer,
> followed by the final commit instruction which increments the current
> position offset by the number of bytes pushed.
>
> - ring buffer pop: in the rseq asm instruction sequence, a memcpy of
> a given structure (up to 4k) from the ring buffer, at "position" offset.
> The final commit instruction decrements the current position offset by
> the number of bytes pop'd.
>
> Having cpu_opv do a 4k memcpy allow it to handle scenarios where
> rseq fails to progress.

I'm still confused. Before you talked about the sequence:

1) Reserve

2) Commit

and both use rseq, but obviously you cannot do two "atomic" operation in
one section.

So now you talk about push. Is that what you described earlier as commit?

Assumed that it is, I still have no idea why the memcpy needs to happen in
that preempt disabled region.

If you have space reserved, then the copy does not have any dependencies
neither on the cpu it runs on nor on anything else. So the only
interresting operation is the final commit instruction which tells the
consumer that its ready.

So what is the part I am missing here aside of having difficulties to map
the constantly changing names of this stuff?

Thanks,

tglx


\
 
 \ /
  Last update: 2017-11-20 20:44    [W:0.089 / U:1.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site