Re: [PATCH 1/5] try parent numa_node at first before using default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 12 Jul 2007 07:47:52 +0200,
Stefan Richter <[email protected]> wrote:

> The patch does nothing for all subsystems which do
> 
> 	device_initialize(&dev);
> 	dev->parent = pd;
> 	device_add(&dev);
> 
> Let's avoid to add infrastructure which does nothing, or only does
> something by accident.

I agree. dev->parent now is only expected to be set in device_add(),
not in device_initialize(), so the sequence above is perfectly fine.
(Why should you need it, anyway? parent information becomes necessary
only when something is added to the tree.)
> 
> The alternatives are:
> 
>   - Change all subsystems to set dev->parent before device_initialize().
>     *Document* that the device_initialize() API has this requirement.
>     This is counter-intuitive, amounts to some work across the kernel,
>     and could be gotten wrong again in future code because it's a
>     counter-intuitive API.

Yes. We shouldn't do that.
> 
>   - Move your code from device_initialize() to device_add().  One minor
>     drawback is that node-specific allocations based on the device's
>     numa_node would not be optimized before device_add(), but there is
>     probably no need for this.  Driver probes come after device_add().

I'd expect most allocations to be done when probing, so this shouldn't
hurt much.
> 
>   - Let subsystems explicitly call set_dev_node() on their own.
> 
> 
> Also keep in mind that either device_move() should update the numa_node,
> or the subsystems which call device_move() should explicitly update it
> on their own.   (Unless they know that their devices will always stay at
> the same NUMA node even when switching parents.)

I'd trust the subsystems to know best whether something regarding NUMA
changed.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux