public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Tune reader_thread poll timeout value
@ 2012-05-01 20:10 Turgis, Frederic
  2012-05-01 21:30 ` Frank Ch. Eigler
  2012-05-02  8:46 ` Mark Wielaard
  0 siblings, 2 replies; 14+ messages in thread
From: Turgis, Frederic @ 2012-05-01 20:10 UTC (permalink / raw)
  To: systemtap, mjw

Hi,

I am following-up remark made in the context of "Making the transport layer more robust" topic. Goal is to reduce number of systemtap wake-ups in the context of embedded low-power use cases like MP3 playback.
The last non tunable or small duration source of wake-up is "reader_thread" ppoll timeout value, every 200ms. We compile systemtap with a value of 2s or more for our daily use.

So I am proposing to introduce tunables below as an example. Don't know if I should have correlated s and ns, also don't know if this should also be applied to relay_old.c. Please tell me if this is an acceptable change:


From 3fac053713be44c00e05423b4f31e2ed8edaa993 Mon Sep 17 00:00:00 2001
From: Frederic Turgis <f-turgis@ti.com>
Date: Wed, 2 May 2012 01:16:28 +0200
Subject: [PATCH] Make reader_thread poll timeout tunable at compilation

---
 runtime/staprun/relay.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/runtime/staprun/relay.c b/runtime/staprun/relay.c
index e08ff60..d81a45f 100644
--- a/runtime/staprun/relay.c
+++ b/runtime/staprun/relay.c
@@ -12,6 +12,13 @@

 #include "staprun.h"

+#ifndef STP_RELAY_TIMEOUT_S
+#define STP_RELAY_TIMEOUT_S 0
+#endif
+#ifndef STP_RELAY_TIMEOUT_NS
+#define STP_RELAY_TIMEOUT_NS 200000000
+#endif
+
 int out_fd[NR_CPUS];
 static pthread_t reader[NR_CPUS];
 static int relay_fd[NR_CPUS];
@@ -125,7 +132,7 @@ static void *reader_thread(void *data)
         char buf[131072];
         int rc, cpu = (int)(long)data;
         struct pollfd pollfd;
-       struct timespec tim = {.tv_sec=0, .tv_nsec=200000000}, *timeout = &tim;
+       struct timespec tim = {.tv_sec=STP_RELAY_TIMEOUT_S, .tv_nsec=STP_RELAY_TIMEOUT_NS}, *timeout = &tim;
        sigset_t sigs;
        off_t wsize = 0;
        int fnum = 0;
--

Regards
FRed

OMAP Platform Business Unit - System Platform Engineering - Platform & Product Entitlement



Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-05-22 17:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-01 20:10 Tune reader_thread poll timeout value Turgis, Frederic
2012-05-01 21:30 ` Frank Ch. Eigler
2012-05-02  8:46 ` Mark Wielaard
2012-05-02 19:39   ` Turgis, Frederic
2012-05-02 20:41     ` Josh Stone
2012-05-03  0:15       ` Turgis, Frederic
2012-05-03  8:33         ` Mark Wielaard
2012-05-07 11:52         ` Turgis, Frederic
2012-05-07 13:56           ` Frank Ch. Eigler
2012-05-07 16:09             ` Turgis, Frederic
2012-05-14 23:59               ` Turgis, Frederic
2012-05-15 14:25                 ` Frank Ch. Eigler
2012-05-15 15:29                   ` Turgis, Frederic
2012-05-22 17:53                     ` Turgis, Frederic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).