|
|
Log in / Subscribe / Register

I missed something about abort

I missed something about abort

Posted Aug 24, 2025 17:57 UTC (Sun) by ssmith32 (subscriber, #72404)
Parent article: Bringing restartable sequences out of the niche

So there's this:

"the kernel will handle a system-call return in the same way as an interrupt return: if the thread is running in a critical section and an event has occurred, control will be redirected to the abort handler. "

And this:

" If the current instruction pointer lies within the critical section, the kernel will cause execution to jump to the abort address. The thread can then clean up after its aborted attempt and restart the operation. "

What's "if an event occurred"?

I read this as saying invoking a system call in a critical section results in the abort handler being called.. which restart the sequence, which would seem to be a bit (infinite) loopy.

But the rest of the article seems to imply the current (pre-tglx) code inadvertently works on non-debug kernels.

So I missed something, probably obvious.. but I can't sort out what.


to post comments

I missed something about abort

Posted Aug 24, 2025 18:02 UTC (Sun) by ssmith32 (subscriber, #72404) [Link] (1 responses)

Maybe more succinct: can a system call trigger what the retart code considers "an event" ( pre-emption, interrupt, cpu migration) ?

I assume the answer is "possibly", in which case the code loops infinitely. But wondering if I'm misunderstanding.

I missed something about abort

Posted Aug 24, 2025 18:42 UTC (Sun) by corbet (editor, #1) [Link]

Yes, a system call can result in those things. As an extreme example, think of a read() call that has to wait for data to be brought in from disk; that will result in the calling thread losing access to the CPU indefinitely. But almost any system call can result in preemption and/or migration of the calling thread.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds