Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH 1/2] init.h: Remove __dev* sections from the kernel

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


gregkh at linuxfoundation

Nov 29, 2012, 10:43 AM

Post #1 of 8 (678 views)
Permalink
[PATCH 1/2] init.h: Remove __dev* sections from the kernel

From: Greg Kroah-Hartman <gregkh [at] linuxfoundation>

With the recent work to remove CONFIG_HOTPLUG, we are starting to get a
bunch of __devinit section warnings, despite CONFIG_HOTPLUG always being
enabled. So, stop marking the sections entirely, by defining them away
the section markings in init.h

Signed-off-by: Greg Kroah-Hartman <gregkh [at] linuxfoundation>

---
include/linux/init.h | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/include/linux/init.h b/include/linux/init.h
index e59041e..f63692d 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -93,13 +93,13 @@

#define __exit __section(.exit.text) __exitused __cold notrace

-/* Used for HOTPLUG */
-#define __devinit __section(.devinit.text) __cold notrace
-#define __devinitdata __section(.devinit.data)
-#define __devinitconst __constsection(.devinit.rodata)
-#define __devexit __section(.devexit.text) __exitused __cold notrace
-#define __devexitdata __section(.devexit.data)
-#define __devexitconst __constsection(.devexit.rodata)
+/* Used for HOTPLUG, but that is always enabled now, so just make them noops */
+#define __devinit
+#define __devinitdata
+#define __devinitconst
+#define __devexit
+#define __devexitdata
+#define __devexitconst

/* Used for HOTPLUG_CPU */
#define __cpuinit __section(.cpuinit.text) __cold notrace
@@ -126,10 +126,6 @@
#define __INITRODATA .section ".init.rodata","a",%progbits
#define __FINITDATA .previous

-#define __DEVINIT .section ".devinit.text", "ax"
-#define __DEVINITDATA .section ".devinit.data", "aw"
-#define __DEVINITRODATA .section ".devinit.rodata", "a"
-
#define __CPUINIT .section ".cpuinit.text", "ax"
#define __CPUINITDATA .section ".cpuinit.data", "aw"
#define __CPUINITRODATA .section ".cpuinit.rodata", "a"
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


sam at ravnborg

Nov 30, 2012, 10:11 AM

Post #2 of 8 (660 views)
Permalink
Re: [PATCH 1/2] init.h: Remove __dev* sections from the kernel [In reply to]

On Thu, Nov 29, 2012 at 10:43:28AM -0800, Greg Kroah-Hartman wrote:
> From: Greg Kroah-Hartman <gregkh [at] linuxfoundation>
>
> With the recent work to remove CONFIG_HOTPLUG, we are starting to get a
> bunch of __devinit section warnings, despite CONFIG_HOTPLUG always being
> enabled. So, stop marking the sections entirely, by defining them away
> the section markings in init.h
>
> Signed-off-by: Greg Kroah-Hartman <gregkh [at] linuxfoundation>
Acked-by: Sam Ravnborg <sam [at] ravnborg>
>
> ---
> include/linux/init.h | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/init.h b/include/linux/init.h
> index e59041e..f63692d 100644
> --- a/include/linux/init.h
> +++ b/include/linux/init.h
> @@ -93,13 +93,13 @@
>
> #define __exit __section(.exit.text) __exitused __cold notrace
>
> -/* Used for HOTPLUG */
> -#define __devinit __section(.devinit.text) __cold notrace
> -#define __devinitdata __section(.devinit.data)
> -#define __devinitconst __constsection(.devinit.rodata)
> -#define __devexit __section(.devexit.text) __exitused __cold notrace
> -#define __devexitdata __section(.devexit.data)
> -#define __devexitconst __constsection(.devexit.rodata)
> +/* Used for HOTPLUG, but that is always enabled now, so just make them noops */

This comment should be explicit that these are provided only for backward compatibility
and their usage is discouarged.

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


gregkh at linuxfoundation

Nov 30, 2012, 10:28 AM

Post #3 of 8 (658 views)
Permalink
Re: [PATCH 1/2] init.h: Remove __dev* sections from the kernel [In reply to]

On Fri, Nov 30, 2012 at 07:11:56PM +0100, Sam Ravnborg wrote:
> On Thu, Nov 29, 2012 at 10:43:28AM -0800, Greg Kroah-Hartman wrote:
> > From: Greg Kroah-Hartman <gregkh [at] linuxfoundation>
> >
> > With the recent work to remove CONFIG_HOTPLUG, we are starting to get a
> > bunch of __devinit section warnings, despite CONFIG_HOTPLUG always being
> > enabled. So, stop marking the sections entirely, by defining them away
> > the section markings in init.h
> >
> > Signed-off-by: Greg Kroah-Hartman <gregkh [at] linuxfoundation>
> Acked-by: Sam Ravnborg <sam [at] ravnborg>

Thanks for the review of this and the other patch.

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


hpa at zytor

Nov 30, 2012, 12:39 PM

Post #4 of 8 (657 views)
Permalink
Re: [PATCH 1/2] init.h: Remove __dev* sections from the kernel [In reply to]

On 11/29/2012 10:43 AM, Greg Kroah-Hartman wrote:
> From: Greg Kroah-Hartman <gregkh [at] linuxfoundation>
>
> With the recent work to remove CONFIG_HOTPLUG, we are starting to get a
> bunch of __devinit section warnings, despite CONFIG_HOTPLUG always being
> enabled. So, stop marking the sections entirely, by defining them away
> the section markings in init.h
>

Could we run a sed script over the kernel tree and generate patches to
remove the markings completely?

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

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


hpa at zytor

Nov 30, 2012, 12:39 PM

Post #5 of 8 (657 views)
Permalink
Re: [PATCH 1/2] init.h: Remove __dev* sections from the kernel [In reply to]

On 11/29/2012 10:43 AM, Greg Kroah-Hartman wrote:
>
> -/* Used for HOTPLUG */
> -#define __devinit __section(.devinit.text) __cold notrace
> -#define __devinitdata __section(.devinit.data)
> -#define __devinitconst __constsection(.devinit.rodata)
> -#define __devexit __section(.devexit.text) __exitused __cold notrace
> -#define __devexitdata __section(.devexit.data)
> -#define __devexitconst __constsection(.devexit.rodata)
> +/* Used for HOTPLUG, but that is always enabled now, so just make them noops */
> +#define __devinit
> +#define __devinitdata
> +#define __devinitconst
> +#define __devexit
> +#define __devexitdata
> +#define __devexitconst
>

Second question... what about the __exitused __cold notrace annotations?

-hpa


--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

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


wfp5p at viridian

Nov 30, 2012, 12:43 PM

Post #6 of 8 (660 views)
Permalink
Re: [PATCH 1/2] init.h: Remove __dev* sections from the kernel [In reply to]

H. Peter Anvin writes:
>
> On 11/29/2012 10:43 AM, Greg Kroah-Hartman wrote:
> > From: Greg Kroah-Hartman <gregkh [at] linuxfoundation>
> >
> > With the recent work to remove CONFIG_HOTPLUG, we are starting to get a
> > bunch of __devinit section warnings, despite CONFIG_HOTPLUG always being
> > enabled. So, stop marking the sections entirely, by defining them away
> > the section markings in init.h
> >
>
> Could we run a sed script over the kernel tree and generate patches to
> remove the markings completely?
>

That's how I've been generating the patches to remove the markings --
except it's a perl script.

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


gregkh at linuxfoundation

Nov 30, 2012, 12:45 PM

Post #7 of 8 (660 views)
Permalink
Re: [PATCH 1/2] init.h: Remove __dev* sections from the kernel [In reply to]

On Fri, Nov 30, 2012 at 12:39:01PM -0800, H. Peter Anvin wrote:
> On 11/29/2012 10:43 AM, Greg Kroah-Hartman wrote:
> >From: Greg Kroah-Hartman <gregkh [at] linuxfoundation>
> >
> >With the recent work to remove CONFIG_HOTPLUG, we are starting to get a
> >bunch of __devinit section warnings, despite CONFIG_HOTPLUG always being
> >enabled. So, stop marking the sections entirely, by defining them away
> >the section markings in init.h
> >
>
> Could we run a sed script over the kernel tree and generate patches
> to remove the markings completely?

Yes, we can, and Bill's been generating patches that way. A number of
them are already in linux-next and I'll sweep the tree after 3.8-rc1 is
out and catch the rest.

thanks,

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


gregkh at linuxfoundation

Nov 30, 2012, 12:47 PM

Post #8 of 8 (657 views)
Permalink
Re: [PATCH 1/2] init.h: Remove __dev* sections from the kernel [In reply to]

On Fri, Nov 30, 2012 at 12:39:43PM -0800, H. Peter Anvin wrote:
> On 11/29/2012 10:43 AM, Greg Kroah-Hartman wrote:
> >
> >-/* Used for HOTPLUG */
> >-#define __devinit __section(.devinit.text) __cold notrace
> >-#define __devinitdata __section(.devinit.data)
> >-#define __devinitconst __constsection(.devinit.rodata)
> >-#define __devexit __section(.devexit.text) __exitused __cold notrace
> >-#define __devexitdata __section(.devexit.data)
> >-#define __devexitconst __constsection(.devexit.rodata)
> >+/* Used for HOTPLUG, but that is always enabled now, so just make them noops */
> >+#define __devinit
> >+#define __devinitdata
> >+#define __devinitconst
> >+#define __devexit
> >+#define __devexitdata
> >+#define __devexitconst
> >
>
> Second question... what about the __exitused __cold notrace annotations?

__exitused shouldn't matter, we shouldn't be optimizing these away at
all anymore. I don't know about __cold and notrace, but given that
these could be traced, I don't see why that marking got there in the
first place.

In reading compiler-gcc4.h, and knowing just how infrequent these
functions are ever called, I would be amazed if the __cold marking ever
even helped anything out here.

thanks,

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

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.