From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] sparse_irq aka dyn_irq
Date: Sun, 9 Nov 2008 10:50:22 +0300 [thread overview]
Message-ID: <20081109075021.GB12238@localhost> (raw)
In-Reply-To: <49168BD3.5010204@kernel.org>
[Yinghai Lu - Sat, Nov 08, 2008 at 11:05:55PM -0800]
|
| impact: new feature sparseirq
|
| for sparse_irq, irq_desc, and irq_cfg is not using list_head to chain up
| also not add per_cpu_dyn_array... no user now
|
| add some kind of hash table as Ingo suggesting.
| remove dyna_array, and enable sparse_irq by default, use kzalloc_node to get it
| use desc->chip_data for x86 to store irq_cfg
| make irq_desc to go with affinity aka irq_desc moving etc
| only call move_irq_desc in irq_complete_move() --- but it seems not trigger that moving.
|
| Signed-off-by: Yinghai Lu <yinghai@kernel.org>
|
| ---
Hi Yinghai,
from a glance view (didn't read the whole patch)
...
|
| -static struct irq_cfg *irq_cfg_alloc(unsigned int irq)
| +static struct irq_cfg *get_one_free_irq_cfg(int cpu)
| {
| - return irq_cfg(irq);
| + struct irq_cfg *cfg;
| + int node;
| +
| + if (cpu < 0)
| + cpu = smp_processor_id();
| + node = cpu_to_node(cpu);
| +
| + cfg = kzalloc_node(sizeof(*cfg), GFP_KERNEL, node);
| + printk(KERN_DEBUG " alloc irq_cfg on cpu %d node %d\n", cpu, node);
| +
| + return cfg;
| }
|
| -/*
| - * Rough estimation of how many shared IRQs there are, can be changed
| - * anytime.
| - */
| -#define MAX_PLUS_SHARED_IRQS NR_IRQS
| -#define PIN_MAP_SIZE (MAX_PLUS_SHARED_IRQS + NR_IRQS)
| +static void free_irq_cfg(struct irq_cfg *cfg)
| +{
| + kfree(cfg);
| +}
| +
| +void arch_init_chip_data(struct irq_desc *desc, int cpu)
| +{
| + struct irq_cfg *cfg;
| +
| + cfg = desc->chip_data;
| + if (!cfg)
| + desc->chip_data = get_one_free_irq_cfg(cpu);
| +}
| +
| +static void init_copy_irq_2_pin(struct irq_cfg *old_cfg, struct irq_cfg *cfg,
| + int cpu);
| +
| +void arch_init_copy_chip_data(struct irq_desc *old_desc,
| + struct irq_desc *desc, int cpu)
| +{
| + struct irq_cfg *cfg;
| + struct irq_cfg *old_cfg;
| +
| + cfg = get_one_free_irq_cfg(cpu);
| + desc->chip_data = cfg;
| +
| + old_cfg = old_desc->chip_data;
| +
| + memcpy(cfg, old_cfg, sizeof(struct irq_cfg));
If cfg gets NULL here we will be NULL-dereferring
(cause of possible kzalloc_node fails).
| +
| + init_copy_irq_2_pin(old_cfg, cfg, cpu);
| +}
| +
...
Am I missgin something?
- Cyrill -
prev parent reply other threads:[~2008-11-09 7:50 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081023143721.GA25783@elte.hu>
[not found] ` <49012399.4010100@kernel.org>
[not found] ` <20081027164135.GD19476@elte.hu>
[not found] ` <4912B2FE.7030804@kernel.org>
[not found] ` <20081106101715.GA4022@elte.hu>
[not found] ` <4913B45C.1000009@kernel.org>
[not found] ` <20081107081249.GB4435@elte.hu>
[not found] ` <4913F9AA.80500@kernel.org>
[not found] ` <20081107084240.GG4435@elte.hu>
[not found] ` <491434FB.2050904@kernel.org>
[not found] ` <20081107124957.GA21709@elte.hu>
2008-11-09 7:05 ` [RFC PATCH] sparse_irq aka dyn_irq Yinghai Lu
2008-11-09 7:38 ` Ingo Molnar
2008-11-09 8:03 ` Yinghai Lu
2008-11-10 9:40 ` Ingo Molnar
2008-11-10 9:51 ` [PATCH] sparse_irq aka dyn_irq v10 Yinghai Lu
2008-11-10 9:53 ` Ingo Molnar
2008-11-10 9:55 ` Yinghai Lu
2008-11-10 9:57 ` Ingo Molnar
2008-11-10 9:55 ` [RFC PATCH] sparse_irq aka dyn_irq Andrew Morton
2008-11-10 10:00 ` Yinghai Lu
2008-11-10 10:03 ` Ingo Molnar
2008-11-10 10:05 ` Yinghai Lu
2008-11-10 10:09 ` Ingo Molnar
2008-11-10 19:47 ` Yinghai Lu
2008-11-11 6:28 ` [PATCH] sparse_irq aka dyn_irq v11 Yinghai Lu
[not found] ` <491A9F87.8040403@kernel.org>
[not found] ` <20081112120814.GG11352@elte.hu>
2008-11-13 7:01 ` [PATCH] sparse_irq aka dyn_irq v13 Yinghai Lu
2008-11-13 9:53 ` Ingo Molnar
2008-11-13 20:06 ` Yinghai Lu
2008-11-13 20:16 ` Yinghai Lu
2008-11-13 21:18 ` Andrew Morton
2008-11-13 21:21 ` Ingo Molnar
2008-11-13 22:01 ` Yinghai Lu
2008-11-13 22:05 ` Ingo Molnar
2008-11-13 22:13 ` Andrew Morton
2008-11-13 22:41 ` Yinghai Lu
2008-11-13 22:58 ` Andrew Morton
2008-11-13 23:15 ` Mike Travis
2008-11-13 23:24 ` Yinghai Lu
2008-11-14 0:20 ` Mike Travis
2008-11-14 0:29 ` Yinghai Lu
2008-11-14 6:29 ` [PATCH] sparse_irq aka dyn_irq v14 Yinghai Lu
2008-11-14 6:46 ` Andrew Morton
2008-11-15 9:05 ` Yinghai Lu
2008-11-13 22:19 ` [PATCH] sparse_irq aka dyn_irq v13 Paul Mackerras
2008-11-13 22:23 ` David Miller
2008-11-13 23:11 ` Mike Travis
2008-11-13 23:14 ` David Miller
2008-11-14 0:15 ` Mike Travis
2008-11-14 0:21 ` David Miller
2008-11-14 0:39 ` Mike Travis
2008-11-14 2:37 ` David Miller
2008-11-14 3:06 ` Mike Travis
2008-11-16 20:58 ` Benjamin Herrenschmidt
2008-11-16 23:44 ` Yinghai Lu
2008-11-16 23:48 ` H. Peter Anvin
2008-11-16 23:54 ` Yinghai Lu
2008-11-16 23:59 ` H. Peter Anvin
2008-11-17 0:21 ` Yinghai Lu
2008-11-17 0:26 ` H. Peter Anvin
2008-11-17 0:36 ` Yinghai Lu
2008-11-17 0:48 ` H. Peter Anvin
2008-11-17 0:58 ` Yinghai Lu
2008-11-17 1:00 ` H. Peter Anvin
2008-11-17 2:03 ` Mike Travis
2008-11-17 4:27 ` Benjamin Herrenschmidt
2008-11-17 4:26 ` Benjamin Herrenschmidt
2008-11-17 20:25 ` Jeremy Fitzhardinge
2008-11-17 4:25 ` Benjamin Herrenschmidt
2008-11-17 4:22 ` Benjamin Herrenschmidt
2008-11-17 1:51 ` Mike Travis
2008-11-17 4:39 ` H. Peter Anvin
2008-11-17 4:22 ` Benjamin Herrenschmidt
2008-11-17 4:42 ` H. Peter Anvin
2008-11-17 6:52 ` Benjamin Herrenschmidt
2008-11-09 8:36 ` [RFC PATCH] sparse_irq aka dyn_irq H. Peter Anvin
2008-11-09 7:50 ` Cyrill Gorcunov [this message]
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=20081109075021.GB12238@localhost \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.