aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/scripting-engines/trace-event-python.c
diff options
context:
space:
mode:
authorDoug Ledford <[email protected]>2012-05-31 16:26:36 -0700
committerLinus Torvalds <[email protected]>2012-05-31 17:49:31 -0700
commit2c12ea498f349207c28840c0ed9654321aab7720 (patch)
treeef0f938e66a8a8b038e5c6be29e7f27294023c7e /tools/perf/util/scripting-engines/trace-event-python.c
parentd6629859b36d953a4b1369b749f178736911bf10 (diff)
ipc/mqueue: correct mq_attr_ok test
While working on the other parts of the mqueue stuff, I noticed that the calculation for overflow in mq_attr_ok didn't actually match reality (this is especially true since my last patch which changed how we account memory slightly). In particular, we used to test for overflow using: msgs * msgsize + msgs * sizeof(struct msg_msg *) That was never really correct because each message we allocate via load_msg() is actually a struct msg_msg followed by the data for the message (and if struct msg_msg + data exceeds PAGE_SIZE we end up allocating struct msg_msgseg structs too, but accounting for them would get really tedious, so let's ignore those...they're only a pointer in size anyway). This patch updates the calculation to be more accurate in regards to maximum possible memory consumption by the mqueue. [[email protected]: add a local to simplify overflow-checking expression] Signed-off-by: Doug Ledford <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Manfred Spraul <[email protected]> Acked-by: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions