Hi William, You're right. As you suggest I reverted memory barrier part. Also, added memory barriers while allocating and freeing memory. Can you confirm that if it's okay now or missed anything else ? PS. I couldn't figure out how to reverse function of hotcpu_notifier. That's why I used register_cpu_notifier and #ifdefs. On 6/27/05, William Lee Irwin III wrote: > On Mon, Jun 27, 2005 at 03:13:13PM +0300, Levent Serinol wrote: > > +#ifdef CONFIG_SMP > > +int remove_hash_tables(void) > > +{ > > + int cpu; > > + > > + > > + for_each_online_cpu(cpu) { > > + struct page *page; > > + > > + if (per_cpu(cpu_profile_hits, cpu)[0]) { > > + page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[0]); > > + per_cpu(cpu_profile_hits, cpu)[0] = NULL; > > + __free_page(page); > > + } > > + if (per_cpu(cpu_profile_hits, cpu)[1]) { > > + page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[1]); > > + per_cpu(cpu_profile_hits, cpu)[1] = NULL; > > + __free_page(page); > > + } > > + } > > + return -1; > > Big problem. Timer interrupts can be firing while this is in progress. > The reason for profile_nop() is so that the code I have running during > timer interrupts (protected by local_irq_save()) runs to completion, > where it will afterward discover the flags or variables set to updated > states. You'll probably have to add more (e.g. memory barriers) since > you can tolerate less once you're dynamically allocating and freeing etc. > > > On Mon, Jun 27, 2005 at 03:13:13PM +0300, Levent Serinol wrote: > > @@ -560,7 +668,11 @@ static int __init create_proc_profile(vo > > return 0; > > entry->proc_fops = &proc_profile_operations; > > entry->size = (1+prof_len) * sizeof(atomic_t); > > - hotcpu_notifier(profile_cpu_callback, 0); > > +#ifdef CONFIG_HOTPLUG_CPU > > + register_cpu_notifier(&profile_cpu_notifier); > > +#endif > > + profile_params[0] = prof_on; > > + profile_params[1] = prof_shift; > > return 0; > > } > > module_init(create_proc_profile); > > hotcpu_notifier() is there to avoid the #ifdef; you shouldn't need to > rearrange that. > > Anyway, just keep fixing it up. There should be a few more after this. > > > -- wli > -- Stay out of the road, if you want to grow old. ~ Pink Floyd ~.