Bug 13146 - memory allocation can sleep
Summary: memory allocation can sleep
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks: 10994
  Show dependency treegraph
 
Reported: 2011-09-01 14:35 UTC by David Smith
Modified: 2011-09-01 14:51 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2011-09-01 14:35:14 UTC
When the systemtap runtime allocates memory, it uses GFP_KERNEL (possibly with other flags).  GFP_KERNEL includes __GFP_WAIT, which means that the memory allocation could possibly sleep.

Systemtap probe handlers should not sleep.
Comment 1 David Smith 2011-09-01 14:50:44 UTC
Fixed in commit 8e794e9 (which also fixes a couple of places to handle memory allocation failures better).

Regression tested on:

RHEL4:   2.6.9-100.ELsmp (i686)
RHEL5:   2.6.18-274.el5debug (x86_64)
RHEL6:   2.6.32-192.el6.x86_64.debug (x86_64)
f15:     2.6.40.3-0.fc15.i686.debug (i686)
rawhide: 3.0.1-6.fc17.x86_64 (x86_64)

Note that this came up while working on bug #10994.  During some utrace probe handlers, memory allocation is done (typically to allocate space for a pathname).  That is fine, since utrace probe handlers are run in a sleepable context.

However, the new utrace-free task_finder will be implemented via tracepoints, and tracepoint probe handers are not run in a sleepable context.