lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 8 Dec 2008 14:42:19 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/5] irq: move irq_desc according to smp_affinity v5


* Yinghai Lu <yinghai@...nel.org> wrote:

> +#ifdef CONFIG_MOVE_IRQ_DESC
> +	/* get new one */
> +	desc = irq_to_desc(irq);
> +#endif
>  
>  	spin_unlock(&desc->lock);
>  }
> @@ -467,12 +475,20 @@ handle_edge_irq(unsigned int irq, struct
>  		    !desc->action)) {
>  		desc->status |= (IRQ_PENDING | IRQ_MASKED);
>  		mask_ack_irq(desc, irq);
> +#ifdef CONFIG_MOVE_IRQ_DESC
> +		/* get new one */
> +		desc = irq_to_desc(irq);
> +#endif
>  		goto out_unlock;
>  	}
>  	kstat_incr_irqs_this_cpu(irq, desc);
>  
>  	/* Start handling the irq */
>  	desc->chip->ack(irq);
> +#ifdef CONFIG_MOVE_IRQ_DESC
> +	/* get new one */
> +	desc = irq_to_desc(irq);
> +#endif
>  
>  	/* Mark the IRQ currently in progress.*/
>  	desc->status |= IRQ_INPROGRESS;
> @@ -533,8 +549,13 @@ handle_percpu_irq(unsigned int irq, stru
>  	if (!noirqdebug)
>  		note_interrupt(irq, desc, action_ret);
>  
> -	if (desc->chip->eoi)
> +	if (desc->chip->eoi) {
>  		desc->chip->eoi(irq);
> +#ifdef CONFIG_MOVE_IRQ_DESC
> +		/* get new one */
> +		desc = irq_to_desc(irq);
> +#endif
> +	}
>  }
>  
>  void
> @@ -569,8 +590,13 @@ __set_irq_handler(unsigned int irq, irq_
>  
>  	/* Uninstall? */
>  	if (handle == handle_bad_irq) {
> -		if (desc->chip != &no_irq_chip)
> +		if (desc->chip != &no_irq_chip) {
>  			mask_ack_irq(desc, irq);
> +#ifdef CONFIG_MOVE_IRQ_DESC
> +			/* get new one */
> +			desc = irq_to_desc(irq);
> +#endif

this patch adds a ton of #ifdefs to important .c files, which could all 
have been avoided by introducing a new method:

	desc = irq_remap_to_desc(irq, desc);

which would do something like:

 static struct irq_desc *
 irq_remap_to_desc(unsigned int irq, struct irq_desc *desc)
 {
 #ifdef CONFIG_MOVE_IRQ_DESC
	return irq_to_desc(irq);
 #else
	return desc;
 #endif
 }

right?

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ