All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] xnsched_resched_p test in hisyscall
@ 2007-10-18 20:46 Jan Kiszka
  2007-10-19  3:27 ` Philippe Gerum
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2007-10-18 20:46 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

Hi Philippe,

what's the point about

	if (xnsched_resched_p())
		xnpod_schedule();

at the beginning of do_hisyscall_event() [1]? Could you provide a
comment for the background of this hunk? Or can we even remove it?

Jan

[1]http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/nucleus/shadow.c?v=SVN-trunk#1870


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

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

* Re: [Xenomai-core] xnsched_resched_p test in hisyscall
  2007-10-18 20:46 [Xenomai-core] xnsched_resched_p test in hisyscall Jan Kiszka
@ 2007-10-19  3:27 ` Philippe Gerum
  2007-10-19  8:04   ` [Xenomai-core] [PATCH] avoid resched test on syscall entry (was: xnsched_resched_p test in hisyscall) Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Gerum @ 2007-10-19  3:27 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

On Thu, 2007-10-18 at 22:46 +0200, Jan Kiszka wrote:
> Hi Philippe,
> 
> what's the point about
> 
> 	if (xnsched_resched_p())
> 		xnpod_schedule();
> 
> at the beginning of do_hisyscall_event() [1]? Could you provide a
> comment for the background of this hunk? Or can we even remove it?

No, we can't. It's a Blackfin-specific thing in disguise actually, so we
may make this code conditional through some arch-dependent wrapper
though.
http://www.rts.uni-hannover.de/xenomai/lxr/source/include/asm-blackfin/bits/pod.h#141

> 
> Jan
> 
> [1]http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/nucleus/shadow.c?v=SVN-trunk#1870
> 
-- 
Philippe.




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

* [Xenomai-core] [PATCH] avoid resched test on syscall entry (was: xnsched_resched_p test in hisyscall)
  2007-10-19  3:27 ` Philippe Gerum
@ 2007-10-19  8:04   ` Jan Kiszka
  2007-11-05  7:53     ` [Xenomai-core] [PATCH] avoid resched test on syscall entry Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2007-10-19  8:04 UTC (permalink / raw)
  To: rpm; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

Philippe Gerum wrote:
> On Thu, 2007-10-18 at 22:46 +0200, Jan Kiszka wrote:
>> Hi Philippe,
>>
>> what's the point about
>>
>> 	if (xnsched_resched_p())
>> 		xnpod_schedule();
>>
>> at the beginning of do_hisyscall_event() [1]? Could you provide a
>> comment for the background of this hunk? Or can we even remove it?
> 
> No, we can't. It's a Blackfin-specific thing in disguise actually, so we
> may make this code conditional through some arch-dependent wrapper
> though.
> http://www.rts.uni-hannover.de/xenomai/lxr/source/include/asm-blackfin/bits/pod.h#141
> 

Something like the attached patch?

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

[-- Attachment #2: add-xnarch_hisyscall_entry.patch --]
[-- Type: text/x-patch, Size: 1526 bytes --]

---
 include/asm-blackfin/system.h |    7 +++++++
 include/asm-generic/system.h  |    4 ++++
 ksrc/nucleus/shadow.c         |    3 +--
 3 files changed, 12 insertions(+), 2 deletions(-)

Index: xenomai/include/asm-blackfin/system.h
===================================================================
--- xenomai.orig/include/asm-blackfin/system.h
+++ xenomai/include/asm-blackfin/system.h
@@ -95,6 +95,13 @@ static inline void xnarch_free_host_mem 
     kfree(chunk);
 }
 
+static inline void xnarch_hisyscall_entry(void)
+{
+	if (xnsched_resched_p())
+		xnpod_schedule();
+}
+#define xnarch_hisyscall_entry	xnarch_hisyscall_entry
+
 #ifdef __cplusplus
 }
 #endif
Index: xenomai/include/asm-generic/system.h
===================================================================
--- xenomai.orig/include/asm-generic/system.h
+++ xenomai/include/asm-generic/system.h
@@ -410,6 +410,10 @@ static inline int xnarch_remap_io_page_r
     return wrap_remap_io_page_range(vma,from,to,size,prot);
 }
 
+#ifndef xnarch_hisyscall_entry
+static inline void xnarch_hisyscall_entry(void)	{ }
+#endif
+
 #ifdef __cplusplus
 }
 #endif
Index: xenomai/ksrc/nucleus/shadow.c
===================================================================
--- xenomai.orig/ksrc/nucleus/shadow.c
+++ xenomai/ksrc/nucleus/shadow.c
@@ -1878,8 +1878,7 @@ static inline int do_hisyscall_event(uns
 	if (!xnpod_active_p())
 		goto no_skin;
 
-	if (xnsched_resched_p())
-		xnpod_schedule();
+	xnarch_hisyscall_entry();
 
 	p = current;
 	thread = xnshadow_thread(p);

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

* Re: [Xenomai-core] [PATCH] avoid resched test on syscall entry
  2007-10-19  8:04   ` [Xenomai-core] [PATCH] avoid resched test on syscall entry (was: xnsched_resched_p test in hisyscall) Jan Kiszka
@ 2007-11-05  7:53     ` Jan Kiszka
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kiszka @ 2007-11-05  7:53 UTC (permalink / raw)
  To: rpm; +Cc: xenomai-core


[-- Attachment #1.1: Type: text/plain, Size: 827 bytes --]

Jan Kiszka wrote:
> Philippe Gerum wrote:
>> On Thu, 2007-10-18 at 22:46 +0200, Jan Kiszka wrote:
>>> Hi Philippe,
>>>
>>> what's the point about
>>>
>>> 	if (xnsched_resched_p())
>>> 		xnpod_schedule();
>>>
>>> at the beginning of do_hisyscall_event() [1]? Could you provide a
>>> comment for the background of this hunk? Or can we even remove it?
>> No, we can't. It's a Blackfin-specific thing in disguise actually, so we
>> may make this code conditional through some arch-dependent wrapper
>> though.
>> http://www.rts.uni-hannover.de/xenomai/lxr/source/include/asm-blackfin/bits/pod.h#141
>>
> 
> Something like the attached patch?

Because you pointed out that overloading functions names with macros can
be problematic (with older compilers?), here comes a variant free of
such a pattern.

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: add-xnarch_hisyscall_entry-v2.patch --]
[-- Type: text/x-patch; name="add-xnarch_hisyscall_entry-v2.patch", Size: 1583 bytes --]

---
 include/asm-blackfin/system.h |    7 +++++++
 include/asm-generic/system.h  |    4 ++++
 ksrc/nucleus/shadow.c         |    3 +--
 3 files changed, 12 insertions(+), 2 deletions(-)

Index: xenomai/include/asm-blackfin/system.h
===================================================================
--- xenomai.orig/include/asm-blackfin/system.h
+++ xenomai/include/asm-blackfin/system.h
@@ -95,6 +95,13 @@ static inline void xnarch_free_host_mem 
     kfree(chunk);
 }
 
+static inline void __xnarch_hisyscall_entry(void)
+{
+	if (xnsched_resched_p())
+		xnpod_schedule();
+}
+#define xnarch_hisyscall_entry	__xnarch_hisyscall_entry
+
 #ifdef __cplusplus
 }
 #endif
Index: xenomai/include/asm-generic/system.h
===================================================================
--- xenomai.orig/include/asm-generic/system.h
+++ xenomai/include/asm-generic/system.h
@@ -410,6 +410,10 @@ static inline int xnarch_remap_io_page_r
     return wrap_remap_io_page_range(vma,from,to,size,prot);
 }
 
+#ifndef xnarch_hisyscall_entry
+static inline void xnarch_hisyscall_entry(void)	{ }
+#endif
+
 #ifdef __cplusplus
 }
 #endif
Index: xenomai/ksrc/nucleus/shadow.c
===================================================================
--- xenomai.orig/ksrc/nucleus/shadow.c
+++ xenomai/ksrc/nucleus/shadow.c
@@ -1878,8 +1878,7 @@ static inline int do_hisyscall_event(uns
 	if (!xnpod_active_p())
 		goto no_skin;
 
-	if (xnsched_resched_p())
-		xnpod_schedule();
+	xnarch_hisyscall_entry();
 
 	p = current;
 	thread = xnshadow_thread(p);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]

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

end of thread, other threads:[~2007-11-05  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-18 20:46 [Xenomai-core] xnsched_resched_p test in hisyscall Jan Kiszka
2007-10-19  3:27 ` Philippe Gerum
2007-10-19  8:04   ` [Xenomai-core] [PATCH] avoid resched test on syscall entry (was: xnsched_resched_p test in hisyscall) Jan Kiszka
2007-11-05  7:53     ` [Xenomai-core] [PATCH] avoid resched test on syscall entry Jan Kiszka

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.