Re: initdata changes in 2.3.99-pre9-pre1 (was Re: bug in emu10k1 under 2.3.late...)

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Sat May 13 2000 - 15:08:54 EDT

  • Next message: Lee Chin: "Re: sock_recvmsg in Kernel hangs for 10 seconds"

    Rui Sousa wrote:
    >
    > Jeff Garzik wrote:
    > >
    > > In 2.3.99-pre9-pre1, there are many changes to the struct pci_device_id
    > > PCI probe tables. Unfortunately these changes were made rather blindly
    > > and some are not correct. (If these are Rui's changes, I fear I did not
    > > speak up soon enough, causing these errors)
    > >
    > > __devinitdata should NOT be used unless you are certain the driver is a
    > > hotplug driver. Otherwise __initdata should be used. Similar rules for
    > > __init and __devinit.
    > >
    > > The patch in 2.3.99-pre9-pre1 blindly moves everything to __devinitdata,
    > > which causes memory wastage in non-hotplug kernels (ie. the majority of
    > > the kernels out there).
    > >
    > > Each driver author should carefully consider their __initdata markers
    > > versus their __devinitdata markers, and doing a global conversion like
    > > that in patch-2.3.99-pre9-pre1 is bound to "undo" carefully thought-out
    > > changes by driver authors and maintainers.
    > >
    >
    > Attached is a patch against pre9-1 that solves the mess I made.
    > Please check that I got it right this time and that the text in
    > Documentation/pci.txt is correct.

    Looks ok, thanks. Good catch on the sis900 missing null terminator
    BTW. Also, considering emu10k1, you might want to add a pci.txt tip
    that says something like:

    If you have code which is always called on module_exit(), and
    potentially called from module_init() or probe(), then it should not be
    marked with '__exit', as it could potentially be dropped at the linker
    stage, and not be present at all in the kernel image. Data under
    __exitdata should be treated likewise.

    A sneaky (and undocumented) thing to do is marking such code __init
    instead of __exit. That will wind up with the optimal behavior on
    current kernels, but doing so may invite broken code down the road if
    semantics change...

            Jeff

    -- 
    Jeff Garzik              | Liberty is always dangerous, but
    Building 1024            | it is the safest thing we have.
    MandrakeSoft, Inc.       |      -- Harry Emerson Fosdick
    

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



    This archive was generated by hypermail 2b29 : Sat May 13 2000 - 15:13:30 EDT