[Xenomai] Reading /proc/xenomai/stat causes high latencies

Jeroen Van den Keybus jeroen.vandenkeybus at gmail.com
Thu Apr 24 10:57:34 CEST 2014

> Could you put a printk in the function vfile_stat_rewind to see if it
> gets called (more than once) when the problem happens?

I patched as follows:

static int vfile_stat_rewind(struct xnvfile_snapshot_iterator *it)
    struct vfile_stat_priv *priv = xnvfile_iterator_priv(it);
    int irqnr;
    int ret, irq;

     * The activity numbers on each valid interrupt descriptor are
     * grouped under a pseudo-thread.
    priv->curr = getheadq(&nkpod->threadq);
    irq = priv->irq;
    priv->irq = 0;
    irqnr = xnintr_query_init(&priv->intr_it) * XNARCH_NR_CPUS;

    ret = irqnr + countq(&nkpod->threadq);

    printk(KERN_DEBUG "%s: priv=%p, ->curr=%p, ->irq=(%d), irqnr=%d, ret=%d\n",
           __FUNCTION__, priv, priv->curr, irq, irqnr, ret);

    return ret;

The result (3 first accesses are without latency running, the 2 last
ones with latency running - each time 120 µs delay)

[  173.098667] vfile_stat_rewind: priv=ffff880211863228,
->curr=ffffffffa06b1110, ->irq=(0), irqnr=256, ret=264
[  181.547424] vfile_stat_rewind: priv=ffff880211863b28,
->curr=ffffffffa06b1110, ->irq=(0), irqnr=256, ret=264
[  183.002400] vfile_stat_rewind: priv=ffff880211863228,
->curr=ffffffffa06b1110, ->irq=(0), irqnr=256, ret=264
[  201.475071] vfile_stat_rewind: priv=ffff880211863228,
->curr=ffffffffa06b1110, ->irq=(0), irqnr=256, ret=266
[  209.432070] vfile_stat_rewind: priv=ffff8802118631a8,
->curr=ffffffffa06b1110, ->irq=(0), irqnr=256, ret=266

So vfile... is called exactly once upon issuing 'cat /proc/xenomai/stat'.


More information about the Xenomai mailing list