All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] RFC: /proc/xenomai/latency change
Date: Sat, 25 Sep 2010 19:27:28 +0200	[thread overview]
Message-ID: <4C9E3100.4020003@domain.hid> (raw)
In-Reply-To: <4C9E15A9.8070601@domain.hid>

Gilles Chanteperdrix wrote:
> Hi,
> 
> I have been working on omap3 performances, and during this, I noticed 
> one flaw in /proc/xenomai/latency: it displays the whole timer subsystem
> anticipation whereas it should probably only allow setting the scheduler
> latency. The reason is that when issuing the customary:
> echo 0 > /proc/xenomai/latency
> 
> we were in fact also disabling any account of the timer programming 
> latency. This is probably almoste invisible on systems with low timer 
> programming latencies, but this turned out to account for around 5us 
> error on timer programming on omap. Now, the timer programming latency 
> is back to a more reasonable 1us on omap, but I still think we should 
> change this.
> 
> However, since it may break some users settings, I wonder if we should 
> apply it now or only in the 2.6 branch.
> 
> Here is the patch I am talking about:

Better:
diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c
index 7db0ccf..2297b74 100644
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -3164,7 +3164,7 @@ static int latency_read_proc(char *page,
 {
        int len;

-       len = sprintf(page, "%Lu\n", xnarch_tsc_to_ns(nklatency));
+       len = sprintf(page, "%Lu\n", xnarch_tsc_to_ns(nklatency - nktimerlat));
        len -= off;
        if (len <= off + count)
                *eof = 1;
@@ -3196,7 +3196,7 @@ static int latency_write_proc(struct file *file,
        if ((*end != '\0' && !isspace(*end)) || ns < 0)
                return -EINVAL;

-       nklatency = xnarch_ns_to_tsc(ns);
+       nklatency = xnarch_ns_to_tsc(ns) + nktimerlat;

        return count;
 }


-- 
                                                                Gilles.


  reply	other threads:[~2010-09-25 17:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-25 15:30 [Xenomai-core] RFC: /proc/xenomai/latency change Gilles Chanteperdrix
2010-09-25 17:27 ` Gilles Chanteperdrix [this message]
2010-09-27 12:18   ` Philippe Gerum
2010-09-27 12:37     ` Gilles Chanteperdrix
2010-09-27 12:47       ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C9E3100.4020003@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.