[PATCH] cobalt: sched-quota: Fix live-updating if quotas, once more

2019-12-17 Thread Jan Kiszka via Xenomai
From: Jan Kiszka 

f116e7eb9b56 already tried to enable live updates of a quota group but
got one thing wrong and missed another catch:

First, we must not use group_is_active() to check if the group is
currently consuming time. That has to be the same logic as in
xnsched_quota_pick(), i.e. a check of the currently running thread on
the target sched belongs to the modified group.

The second issue is that, if a group had no budget on refill or consumed
it in this period already, an extension of the budget missed to move
expired threads back to the runqueue.

Signed-off-by: Jan Kiszka 
---
 kernel/cobalt/sched-quota.c | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/sched-quota.c b/kernel/cobalt/sched-quota.c
index bb31833088..4c3383b5f6 100644
--- a/kernel/cobalt/sched-quota.c
+++ b/kernel/cobalt/sched-quota.c
@@ -584,8 +584,10 @@ void xnsched_quota_set_limit(struct xnsched_quota_group 
*tg,
 int quota_percent, int quota_peak_percent,
 int *quota_sum_r)
 {
-   struct xnsched_quota *qs = &tg->sched->quota;
+   struct xnsched *sched = tg->sched;
+   struct xnsched_quota *qs = &sched->quota;
xnticks_t old_quota_ns = tg->quota_ns;
+   struct xnthread *thread, *tmp, *curr;
xnticks_t now, elapsed, consumed;
 
atomic_only();
@@ -611,7 +613,9 @@ void xnsched_quota_set_limit(struct xnsched_quota_group *tg,
tg->quota_percent = quota_percent;
tg->quota_peak_percent = quota_peak_percent;
 
-   if (group_is_active(tg)) {
+   curr = sched->curr;
+   if (curr->quota == tg &&
+   xnthread_test_state(curr, XNREADY|XNTHREAD_BLOCK_BITS) == 0) {
now = xnclock_read_monotonic(&nkclock);
 
elapsed = now - tg->run_start_ns;
@@ -638,11 +642,19 @@ void xnsched_quota_set_limit(struct xnsched_quota_group 
*tg,
 
*quota_sum_r = quota_sum_all(qs);
 
+   if (tg->run_budget_ns > 0) {
+   list_for_each_entry_safe_reverse(thread, tmp, &tg->expired,
+quota_expired) {
+   list_del_init(&thread->quota_expired);
+   xnsched_addq(&sched->rt.runnable, thread);
+   }
+   }
+
/*
 * Apply the new budget immediately, in case a member of this
 * group is currently running.
 */
-   xnsched_set_resched(tg->sched);
+   xnsched_set_resched(sched);
xnsched_run();
 }
 EXPORT_SYMBOL_GPL(xnsched_quota_set_limit);
-- 
2.16.4


-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



RE: CONFIG_XENO_DRIVERS_NET_CHECKED not possible to enable

2019-12-17 Thread Lange Norbert via Xenomai
> -Original Message-
> From: Jan Kiszka 
> Sent: Dienstag, 17. Dezember 2019 07:53
> To: Lange Norbert ; Xenomai
> (xenomai@xenomai.org) 
> Subject: Re: CONFIG_XENO_DRIVERS_NET_CHECKED not possible to enable
>
> NON-ANDRITZ SOURCE: BE CAUTIOUS WITH CONTENT, LINKS OR
> ATTACHMENTS.
>
>
> On 16.12.19 18:49, Lange Norbert via Xenomai wrote:
> > Seems to me like a lot instances of XENO_DRIVERS_NET_CHECKED should
> be
> > renamed to XENO_DRIVERS_RTNET_CHECKED
> >
>
> Good catch, was always wrong. But as the higher-level config is called
> XENO_DRIVERS_NET, we should rather rename
> XENO_DRIVERS_RTNET_CHECKED.

Fixing and enabling the option results in multiple compile errors,
so it probably was never tested either.


This message and any attachments are solely for the use of the intended 
recipients. They may contain privileged and/or confidential information or 
other information protected from disclosure. If you are not an intended 
recipient, you are hereby notified that you received this email in error and 
that any review, dissemination, distribution or copying of this email and any 
attachment is strictly prohibited. If you have received this email in error, 
please contact the sender and delete the message and any attachment from your 
system.

ANDRITZ HYDRO GmbH


Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation

Firmensitz/ Registered seat: Wien

Firmenbuchgericht/ Court of registry: Handelsgericht Wien

Firmenbuchnummer/ Company registration: FN 61833 g

DVR: 0605077

UID-Nr.: ATU14756806


Thank You



Re: [I-PIPE] ipipe-core-4.19.89-x86-9 released

2019-12-17 Thread Jan Kiszka via Xenomai

On 17.12.19 11:14, Lange Norbert via Xenomai wrote:

Is there an easily digestible list of i-pipe changes (on top of the upstream 
Kernel)?



The slow visualization is 
https://gitlab.denx.de/Xenomai/ipipe-x86/-/network/ipipe-x86-4.19.y, a 
faster one will be gitk etc. locally on the same branch.


Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



RE: rtcap destroys packet contents

2019-12-17 Thread Lange Norbert via Xenomai


> -Original Message-
> From: Jan Kiszka 
> Sent: Dienstag, 17. Dezember 2019 08:10
> To: Lange Norbert ; Xenomai
> (xenomai@xenomai.org) 
> Subject: Re: rtcap destroys packet contents
>
> NON-ANDRITZ SOURCE: BE CAUTIOUS WITH CONTENT, LINKS OR
> ATTACHMENTS.
>
>
> On 16.12.19 13:36, Lange Norbert via Xenomai wrote:
> > Hi,
> >
> > I have such a setup, where I push/pull ethernet traffic from an Application
> every millisecond:
> >
> > [App] ---IDDP--> [RTSwitch] --ETH_P_ALL socket--> [rt_igp] [App]
> > <---IDDP-- [RTSwitch] <--ETH_P_ALL socket-- [rt_igp] [Tun]
> > <---tundev---/
> >
> >
> > Now I am sometimes missing packets that the other side should
> > definitely have sent. I wanted to use rtcap to inspect this issue, but
> unfortunately then I get messed up data so that I can't even finish some
> handshake procedures.
> >
> > Is there some incompatibility between RTCAP and ETH_P_ALL (which
> makes its own copies of rtskb's)?
> > Btw, I can't unload rtap/rtnet once loaded.
>
> There is at least no known incompatibility but it may simply have never been
> tested in that combination.
>
> Do you see corruption on packets sent from the rtcap machine or received by
> it?

I definitely see corruption from the "normal" reception over the raw packet 
socket (as soon as the rtcap module is active).
Seems like rtskb are reused before/while they are copied to userspace.

Analyzing the packets from the rtcap fake device for corruption would be 
time-consuming.

Norbert


This message and any attachments are solely for the use of the intended 
recipients. They may contain privileged and/or confidential information or 
other information protected from disclosure. If you are not an intended 
recipient, you are hereby notified that you received this email in error and 
that any review, dissemination, distribution or copying of this email and any 
attachment is strictly prohibited. If you have received this email in error, 
please contact the sender and delete the message and any attachment from your 
system.

ANDRITZ HYDRO GmbH


Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation

Firmensitz/ Registered seat: Wien

Firmenbuchgericht/ Court of registry: Handelsgericht Wien

Firmenbuchnummer/ Company registration: FN 61833 g

DVR: 0605077

UID-Nr.: ATU14756806


Thank You



RE: [I-PIPE] ipipe-core-4.19.89-x86-9 released

2019-12-17 Thread Lange Norbert via Xenomai
Is there an easily digestible list of i-pipe changes (on top of the upstream 
Kernel)?

Norbert

> -Original Message-
> From: Xenomai  On Behalf Of xenomai---
> via Xenomai
> Sent: Dienstag, 17. Dezember 2019 09:47
> To: xenomai@xenomai.org
> Subject: [I-PIPE] ipipe-core-4.19.89-x86-9 released
>
> NON-ANDRITZ SOURCE: BE CAUTIOUS WITH CONTENT, LINKS OR
> ATTACHMENTS.
>
>
> Download URL: https://xenomai.org/downloads/ipipe/v4.x/x86/ipipe-core-
> 4.19.89-x86-9.patch
>
> Repository: https://git.xenomai.org/ipipe-x86 Release tag: ipipe-core-
> 4.19.89-x86-9



This message and any attachments are solely for the use of the intended 
recipients. They may contain privileged and/or confidential information or 
other information protected from disclosure. If you are not an intended 
recipient, you are hereby notified that you received this email in error and 
that any review, dissemination, distribution or copying of this email and any 
attachment is strictly prohibited. If you have received this email in error, 
please contact the sender and delete the message and any attachment from your 
system.

ANDRITZ HYDRO GmbH


Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation

Firmensitz/ Registered seat: Wien

Firmenbuchgericht/ Court of registry: Handelsgericht Wien

Firmenbuchnummer/ Company registration: FN 61833 g

DVR: 0605077

UID-Nr.: ATU14756806


Thank You



[I-PIPE] ipipe-core-4.19.88-cip16-x86-9 released

2019-12-17 Thread xenomai--- via Xenomai
Download URL: 
https://xenomai.org/downloads/ipipe/v4.x/x86/ipipe-core-4.19.88-cip16-x86-9.patch

Repository: https://git.xenomai.org/ipipe-x86
Release tag: ipipe-core-4.19.88-cip16-x86-9



[I-PIPE] ipipe-core-4.19.89-x86-9 released

2019-12-17 Thread xenomai--- via Xenomai
Download URL: 
https://xenomai.org/downloads/ipipe/v4.x/x86/ipipe-core-4.19.89-x86-9.patch

Repository: https://git.xenomai.org/ipipe-x86
Release tag: ipipe-core-4.19.89-x86-9