Possible kernel function with stack frame > 2048 bytes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible kernel function with stack frame > 2048 bytes

Michael McConville-3
Clang 3.7 gives this warning when building the kernel:

> ../../../../dev/audio.c:1852:1: warning: stack frame size of 2504 bytes in function 'wskbd_initvol' [-Wframe-larger-than=]
> wskbd_initvol(struct audio_softc *sc, struct wskbd_vol *vol, char *cn, char *dn)
> ^

-Wframe-larger-than was backported to base GCC, so maybe there's a bug
that caused it to erroneously overlook this one. It's also possible that
Clang just compiles this function differently, but >450 bytes seems like
a really big difference.

Maybe it isn't worth fixing, but I thought it was worth pointing out. It
seems like it may have been introduced by the simplifications last June:

https://marc.info/?t=143400752000002&r=1&w=2

Reply | Threaded
Open this post in threaded view
|

Re: Possible kernel function with stack frame > 2048 bytes

Michael McConville-3
Michael McConville wrote:

> Clang 3.7 gives this warning when building the kernel:
>
> > ../../../../dev/audio.c:1852:1: warning: stack frame size of 2504 bytes in function 'wskbd_initvol' [-Wframe-larger-than=]
> > wskbd_initvol(struct audio_softc *sc, struct wskbd_vol *vol, char *cn, char *dn)
> > ^
>
> -Wframe-larger-than was backported to base GCC, so maybe there's a bug
> that caused it to erroneously overlook this one. It's also possible that
> Clang just compiles this function differently, but >450 bytes seems like
> a really big difference.
>
> Maybe it isn't worth fixing, but I thought it was worth pointing out. It
> seems like it may have been introduced by the simplifications last June:
>
> https://marc.info/?t=143400752000002&r=1&w=2

I broke out objdump (should have done that initially) and, if I'm
reading the asm right, the stack frame is only 1,688 bytes with base
GCC. Maybe there's more aggressive stack space reuse.