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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 03 Aug 2008 12:57:23 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Yinghai Lu <yhlu.kernel@...il.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Dhaval Giani <dhaval@...ux.vnet.ibm.com>,
	Mike Travis <travis@....com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 21/25] serial: change remove NR_IRQS in 8250.c v2

Alan Cox <alan@...rguk.ukuu.org.uk> writes:

> On Sat,  2 Aug 2008 19:59:21 -0700
> Yinghai Lu <yhlu.kernel@...il.com> wrote:
>
>> use small array with index to handle irq locking for serial port
>> hope 32 slot is enough
>
>
> Untested alternative approach

I like it.

Good catch on the m68k serial driver.


> 8250: Remove NR_IRQ usage
>
> From: Alan Cox <alan@...hat.com>

Now to pick a few nits ;)

You are short a definition of NR_IRQ_HASH that is trivial.

>
>  drivers/serial/68328serial.c |   11 ++---------
>  drivers/serial/8250.c        |   41 ++++++++++++++++++++++++++++++++++-------
>  2 files changed, 36 insertions(+), 16 deletions(-)


> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index a97f1ae..7165e88 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -145,11 +145,14 @@ struct uart_8250_port {
>  };
>  
>  struct irq_info {
> -	spinlock_t		lock;
> +	struct			irq_info *next;
	struct hlist_node	hchain;
Would allow us to use the generic hash table code.
> +	int			irq;
> +	spinlock_t		lock;	/* Protects list not the hash */
>  	struct list_head	*head;
>  };
>  
> -static struct irq_info irq_lists[NR_IRQS];
> +static struct irq_info *irq_lists[NR_IRQ_HASH];
> +static DEFINE_SPINLOCK(hash_lock);	/* Used to walk the hash */
static DEFINE_MUTEX(hash_mutex);

kzalloc sleeps....

Looks like we can also tweak serial_do_unlink to free irq_info when
the list goes empty, so we don't have a leak if the driver is ever
unloaded.

Eric
--
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