We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 379b97b commit d6170e4Copy full SHA for d6170e4
kernel/bpf/core.c
@@ -893,7 +893,12 @@ static LIST_HEAD(pack_list);
893
* CONFIG_MMU=n. Use PAGE_SIZE in these cases.
894
*/
895
#ifdef PMD_SIZE
896
-#define BPF_PROG_PACK_SIZE (PMD_SIZE * num_possible_nodes())
+/* PMD_SIZE is really big for some archs. It doesn't make sense to
897
+ * reserve too much memory in one allocation. Hardcode BPF_PROG_PACK_SIZE to
898
+ * 2MiB * num_possible_nodes(). On most architectures PMD_SIZE will be
899
+ * greater than or equal to 2MB.
900
+ */
901
+#define BPF_PROG_PACK_SIZE (SZ_2M * num_possible_nodes())
902
#else
903
#define BPF_PROG_PACK_SIZE PAGE_SIZE
904
#endif
0 commit comments