This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug uprobes/5275] New: uprobes: smarter insn slot allocation for SSOL


Currently, uprobes allocates one page (the SSOL vma) in each probed
process's virtual address space and divides it up into "instruction
slots" for use in single-stepping out of line (SSOL).  Slots are
allocated per-probepoint, and if a probepoint is never hit, it never
gets a slot.  If the number of probepoints ever hit (and currently
registered) exceeds the number of slots in 1 page, probepoints steal
slots from each other on a LRU basis.  To manage slot stealing, uprobes
allocates a struct uprobe_ssol_slot for each slot in the SSOL vma.

For the typical i386 system (4K page / 16-byte slots = 256 slots),
this works pretty well.  For powerpc (64K page / 4-byte slots =
16K slots), the resulting array of uprobe_ssol_slot objects is huge
(too big for kmalloc), and the likelihood that slot stealing will
be needed is tiny.  A workaround currently limits the number of SSOL
slots to 1024, but that wastes 15K slots on powerpc.

Potentially simpler approaches:
1) Forget about slot stealing and just refuse to do SSOL for probepoints
that we can't allocate slots for.  Ugly.
2) Forget about slot stealing and just keep growing the SSOL vma
as more slots are needed.  This is perhaps less ugly, but also more
complicated, and runs the possibility of bumping up against another
vma, bringing us back to (1).

A somewhat more complicated approach: Divide the SSOL vma into private
slots (the majority) and public slots.  A private slot, once allocated
to a probepoint, is owned by that probepoint until the probepoint
goes away.  Public slots are the equivalent of the slots we have now:
each has an associated uprobe_ssol_slot object and so can be stolen.
This prevents us from ever running out of slots.  Public slots are
put into use only when all private slots are used.  So a powerpc
process might have 64 public slots and (16K-64 = 16320) private slots;
an i386 process might have 64 public slots and (256-64 = 192) private
slots.

-- 
           Summary: uprobes: smarter insn slot allocation for SSOL
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: minor
          Priority: P2
         Component: uprobes
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: jkenisto at us dot ibm dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=5275

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]