prctl patch for fpu faults
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> I think you mentioned awhile ago that a patch like this might be Jesse> welcome. Well, here it is. It's diff'd against 2.4.10 with the ia64 Jesse> patch. Please let me know if you find problems with it.
The patch looks mostly good to me. However, why did you get rid of the rate limiting code? I think we still want that.
--david
The rate limiting stuff really limits the usefulness of the code I think. If you want to get notified of faults, you probably want all of them, and you want to know the ip for each occurence. If you just get some, it doesn't help you debug your code. Maybe there could be a NOTIFY option or something that would get printed only once if the app generated a fault?
Thanks,
Jesse
Quoted 11 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> I think you mentioned awhile ago that a patch like this might be Jesse> welcome. Well, here it is. It's diff'd against 2.4.10 with the ia64 Jesse> patch. Please let me know if you find problems with it.
The patch looks mostly good to me. However, why did you get rid of the rate limiting code? I think we still want that.
--david
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> The rate limiting stuff really limits the usefulness of the Jesse> code I think. If you want to get notified of faults, you Jesse> probably want all of them, and you want to know the ip for Jesse> each occurence. If you just get some, it doesn't help you Jesse> debug your code. Maybe there could be a NOTIFY option or Jesse> something that would get printed only once if the app Jesse> generated a fault?
I feel pretty strongly that we should handle fpswa faults the same way as unaligned faults. Given that we rate limit the unaligned faults, I'd prefer to rate limit fpswa as well. Of course, if you think you'd want to debug more than 5 faults at a time, you could change the tuning parameters (allowing for longer bursts, while keeping the logging rate the same).
--david
Sure, ok. Would you like me to submit a new patch that includes the rate limiting stuff as the default or do you just wanna hack that stuff back in?
Thanks,
Jesse
Quoted 10 lines · David Mosberger
I feel pretty strongly that we should handle fpswa faults the same way as unaligned faults. Given that we rate limit the unaligned faults, I'd prefer to rate limit fpswa as well. Of course, if you think you'd want to debug more than 5 faults at a time, you could change the tuning parameters (allowing for longer bursts, while keeping the logging rate the same).
--david
Err... maybe an ALLPRINT option would be nice instead? Our apps guys were requesting that they be given all the fault messages and ip's. The current behavior could be the default though.
Jesse
Quoted 20 lines · Jesse Barnes
Sure, ok. Would you like me to submit a new patch that includes the rate limiting stuff as the default or do you just wanna hack that stuff back in?
Thanks,
JesseQuoted 10 lines · David Mosberger
I feel pretty strongly that we should handle fpswa faults the same way as unaligned faults. Given that we rate limit the unaligned faults, I'd prefer to rate limit fpswa as well. Of course, if you think you'd want to debug more than 5 faults at a time, you could change the tuning parameters (allowing for longer bursts, while keeping the logging rate the same).
--david
Here's another one. Please let me know if it's ok.
Thanks,
Jesse
arch/ia64/kernel/traps.c +3 -2
@@ -311,7 +311,8 @@if (jiffies - last_time >5 *HZ ) fpu_swa_count =0 ; -if (++fpu_swa_count <5 ) { +if ((current->thread &IA64_THREAD_FPSWA_ALLPRINT ) || + (++fpu_swa_count < 5 && !(current->thread.flags & IA64_THREAD_FPSWA_NOPRINT)) { last_time = jiffies;printk (KERN_WARNING "%s(%d): floating-point assist fault at ip %016lx\n" , current->comm, current->pid, regs->cr_iip +ia64_psr (regs)->ri);
@@ -512,7 +513,7 @@case 32 :/* fp fault */ case 33 :/* fp trap */ result =handle_fpu_swa ((vector =32 ) ?1 :0 , regs, isr); -if (result <0 ) { +if (result <0 || (current->thread.flags &IA64_THREAD_FPSWA_SIGFPE )) { siginfo.si_signo =SIGFPE ; siginfo.si_errno =0 ; siginfo.si_code =FPE_FLTINV ;
include/asm-ia64/processor.h +17 -0
@@ -168,8 +168,13 @@#define IA64_THREAD_UAC_NOPRINT (__IA64_UL(1) << 3)/* don't log unaligned accesses */ #define IA64_THREAD_UAC_SIGBUS (__IA64_UL(1) << 4)/* generate SIGBUS on unaligned acc. */ #define IA64_THREAD_KRBS_SYNCED (__IA64_UL(1) << 5)/* krbs synced with process vm? */ +#define IA64_THREAD_FPSWA_NOPRINT (__IA64_UL(1) << 6)/* don't log any fpswa faults */ +#define IA64_THREAD_FPSWA_ALLPRINT (__IA64_UL(1) << 7)/* log all fpswa faults */ +#define IA64_THREAD_FPSWA_SIGFPE (__IA64_UL(1) << 8)/* send a SIGFPE for fpswa faults */ #define IA64_KERNEL_DEATH (__IA64_UL(1) << 63)/* see die_if_kernel()... */ +#define IA64_THREAD_FPSWA_SHIFT 6 +#define IA64_THREAD_FPSWA_MASK (IA64_THREAD_FPSWA_NOPRINT | IA64_THREAD_FPSWA_ALLPRINT | IA64_THREAD_FPSWA_SIGFPE)#define IA64_THREAD_UAC_SHIFT 3#define IA64_THREAD_UAC_MASK (IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS)
@@ -322,6 +327,18 @@#define GET_UNALIGN_CTL (task,addr) \ ({ \ put_user(((task)->thread.flags & IA64_THREAD_UAC_MASK) >> IA64_THREAD_UAC_SHIFT, \ + (int *) (addr)); \ +}) + +#define SET_FPSWA_CTL (task,value) \ +({ \ + (task)->thread.flags = (((task)->thread.flags & ~IA64_THREAD_FPSWA_MASK) \ + | (((value) << IA64_THREAD_FPSWA_SHIFT) & IA64_THREAD_FPSWA_MASK)); \ + 0; \ +}) +#define GET_FPSWA_CTL (task,addr) \ +({ \ + put_user(((task)->thread.flags & IA64_THREAD_FPSWA_MASK) >> IA64_THREAD_FPSWA_SHIFT, \ (int *) (addr)); \ })
include/linux/prctl.h +4 -0
@@ -20,4 +20,8 @@#define PR_GET_KEEPCAPS 7#define PR_SET_KEEPCAPS 8 +/* controls the printing of fpswa fault warnings */ +#define PR_GET_FPSWA 9 +#define PR_SET_FPSWA 10 +#endif /* _LINUX_PRCTL_H */
kernel/sys.c +16 -0
@@ -1245,6 +1245,22 @@#endif break ; +case PR_SET_FPSWA : +#ifdef SET_FPSWA_CTL + error =SET_FPSWA_CTL (current, arg2); +#else + error = -EINVAL ; +#endif +break ; + +case PR_GET_FPSWA : +#ifdef GET_FPSWA_CTL + error =GET_FPSWA_CTL (current, arg2); +#else + error = -EINVAL ; +#endif +break ; +case PR_GET_KEEPCAPS :if (current->keep_capabilities) error =1 ;
What if I were to get rid of the rate limited logging for both the unaligned and fpswa handlers? Then there could just be a NOPRINT option and a signal option for each; the default behavior would be to log all messages. If you'd rather not get rid of it, then I'll just send a patch to enable NOPRINT for fpswa (similar to what the unaligned handler does now) and a signal option.
Does anyone else have an opinion on the rate limited logging for the unaligned and fpswa handlers? Some people have told me that they don't think it's useful for admins or users to have some of the messages but not all of them.
Thanks,
Jesse
Quoted 20 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> Wouldn't that mean you could only do one at a time, Jesse> i.e. you'd be stuck with the rate limiting code even if you Jesse> just wanted a signal, since there'd be no way to say NOPRINT Jesse> | SIGFPE? I'm really just trying to fill the needs of our Jesse> application programmers, who say they want to get all the Jesse> messages and/or get a signal.
No, I don't think so:
DEFAULT: log message (with rate limit)
NOPRINT: be quiet about fixups (not rate limited)
SIGNAL: send signal (not rate limited)
PRINTALL: log message (not rate limited)In other words, the rate-limiting only applies for the DEFAULT setting.
--david
Quoted 7 lines
What if I were to get rid of the rate limited logging for both the unaligned and fpswa handlers? Then there could just be a NOPRINT option and a signal option for each; the default behavior would be to log all messages. If you'd rather not get rid of it, then I'll just send a patch to enable NOPRINT for fpswa (similar to what the unaligned handler does now) and a signal option.
IMHO, the default for FPSWA fault (& probably unaligned access) should be OFF. Lots of apps cause FP faults. AIM7, for example, causes faults at a fairly high rate. I doubt that any server site would like to see the log polluted with these errors - especially since there is no way to identify the offending app.
There should be a way a site can change the default logging behavior & have it apply to ALL tasks..
Remember that FPSWA is invoked for numerous reasons that are NOT necessarily errors in the application. (AIM7 generates FPSWA faults when it divides a very small number by 2.0). Intel doesnt even specify all the conditions that cause FPSWA to be invoked.
As far as rate limited vs full logging, I like rate limited. Otherwise, you can flood the system with messages. If you are truly trying to debug an app & identify places that cause faults, the SIGNAL method should be used by the app. That way, additional info such as traceback & arguments can be captured.
---
After thinking about it for a while, it seems to me that the kernel logging options should be orthoginal to the user SIGNAL option. A site should be able to select NOPRINT/RATE-LOGGING/FULL_LOGGING. Independently, the user to be able to select SIGNAL/NO_SIGNAL/PRINTALL.
The kernel logging option should NOT be a task attribute. Just have a static flag that controls logging. The value of the flag is NOPRINT/RATEPRINT/FULLPRINT. Default should be NOPRINT. This option should be able to be changed via operator command (/proc).
Independently, users might want to select SIGNAL/NOSIGNAL/(PRINT?) for faults from their application.
Quoted 38 lines
Does anyone else have an opinion on the rate limited logging for the unaligned and fpswa handlers? Some people have told me that they don't think it's useful for admins or users to have some of the messages but not all of them.
Thanks,
JesseQuoted 11 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> Wouldn't that mean you could only do one at a time, Jesse> i.e. you'd be stuck with the rate limiting code even if you Jesse> just wanted a signal, since there'd be no way to say NOPRINT Jesse> | SIGFPE? I'm really just trying to fill the needs of our Jesse> application programmers, who say they want to get all the Jesse> messages and/or get a signal.
No, I don't think so:
Quoted 9 lines
DEFAULT: log message (with rate limit)
NOPRINT: be quiet about fixups (not rate limited)
SIGNAL: send signal (not rate limited)
PRINTALL: log message (not rate limited)In other words, the rate-limiting only applies for the DEFAULT setting.
--david_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64
Signature · 3 lines
Thanks Jack Steiner (651-683-5302) (vnet 233-5302) [email protected]
It depends upon the frequency that the FPSWA and unaligned faults occur. My experience is that, if you get any of these messages, you get a lot o f them. I like the 4 options David proposes, this gives you the flexibility to manage these events in any way you wish. I like to run with the default (rate limited messages) setting - if any messages come out I know there is something that needs to be looked at but the system's `printk' buffer doesn't get flooded with duplicated messages.
Quoted 43 lines · Jesse Barnes
What if I were to get rid of the rate limited logging for both the unaligned and fpswa handlers? Then there could just be a NOPRINT option and a signal option for each; the default behavior would be to log all messages. If you'd rather not get rid of it, then I'll just send a patch to enable NOPRINT for fpswa (similar to what the unaligned handler does now) and a signal option.
Does anyone else have an opinion on the rate limited logging for the unaligned and fpswa handlers? Some people have told me that they don't think it's useful for admins or users to have some of the messages but not all of them.
Thanks,
JesseQuoted 11 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> Wouldn't that mean you could only do one at a time, Jesse> i.e. you'd be stuck with the rate limiting code even if you Jesse> just wanted a signal, since there'd be no way to say NOPRINT Jesse> | SIGFPE? I'm really just trying to fill the needs of our Jesse> application programmers, who say they want to get all the Jesse> messages and/or get a signal.
No, I don't think so:
Quoted 9 lines
DEFAULT: log message (with rate limit)
NOPRINT: be quiet about fixups (not rate limited)
SIGNAL: send signal (not rate limited)
PRINTALL: log message (not rate limited)In other words, the rate-limiting only applies for the DEFAULT setting.
--david_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64
Signature · 4 lines
Don Dugger "Censeo Toto nos in Kansa esse decisse." - D. Gale [email protected] Ph: 303/652-0870x117
Alright, I'll put a patch together that has noprint and signal options for the unaligned and fpswa faults. The current, rate limited output will be the default.
Jesse
Quoted 94 lines · Jack Steiner
Quoted 7 lines
What if I were to get rid of the rate limited logging for both the unaligned and fpswa handlers? Then there could just be a NOPRINT option and a signal option for each; the default behavior would be to log all messages. If you'd rather not get rid of it, then I'll just send a patch to enable NOPRINT for fpswa (similar to what the unaligned handler does now) and a signal option.
IMHO, the default for FPSWA fault (& probably unaligned access) should be OFF. Lots of apps cause FP faults. AIM7, for example, causes faults at a fairly high rate. I doubt that any server site would like to see the log polluted with these errors - especially since there is no way to identify the offending app.
There should be a way a site can change the default logging behavior & have it apply to ALL tasks..
Remember that FPSWA is invoked for numerous reasons that are NOT necessarily errors in the application. (AIM7 generates FPSWA faults when it divides a very small number by 2.0). Intel doesnt even specify all the conditions that cause FPSWA to be invoked.
As far as rate limited vs full logging, I like rate limited. Otherwise, you can flood the system with messages. If you are truly trying to debug an app & identify places that cause faults, the SIGNAL method should be used by the app. That way, additional info such as traceback & arguments can be captured.
---
After thinking about it for a while, it seems to me that the kernel logging options should be orthoginal to the user SIGNAL option. A site should be able to select NOPRINT/RATE-LOGGING/FULL_LOGGING. Independently, the user to be able to select SIGNAL/NO_SIGNAL/PRINTALL.
The kernel logging option should NOT be a task attribute. Just have a static flag that controls logging. The value of the flag is NOPRINT/RATEPRINT/FULLPRINT. Default should be NOPRINT. This option should be able to be changed via operator command (/proc).
Independently, users might want to select SIGNAL/NOSIGNAL/(PRINT?) for faults from their application.
Quoted 38 lines
Does anyone else have an opinion on the rate limited logging for the unaligned and fpswa handlers? Some people have told me that they don't think it's useful for admins or users to have some of the messages but not all of them.
Thanks,
JesseQuoted 11 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> Wouldn't that mean you could only do one at a time, Jesse> i.e. you'd be stuck with the rate limiting code even if you Jesse> just wanted a signal, since there'd be no way to say NOPRINT Jesse> | SIGFPE? I'm really just trying to fill the needs of our Jesse> application programmers, who say they want to get all the Jesse> messages and/or get a signal.
No, I don't think so:
Quoted 9 lines
DEFAULT: log message (with rate limit)
NOPRINT: be quiet about fixups (not rate limited)
SIGNAL: send signal (not rate limited)
PRINTALL: log message (not rate limited)In other words, the rate-limiting only applies for the DEFAULT setting.
--david_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64Signature · 9 lines
Thanks Jack Steiner (651-683-5302) (vnet 233-5302) [email protected] _______________________________________________ Linux-IA64 mailing list [email protected] http://lists.linuxia64.org/lists/listinfo/linux-ia64
David/Jesse,
I would like the default to be noprint. As Jack mentioned that there are applications that will generate lots of these messages. These messages are ok for development systems and debugging applications but for production systems this creates problem. Most of the users want to run the applications (production) that do not require changing the configuration. We have seen people running applications on top of Linux and complaining about the performance compared to other OSes. The performance difference is due to the logging of these messages.
Thanks,
Asit
Quoted 148 lines
-----Original Message-----
From: Jesse Barnes [mailto:[email protected]]
Sent: Wednesday, October 10, 2001 9:34 AM
Cc: [email protected]
Subject: Re: [Linux-ia64] Re: prctl patch for fpu faultsAlright, I'll put a patch together that has noprint and signal options for
the unaligned and fpswa faults. The current, rate limited output will be
the default.Jesse
Quoted 3 lines · Jack Steiner
Quoted 3 lines
What if I were to get rid of the rate limited logging for both the unaligned and fpswa handlers? Then there could just be a
NOPRINT option
Quoted 1 line
Quoted 1 line
and a signal option for each; the default behavior would
be to log all
Quoted 1 line
Quoted 1 line
messages. If you'd rather not get rid of it, then I'll
just send a patch
Quoted 1 line
Quoted 1 line
to enable NOPRINT for fpswa (similar to what the
unaligned handler does
Quoted 3 lines
Quoted 1 line
now) and a signal option.
IMHO, the default for FPSWA fault (& probably unaligned
access) should be OFF.
Quoted 1 line
Lots of apps cause FP faults. AIM7, for example, causes
faults at a fairly high
Quoted 1 line
rate. I doubt that any server site would like to see the
log polluted with
Quoted 1 line
these errors - especially since there is no way to identify
the offending app.
Quoted 2 lines
There should be a way a site can change the default logging
behavior & have it
Quoted 4 lines
apply to ALL tasks..
Remember that FPSWA is invoked for numerous reasons that
are NOT necessarily
Quoted 1 line
errors in the application. (AIM7 generates FPSWA faults
when it divides a
Quoted 1 line
very small number by 2.0). Intel doesnt even specify all
the conditions that cause
Quoted 3 lines
FPSWA to be invoked.
As far as rate limited vs full logging, I like rate
limited. Otherwise, you can
Quoted 1 line
flood the system with messages. If you are truly trying to
debug an app & identify
Quoted 1 line
places that cause faults, the SIGNAL method should be used
by the app.
Quoted 1 line
That way, additional info such as traceback & arguments can
be captured.
Quoted 4 lines
---
After thinking about it for a while, it seems to me that
the kernel logging options
Quoted 1 line
should be orthoginal to the user SIGNAL option. A site
should be able to select
Quoted 1 line
NOPRINT/RATE-LOGGING/FULL_LOGGING. Independently, the user
to be able to select
Quoted 5 lines
SIGNAL/NO_SIGNAL/PRINTALL.
The kernel logging option should NOT be a task attribute. Just have a static flag that controls logging. The value of the flag is NOPRINT/RATEPRINT/FULLPRINT. Default should be NOPRINT.
This option should
Quoted 8 lines
be able to be changed via operator command (/proc).
Independently, users might want to select SIGNAL/NOSIGNAL/(PRINT?) for faults from their application.
Quoted 2 lines
Does anyone else have an opinion on the rate limited
logging for the
Quoted 1 line
Quoted 1 line
unaligned and fpswa handlers? Some people have told me
that they don't
Quoted 1 line
Quoted 1 line
think it's useful for admins or users to have some of the
messages but not
Quoted 8 lines
Quoted 8 lines
all of them.
Thanks,
JesseQuoted 1 line · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
On Tue, 9 Oct 2001 10:38:57 -0700, Jesse Barnes
Quoted 3 lines · <[email protected]> said:
Quoted 3 lines
Quoted 3 lines
Jesse> Wouldn't that mean you could only do one at a time, Jesse> i.e. you'd be stuck with the rate limiting
code even if you
Quoted 1 line
Quoted 1 line
Quoted 1 line
Jesse> just wanted a signal, since there'd be no way
to say NOPRINT
Quoted 1 line
Quoted 1 line
Quoted 1 line
Jesse> | SIGFPE? I'm really just trying to fill the
needs of our
Quoted 1 line
Quoted 1 line
Quoted 1 line
Jesse> application programmers, who say they want to
get all the
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Jesse> messages and/or get a signal.
No, I don't think so:
DEFAULT: log message (with rate limit)
NOPRINT: be quiet about fixups (not rate limited)
SIGNAL: send signal (not rate limited)
PRINTALL: log message (not rate limited)In other words, the rate-limiting only applies for the
DEFAULT setting.
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
--davidQuoted 11 lines
Quoted 5 lines
_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64Signature · 3 lines
Thanks Jack Steiner (651-683-5302) (vnet 233-5302)Quoted 7 lines
_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Asit K
Asit> David/Jesse, I would like the default to be noprint. As Jack Asit> mentioned that there are applications that will generate lots Asit> of these messages. These messages are ok for development Asit> systems and debugging applications but for production systems Asit> this creates problem. Most of the users want to run the Asit> applications (production) that do not require changing the Asit> configuration.
It's fine by me if distributors set things up such that they're disabled by default, but for the kernel I'm releasing, I'll keep them turned on. It's just too easy to forget about them otherwise. And a program that accidentally generates tons of unaligned faults or fpswa faults will perform *a lot* worse than a program that occasionally generates a log message.
Asit> We have seen people running applications on top of Linux and Asit> complaining about the performance compared to other OSes. The Asit> performance difference is due to the logging of these Asit> messages.
Can you be more specific? A machine should easily tolerate a rate of one logged message per second, so if this makes a significant performance difference, that would be strange.
--david
Quoted 11 lines · Asit K
David/Jesse,
I would like the default to be noprint. As Jack mentioned that there are applications that will generate lots of these messages. These messages are ok for development systems and debugging applications but for production systems this creates problem. Most of the users want to run the applications (production) that do not require changing the configuration. We have seen people running applications on top of Linux and complaining about the performance compared to other OSes. The performance difference is due to the logging of these messages.
Really? I would have thought the rate-limiting mode would reduce the logging (printing) to noise relative to the (huge) overhead of the traps.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jack Steiner
Jack> There should be a way a site can change the default logging Jack> behavior & have it apply to ALL tasks..
I agree. In theory, if you can change the behavior of "init", you'll change the behavior of all subsequent tasks (the settings are inherited across fork). If you're willing to hack /etc/inittab, you could probably do that with the "prctl" utility today (or perhaps even with prctl + a suitable kernel command line), but none of these solutions seem to be very pretty. Perhaps someone can come up with a cleaner solution?
--david
I was thinking of hacking up the 'prctl' tool to take a PID as an argument, that way it could set the flags for any task. It would allow an initscript to set init's flags, among other things. Would such a change qualify as a cleaner solution?
Jesse
Quoted 15 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jack Steiner
Jack> There should be a way a site can change the default logging Jack> behavior & have it apply to ALL tasks..
I agree. In theory, if you can change the behavior of "init", you'll change the behavior of all subsequent tasks (the settings are inherited across fork). If you're willing to hack
/etc/inittab, you could probably do that with the "prctl" utility today (or perhaps even with prctl + a suitable kernel command line), but none of these solutions seem to be very pretty. Perhaps someone can come up with a cleaner solution?--david
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> I was thinking of hacking up the 'prctl' tool to take a PID Jesse> as an argument, that way it could set the flags for any task. Jesse> It would allow an initscript to set init's flags, among other Jesse> things. Would such a change qualify as a cleaner solution?
Yes, but how do you change the settings for the target process? prctl(2) can only change the setting of the calling process (there is no pid argument). You can't do it via ptrace() either.
--david
That sounds interesting. You could use it on init task as David suggested and set the behavior for all tasks. But how would you implement it form a user space tool like "prctl". sys_prctl() operates on the current task only. Are you planning to add another system call?
--
Khalid
Quoted 8 lines · Jesse Barnes
I was thinking of hacking up the 'prctl' tool to take a PID as an argument, that way it could set the flags for any task. It would allow an initscript to set init's flags, among other things. Would such a change qualify as a cleaner solution?
Jesse
==================================
Khalid Aziz Linux Systems Operation R&D
(970)898-9214 Hewlett-Packard
[email protected] Fort Collins, CO
Can't prctl take up to 5 args though? If binary compatibility were an issue, a new prctl could be made that accepts a pid as well, right?
Jesse
Quoted 13 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> I was thinking of hacking up the 'prctl' tool to take a PID Jesse> as an argument, that way it could set the flags for any task. Jesse> It would allow an initscript to set init's flags, among other Jesse> things. Would such a change qualify as a cleaner solution?
Yes, but how do you change the settings for the target process? prctl(2) can only change the setting of the calling process (there is no pid argument). You can't do it via
ptrace()either.--david
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Jesse Barnes
Jesse> Can't prctl take up to 5 args though? If binary Jesse> compatibility were an issue, a new prctl could be made that Jesse> accepts a pid as well, right?
The latter seems cleaner, but someone would have to fight the battle to get this into the platform-independent portion of the kernel (and worry about all the security issues that ptrace has to worry about, etc). If you want to pursue this, that would be great. But the discussion should involve the linux-kernel list in that case.
--david
Quoted 4 lines
Can you be more specific? A machine should easily tolerate a rate of one logged message per second, so if this makes a significant performance difference, that would be strange.
We saw a 2-5% performance degradation of specfp benchmarks when the logging was enabled. I can take a look at this again and see how often the FPSWA messages are getting logged.
Thanks,
Asit
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line · Asit K
Can you be more specific? A machine should easily tolerate a rate of one logged message per second, so if this makes a significant performance difference, that would be strange.
Asit> We saw a 2-5% performance degradation of specfp benchmarks Asit> when the logging was enabled. I can take a look at this again Asit> and see how often the FPSWA messages are getting logged.
On which one? Speed or throughput?
--david