Commit 70045cf
committed
xen/gntdev: remove struct gntdev_copy_batch from stack
When compiling the kernel with LLVM, the following warning was issued:
drivers/xen/gntdev.c:991: warning: stack frame size (1160) exceeds
limit (1024) in function 'gntdev_ioctl'
The main reason is struct gntdev_copy_batch which is located on the
stack and has a size of nearly 1kb.
For performance reasons it shouldn't by just dynamically allocated
instead, so allocate a new instance when needed and instead of freeing
it put it into a list of free structs anchored in struct gntdev_priv.
Fixes: a4cdb55 ("xen/gntdev: add ioctl for grant copy")
Reported-by: Abinash Singh <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
Message-ID: <[email protected]>1 parent 532c8b5 commit 70045cf
2 files changed
+54
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| |||
584 | 596 | | |
585 | 597 | | |
586 | 598 | | |
| 599 | + | |
| 600 | + | |
587 | 601 | | |
588 | 602 | | |
589 | 603 | | |
| |||
608 | 622 | | |
609 | 623 | | |
610 | 624 | | |
| 625 | + | |
611 | 626 | | |
612 | 627 | | |
613 | 628 | | |
| |||
620 | 635 | | |
621 | 636 | | |
622 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
623 | 646 | | |
624 | 647 | | |
625 | 648 | | |
| |||
785 | 808 | | |
786 | 809 | | |
787 | 810 | | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | 811 | | |
800 | 812 | | |
801 | 813 | | |
| |||
953 | 965 | | |
954 | 966 | | |
955 | 967 | | |
956 | | - | |
| 968 | + | |
957 | 969 | | |
958 | 970 | | |
959 | 971 | | |
960 | 972 | | |
961 | 973 | | |
962 | 974 | | |
963 | | - | |
964 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
965 | 988 | | |
966 | 989 | | |
967 | 990 | | |
968 | 991 | | |
969 | 992 | | |
970 | 993 | | |
| 994 | + | |
971 | 995 | | |
972 | 996 | | |
973 | 997 | | |
974 | | - | |
975 | | - | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
976 | 1001 | | |
| 1002 | + | |
977 | 1003 | | |
978 | 1004 | | |
979 | 1005 | | |
980 | | - | |
981 | | - | |
982 | | - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
983 | 1014 | | |
984 | | - | |
985 | | - | |
986 | 1015 | | |
987 | 1016 | | |
988 | 1017 | | |
| |||
0 commit comments