
On Tue, 3 Dec 2024, Jiri Slaby wrote:
On 03. 12. 24, 1:55, Andrii Nakryiko wrote:
On Thu, Nov 28, 2024 at 1:37 AM Jiri Slaby <jslaby@suse.cz> wrote:
On 27. 11. 24, 20:15, Andrii Nakryiko wrote:
There is just no good and reliable solution for DWARF-based stack unwinding.
I don't understand this either. We used to have DWARF annotations and an unwinder in SUSE kernels. It was both good and reliable. Before ORC became so. Note we use ORC for livepatching and ORC was developed to be reliable for those purposes.
Again, ORC is for kernels. We are discussing user space. There is no ORC for user space.
Yes, you wrote: There is just no good and reliable solution for DWARF-based stack unwinding.
I wrote: We used to have DWARF annotations and an unwinder in SUSE kernels. It was both good and reliable.
Probably with always mapped .eh_frame
Please stop misleading others
How does that mislead others?
It doesn't I think. But the argument is "A is not implemented", let's do "B" instead. Yes, the paging issue is there with .eh_frame (but also with the stack, just more unlikely). And yes, you don't want to do even more work in NMI context. But I'd argue you want to do minimal work there only anyway, not even FP based unwinding - after a process switch you'd likely get TBL misses there. Not even considering RT ... So the solution is IMO to suspend the thread associated with the event from NMI and schedule a kernel worker thread (or whatever you have at your disposal these days for this), and exit from NMI context as fast as possible. Alternatively make sure the page we'd fault gets faulted in later (asynchonously) and give up on the unwind at that point (this is likely what we do when FP based unwind hits this?). You should get your .eh_frame faulted in after a few events then. You could also have a user-space helper to pre-fault .eh_frame of running processes (probably reasonably "easy" as root via scanning /proc and using ptrace). Richard.
thanks,
-- Richard Biener <rguenther@suse.de> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)