public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
	ck@vds.kolivas.org, tony@atomide.com
Subject: Re: [PATCH] i386 no idle hz - aka dynticks v051118-1
Date: Sun, 20 Nov 2005 14:43:30 +1100	[thread overview]
Message-ID: <200511201443.30859.kernel@kolivas.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0511191237020.20310@montezuma.fsmlabs.com>

On Sun, 20 Nov 2005 07:58, Zwane Mwaikambo wrote:
> It may be a little hard to see my comments as i've re-attached the patch
> inline as i couldn't reply-to properly (it was an attachment).

My bad sorry I'm addicted to a graphical MUA. The best I can do is inline the 
attachment. I could probably cut and paste but I'm afraid of mangling the 
patch.

> @@ -932,6 +933,9 @@ void (*wait_timer_tick)(void) __devinitd
>
>  #define APIC_DIVISOR 16
>
> +static u32 apic_timer_val;
>
> __read_mostly ?

Yeah I like that idea.

> +void dyn_tick_interrupt(int irq, struct pt_regs *regs)
> +{
> +	int all_were_sleeping = 0;
> +	int cpu = smp_processor_id();
> +
> +	if (!cpu_isset(cpu, nohz_cpu_mask))
> +		return;
> +
> +	spin_lock(dyn_tick_lock);
>
> This is going to cause contention problems for things like
> smp_call_function since all processors will be calling back to
> dyn_tick_interrupt.

Hmm got any ideas?

> +	if (cpus_equal(nohz_cpu_mask, cpu_online_map))
> +		all_were_sleeping = 1;
> +	cpu_clear(cpu, nohz_cpu_mask);
> +
> +	if (all_were_sleeping) {
> +		/* Recover jiffies */
> +		if (irq) {
>
> Perhaps simply call the 'irq' parameter as in_irq as right now it seems to
> mean anything between irq or vector and somewhat confusing.

Do you mean not pass the irq variables and just check for if (in_irq()) ?

> @@ -1190,15 +1191,19 @@ static inline void ioapic_register_intr(
>  		if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
>  				trigger == IOAPIC_LEVEL)
>  			irq_desc[vector].handler = &ioapic_level_type;
> -		else
> +		else if (vector)
>  			irq_desc[vector].handler = &ioapic_edge_type;
> +		else
> +			irq_desc[vector].handler = IOAPIC_EDGE_TYPE_IRQ0;
>
> Please at least be explicit and not hide things behind #defines
>
> if (vector == 0)
> 	irq_desc[vector].handler = &ioapic_edge_type_irq0

Well ioapic_edge_type_irq0 doesn't exist on !CONFIG_NO_IDLE_HZ and this was a 
way of avoiding ifdefs in this .c file. I'll think about it again.

>  DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_maxaligned_in_smp;
>  EXPORT_PER_CPU_SYMBOL(irq_stat);
> @@ -76,6 +77,8 @@ fastcall unsigned int do_IRQ(struct pt_r
>  	}
>  #endif
>
> +	dyn_tick_interrupt(irq, regs);
>
> This looks like it might contribute quite some contention in the irq fast
> path.

Might or is certain to? I don't really have hardware to test this hypothesis 
(nor do I know how) so I'd like to know how likely you think it is, and if 
there is some obvious way to improve this?

Thanks very much for your comments!

Cheers,
Con

  reply	other threads:[~2005-11-20  3:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-18 12:22 [PATCH] i386 no idle hz - aka dynticks v051118-1 Con Kolivas
2005-11-19 20:58 ` Zwane Mwaikambo
2005-11-20  3:43   ` Con Kolivas [this message]
2005-11-20  8:02 ` Con Kolivas

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=200511201443.30859.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=ck@vds.kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=zwane@arm.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox