All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: MONTET Julien <julien.montet@reseau.eseo.fr>,
	Xenomai <xenomai@xenomai.org>
Cc: Marco Barletta <barlettamarco8@gmail.com>
Subject: Re: [PATCH v2] cobalt: Sort out virtual vs. real pids
Date: Thu, 22 Jul 2021 16:15:12 +0200	[thread overview]
Message-ID: <1a4ef307-1c92-02bb-c982-010b443a3345@siemens.com> (raw)
In-Reply-To: <PR3PR02MB62022D1DAE6588BDA63079F8D1E49@PR3PR02MB6202.eurprd02.prod.outlook.com>

On 22.07.21 14:07, MONTET Julien wrote:
> Hi,
> 
> I tested all of your patches last week, and it did not change anything. 
> Compiling the Xenomai libraries directly on Docker didn't solve the issue.
> 
> The Xenomai timer seems to work, I can loop on it and print the time
> (but it was also working before).
> 
> Unfortunately I am still stuck on rt_task_wait_period(...).
> 

That might be becaues I was looking at Marco's test case so as he shared 
his...

I starred at the code again, and this on top may help (and also fix 
signaling by udd):

diff --git a/kernel/cobalt/posix/thread.c b/kernel/cobalt/posix/thread.c
index 2f3ea1dec4..6a79fecb5c 100644
--- a/kernel/cobalt/posix/thread.c
+++ b/kernel/cobalt/posix/thread.c
@@ -176,11 +176,11 @@ struct cobalt_thread *cobalt_thread_find(pid_t pid) /* nklocked, IRQs off */
 }
 EXPORT_SYMBOL_GPL(cobalt_thread_find);
 
-struct cobalt_thread *cobalt_thread_find_local(pid_t pid) /* nklocked, IRQs off */
+struct cobalt_thread *cobalt_thread_find_local(pid_t vpid) /* nklocked, IRQs off */
 {
 	struct cobalt_thread *thread;
 
-	thread = cobalt_thread_find(pid);
+	thread = cobalt_thread_find(cobalt_vpid2pid_nr(vpid));
 	if (thread == NULL || thread->hkey.mm != current->mm)
 		return NULL;
 
diff --git a/kernel/cobalt/posix/thread.h b/kernel/cobalt/posix/thread.h
index 51be372a7a..66e3a88223 100644
--- a/kernel/cobalt/posix/thread.h
+++ b/kernel/cobalt/posix/thread.h
@@ -146,7 +146,7 @@ int cobalt_thread_setschedprio(unsigned long pth,
 
 struct cobalt_thread *cobalt_thread_find(pid_t pid);
 
-struct cobalt_thread *cobalt_thread_find_local(pid_t pid);
+struct cobalt_thread *cobalt_thread_find_local(pid_t vpid);
 
 struct cobalt_thread *cobalt_thread_lookup(unsigned long pth);
 

> In any case, I will keep you informed if I achieve to implement this or
> find my issue.
> Do not hesitate to suggest debugging tools/methods, I will be pleased to
> give you feedback on the results.
> 

BTW, there is the bad news that threadobj_stat() uses /proc to retrieve
thread statistics. That will remain broken over pid namespaces until we
virtualize /proc as well. That affects rt_task_inquire and the registry 
service /wrt tasks.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


  reply	other threads:[~2021-07-22 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  9:46 [PATCH v2] cobalt: Sort out virtual vs. real pids Jan Kiszka
2021-07-22  6:08 ` Jan Kiszka
2021-07-22 12:07   ` MONTET Julien
2021-07-22 14:15     ` Jan Kiszka [this message]
2021-08-02 16:54       ` Jan Kiszka

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=1a4ef307-1c92-02bb-c982-010b443a3345@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=barlettamarco8@gmail.com \
    --cc=julien.montet@reseau.eseo.fr \
    --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.