osdir.com
mailing list archive

Subject: Re: [patch] oprofile + ppc750cx perfmon - msg#00161

List: linux.oprofile

Date: Prev Next Index Thread: Prev Next Index
On Tue, 2003-03-25 at 09:57, Bryan Rittmeyer wrote:

> wow. inside of open_pic.c, I bet it's code like this
>
> while (openpic_read(addr) & OPENPIC_ACTIVITY);
>
> that's showing up.

That's interesting. You are raising again an old debate of
wether to disable the IRQ during handling on openpic or not,
I beleive we don't need to disable it on this PIC, but we
do this for "safety" reasons.

In fact, I think our

openpic_ack_irq() should do something like

if (edge)
openpic_eoi();

and our openpic_end_irq() something like

if (level)
openpic_eoi();

Also, the fact that PIC access is slow is a generic "feature"
of such chips, I also think we could actually be smarter and only
soft-disable IRQs with a flag in the descriptor, and hard disable
them if and only if they actually occur while disabled.

Ben.



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: [PATCH 1/2] Module load notification take 3

In message <20030325020316.GA95492@xxxxxxxxxxxxxxxxx> you write: > > Implement a module load notifier for the benefit of OProfile, tested > with .66 on UP. Minor change to make unregister_module_notifier return void. Either way Linus, don't really mind. Please apply. Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. Name: Module Notifier Patch Author: John Levon Status: Experimental D: Adds a notifier for when modules are inserted, for use of oprofile. diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17066-linux-2.5.66/include/linux/module.h .17066-linux-2.5.66.updated/include/linux/module.h --- .17066-linux-2.5.66/include/linux/module.h 2003-03-25 12:17:31.000000000 +1100 +++ .17066-linux-2.5.66.updated/include/linux/module.h 2003-03-25 17:31:06.000000000 +1100 @@ -138,6 +138,7 @@ struct exception_table const struct exception_table_entry *entry; }; +struct notifier_block; #ifdef CONFIG_MODULES @@ -348,6 +349,9 @@ const char *module_address_lookup(unsign /* For extable.c to search modules' exception tables. */ const struct exception_table_entry *search_module_extables(unsigned long addr); +int register_module_notifier(struct notifier_block *nb); +void unregister_module_notifier(struct notifier_block *nb); + #else /* !CONFIG_MODULES... */ #define EXPORT_SYMBOL(sym) #define EXPORT_SYMBOL_GPL(sym) @@ -392,6 +396,17 @@ static inline const char *module_address { return NULL; } + +static inline int register_module_notifier(struct notifier_block *nb) +{ + /* no events will happen anyway, so this can always succeed */ + return 0; +} + +static inline void unregister_module_notifier(struct notifier_block *nb) +{ +} + #endif /* CONFIG_MODULES */ #ifdef MODULE diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .17066-linux-2.5.66/kernel/module.c .17066-linux-2.5.66.updated/kernel/module.c --- .17066-linux-2.5.66/kernel/module.c 2003-03-18 05:01:52.000000000 +1100 +++ .17066-linux-2.5.66.updated/kernel/module.c 2003-03-25 17:31:06.000000000 +1100 @@ -31,6 +31,7 @@ #include <linux/errno.h> #include <linux/err.h> #include <linux/vermagic.h> +#include <linux/notifier.h> #include <asm/uaccess.h> #include <asm/semaphore.h> #include <asm/pgalloc.h> @@ -61,6 +62,27 @@ static LIST_HEAD(modules); static LIST_HEAD(symbols); static LIST_HEAD(extables); +static DECLARE_MUTEX(notify_mutex); +static struct notifier_block *module_notify_list; + +int register_module_notifier(struct notifier_block * nb) +{ + int err; + down(&notify_mutex); + err = notifier_chain_register(&module_notify_list, nb); + up(&notify_mutex); + return err; +} +EXPORT_SYMBOL(register_module_notifier); + +void unregister_module_notifier(struct notifier_block * nb) +{ + down(&notify_mutex); + notifier_chain_unregister(&module_notify_list, nb); + up(&notify_mutex); +} +EXPORT_SYMBOL(unregister_module_notifier); + /* We require a truly strong try_module_get() */ static inline int strong_try_module_get(struct module *mod) { @@ -1368,6 +1390,10 @@ sys_init_module(void *umod, /* Drop lock so they can recurse */ up(&module_mutex); + down(&notify_mutex); + notifier_call_chain(&module_notify_list, MODULE_STATE_COMING, mod); + up(&notify_mutex); + /* Start the module */ ret = mod->init(); if (ret < 0) { ------------------------------------------------------- This SF.net email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

Next Message by Date: click to view message preview

Re: [patch] oprofile + ppc750cx perfmon

On Mon, Mar 24, 2003 at 09:09:00PM -0800, Bryan Rittmeyer wrote: > I'm going to try the hybrid approach and will post new patches soon. done. patches are -v0002 at http://bryanr.org/linux/oprofile/ seems to be working pretty well, definitely _way_ more stable than the patches that mix perfmon+decrementer... biggest kernel cycle wasters during an imac ping -f run over ssh: c0031344 20524 1.02949 kmalloc c00d4ab4 22232 1.11516 netif_rx c0074b98 24220 1.21488 n_tty_receive_buf c00332e0 25583 1.28325 __free_pages_ok c008ce68 28961 1.45269 gem_start_xmit c00223a0 31661 1.58812 sys_rt_sigprocmask c00eb92c 35584 1.7849 tcp_sendmsg c003be24 38461 1.92921 fput c004c55c 44923 2.25335 do_select c0012804 47443 2.37975 memcpy c0012980 50239 2.52 __copy_tofrom_user c000452c 51645 2.59053 restore c008c570 53061 2.66155 gem_rx c004c7cc 56388 2.82844 sys_select c008cae0 64265 3.22355 gem_interrupt c0005b9c 148240 7.43576 idled c000db34 242388 12.1583 openpic_read wow. inside of open_pic.c, I bet it's code like this while (openpic_read(addr) & OPENPIC_ACTIVITY); that's showing up. anyway, a short-term PPC oprofile TODO: - further stress/stability testing (overnight etc) - re-allow power_save_6xx() when not profiling - actually use config options instead of hardcoding perfmon rate - userspace profiling system call hooks - fix op_start race between perfmon and decrementer (?) - code to call timer_interrupt() at approximately HZ independent of profile counter rate (or is it 2*HZ, heh) - add support for other perfmon features (possible given that we have to call timer_interrupt and thus need something periodic?) If you play with this, please let me know how it goes. Ignoring the rough edges it should be basically useable for kernel/module profiling, even on code with irqs disabled. -Bryan ------------------------------------------------------- This SF.net email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

Previous Message by Thread: click to view message preview

Re: [patch] oprofile + ppc750cx perfmon

On Mon, Mar 24, 2003 at 09:09:00PM -0800, Bryan Rittmeyer wrote: > I'm going to try the hybrid approach and will post new patches soon. done. patches are -v0002 at http://bryanr.org/linux/oprofile/ seems to be working pretty well, definitely _way_ more stable than the patches that mix perfmon+decrementer... biggest kernel cycle wasters during an imac ping -f run over ssh: c0031344 20524 1.02949 kmalloc c00d4ab4 22232 1.11516 netif_rx c0074b98 24220 1.21488 n_tty_receive_buf c00332e0 25583 1.28325 __free_pages_ok c008ce68 28961 1.45269 gem_start_xmit c00223a0 31661 1.58812 sys_rt_sigprocmask c00eb92c 35584 1.7849 tcp_sendmsg c003be24 38461 1.92921 fput c004c55c 44923 2.25335 do_select c0012804 47443 2.37975 memcpy c0012980 50239 2.52 __copy_tofrom_user c000452c 51645 2.59053 restore c008c570 53061 2.66155 gem_rx c004c7cc 56388 2.82844 sys_select c008cae0 64265 3.22355 gem_interrupt c0005b9c 148240 7.43576 idled c000db34 242388 12.1583 openpic_read wow. inside of open_pic.c, I bet it's code like this while (openpic_read(addr) & OPENPIC_ACTIVITY); that's showing up. anyway, a short-term PPC oprofile TODO: - further stress/stability testing (overnight etc) - re-allow power_save_6xx() when not profiling - actually use config options instead of hardcoding perfmon rate - userspace profiling system call hooks - fix op_start race between perfmon and decrementer (?) - code to call timer_interrupt() at approximately HZ independent of profile counter rate (or is it 2*HZ, heh) - add support for other perfmon features (possible given that we have to call timer_interrupt and thus need something periodic?) If you play with this, please let me know how it goes. Ignoring the rough edges it should be basically useable for kernel/module profiling, even on code with irqs disabled. -Bryan ------------------------------------------------------- This SF.net email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

Next Message by Thread: click to view message preview

Re: [patch] oprofile + ppc750cx perfmon

On Tue, Mar 25, 2003 at 12:57:59AM -0800, Bryan Rittmeyer wrote: > done. patches are -v0002 at http://bryanr.org/linux/oprofile/ Looks OK, modulo some minor style issues (see doc/CodingStyle). The patch seems to be out of date already though. Does the new cpu speed code not work OK for you (for the default event value) ? > sadly, the oprofile functions rely on PC coming from pt_regs Then you should fix this generally, instead of adding the hack you do. > +/* TODO: fix upper level. this is really lame. */ Sure. regards john ------------------------------------------------------- This SF.net email is sponsored by: The Definitive IT and Networking Event. Be There! NetWorld+Interop Las Vegas 2003 -- Register today! http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by