* [PATCH bpf-next 0/5] bpf: remove the cgroup -> bpf header dependecy
@ 2021-12-13 23:42 Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 1/5] bpf: add header for enum bpf_cgroup_storage_type Jakub Kicinski
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-13 23:42 UTC (permalink / raw)
To: ast, daniel, andrii; +Cc: bpf, Jakub Kicinski
Changes to bpf.h tend to clog up our build systems. The netdev/bpf
build bot does incremental builds to save time (reusing the build
directory to only rebuild changed objects).
This is the rough breakdown of how many objects needs to be rebuilt
based on file touched:
kernel.h 40633
bpf.h 17881
bpf-cgroup.h 17875
skbuff.h 10696
bpf-netns.h 7604
netdevice.h 7452
filter.h 5003
tcp.h 4048
sock.h 4959
As the stats show touching bpf.h is _very_ expensive. Recent 20+ patch
series from Jirka took 10 hours to build patch-by-patch on a 72 CPU VM.
Bulk of the objects get rebuilt because MM includes cgroup headers.
Luckily bpf-cgroup.h does not fundamentally depend on bpf.h so we
can break that dependency and reduce the number of objects.
With the patches applied touching bpf.h causes 5019 objects to be rebuilt
(17881 / 5019 = 3.56x). That's pretty much down to filter.h plus noise.
Jakub Kicinski (5):
bpf: add header for enum bpf_cgroup_storage_type
bpf: create a header for cgroup_storage_type()
bpf: create a header for struct bpf_link
bpf: remove the cgroup -> bpf header dependecy
bpf: push down the bpf-link include
include/linux/bpf-cgroup-storage.h | 17 +++++++++++++++++
include/linux/bpf-cgroup-types.h | 13 +++++++++++++
include/linux/bpf-cgroup.h | 13 +++----------
include/linux/bpf-link.h | 23 +++++++++++++++++++++++
include/linux/bpf.h | 19 ++-----------------
kernel/bpf/bpf_iter.c | 1 +
kernel/bpf/helpers.c | 1 +
kernel/bpf/local_storage.c | 1 +
kernel/bpf/syscall.c | 1 +
net/core/dev.c | 1 +
10 files changed, 63 insertions(+), 27 deletions(-)
create mode 100644 include/linux/bpf-cgroup-storage.h
create mode 100644 include/linux/bpf-cgroup-types.h
create mode 100644 include/linux/bpf-link.h
--
2.31.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH bpf-next 1/5] bpf: add header for enum bpf_cgroup_storage_type
2021-12-13 23:42 [PATCH bpf-next 0/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
@ 2021-12-13 23:42 ` Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 2/5] bpf: create a header for cgroup_storage_type() Jakub Kicinski
` (3 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-13 23:42 UTC (permalink / raw)
To: ast, daniel, andrii; +Cc: bpf, Jakub Kicinski
enum bpf_cgroup_storage_type is needed both in bpf.h and bpf-cgroup.h.
Since we want to break the cgroup -> bpf dependency we need to place
it in its own header.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
include/linux/bpf-cgroup-types.h | 13 +++++++++++++
include/linux/bpf.h | 9 +--------
2 files changed, 14 insertions(+), 8 deletions(-)
create mode 100644 include/linux/bpf-cgroup-types.h
diff --git a/include/linux/bpf-cgroup-types.h b/include/linux/bpf-cgroup-types.h
new file mode 100644
index 000000000000..343dd5c2128d
--- /dev/null
+++ b/include/linux/bpf-cgroup-types.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _BPF_CGROUP_TYPES_H
+#define _BPF_CGROUP_TYPES_H
+
+enum bpf_cgroup_storage_type {
+ BPF_CGROUP_STORAGE_SHARED,
+ BPF_CGROUP_STORAGE_PERCPU,
+ __BPF_CGROUP_STORAGE_MAX
+};
+
+#define MAX_BPF_CGROUP_STORAGE_TYPE __BPF_CGROUP_STORAGE_MAX
+
+#endif
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 7a40022e3d00..b998347297ec 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -22,6 +22,7 @@
#include <linux/sched/mm.h>
#include <linux/slab.h>
#include <linux/percpu-refcount.h>
+#include <linux/bpf-cgroup-types.h>
#include <linux/bpfptr.h>
struct bpf_verifier_env;
@@ -550,14 +551,6 @@ struct bpf_prog_offload {
u32 jited_len;
};
-enum bpf_cgroup_storage_type {
- BPF_CGROUP_STORAGE_SHARED,
- BPF_CGROUP_STORAGE_PERCPU,
- __BPF_CGROUP_STORAGE_MAX
-};
-
-#define MAX_BPF_CGROUP_STORAGE_TYPE __BPF_CGROUP_STORAGE_MAX
-
/* The longest tracepoint has 12 args.
* See include/trace/bpf_probe.h
*/
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH bpf-next 2/5] bpf: create a header for cgroup_storage_type()
2021-12-13 23:42 [PATCH bpf-next 0/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 1/5] bpf: add header for enum bpf_cgroup_storage_type Jakub Kicinski
@ 2021-12-13 23:42 ` Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link Jakub Kicinski
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-13 23:42 UTC (permalink / raw)
To: ast, daniel, andrii; +Cc: bpf, Jakub Kicinski
cgroup_storage_type() is a static inline which needs to deference
bpf_map. Move it to its own header so that we don't need to pull
in bpf.h. It only has a couple of callers.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
include/linux/bpf-cgroup-storage.h | 17 +++++++++++++++++
include/linux/bpf-cgroup.h | 9 ---------
kernel/bpf/helpers.c | 1 +
kernel/bpf/local_storage.c | 1 +
4 files changed, 19 insertions(+), 9 deletions(-)
create mode 100644 include/linux/bpf-cgroup-storage.h
diff --git a/include/linux/bpf-cgroup-storage.h b/include/linux/bpf-cgroup-storage.h
new file mode 100644
index 000000000000..0e0f3409c586
--- /dev/null
+++ b/include/linux/bpf-cgroup-storage.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _BPF_CGROUP_STORAGE_H
+#define _BPF_CGROUP_STORAGE_H
+
+#include <linux/bpf.h>
+#include <linux/bpf-cgroup.h>
+
+static inline enum bpf_cgroup_storage_type cgroup_storage_type(
+ struct bpf_map *map)
+{
+ if (map->map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE)
+ return BPF_CGROUP_STORAGE_PERCPU;
+
+ return BPF_CGROUP_STORAGE_SHARED;
+}
+
+#endif
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index 11820a430d6c..12474516e0be 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -194,15 +194,6 @@ int __cgroup_bpf_run_filter_getsockopt_kern(struct sock *sk, int level,
int optname, void *optval,
int *optlen, int retval);
-static inline enum bpf_cgroup_storage_type cgroup_storage_type(
- struct bpf_map *map)
-{
- if (map->map_type == BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE)
- return BPF_CGROUP_STORAGE_PERCPU;
-
- return BPF_CGROUP_STORAGE_SHARED;
-}
-
struct bpf_cgroup_storage *
cgroup_storage_lookup(struct bpf_cgroup_storage_map *map,
void *key, bool locked);
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 8babae03d30a..415c38222069 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -2,6 +2,7 @@
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
*/
#include <linux/bpf.h>
+#include <linux/bpf-cgroup-storage.h>
#include <linux/rcupdate.h>
#include <linux/random.h>
#include <linux/smp.h>
diff --git a/kernel/bpf/local_storage.c b/kernel/bpf/local_storage.c
index 035e9e3a7132..195f9c13ef5b 100644
--- a/kernel/bpf/local_storage.c
+++ b/kernel/bpf/local_storage.c
@@ -1,5 +1,6 @@
//SPDX-License-Identifier: GPL-2.0
#include <linux/bpf-cgroup.h>
+#include <linux/bpf-cgroup-storage.h>
#include <linux/bpf.h>
#include <linux/bpf_local_storage.h>
#include <linux/btf.h>
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link
2021-12-13 23:42 [PATCH bpf-next 0/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 1/5] bpf: add header for enum bpf_cgroup_storage_type Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 2/5] bpf: create a header for cgroup_storage_type() Jakub Kicinski
@ 2021-12-13 23:42 ` Jakub Kicinski
2021-12-14 5:15 ` Alexei Starovoitov
2021-12-13 23:42 ` [PATCH bpf-next 4/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 5/5] bpf: push down the bpf-link include Jakub Kicinski
4 siblings, 1 reply; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-13 23:42 UTC (permalink / raw)
To: ast, daniel, andrii; +Cc: bpf, Jakub Kicinski
struct bpf_link needs to be embedded by cgroups.
Put it in its own header.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
include/linux/bpf-link.h | 23 +++++++++++++++++++++++
include/linux/bpf.h | 10 +---------
2 files changed, 24 insertions(+), 9 deletions(-)
create mode 100644 include/linux/bpf-link.h
diff --git a/include/linux/bpf-link.h b/include/linux/bpf-link.h
new file mode 100644
index 000000000000..d20f049af51a
--- /dev/null
+++ b/include/linux/bpf-link.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
+ */
+#ifndef _LINUX_BPF_MIN_H
+#define _LINUX_BPF_MIN_H 1
+
+#include <uapi/linux/bpf.h>
+
+#include <linux/workqueue.h>
+
+struct bpf_prog;
+struct bpf_link_ops;
+
+struct bpf_link {
+ atomic64_t refcnt;
+ u32 id;
+ enum bpf_link_type type;
+ const struct bpf_link_ops *ops;
+ struct bpf_prog *prog;
+ struct work_struct work;
+};
+
+#endif
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index b998347297ec..64bdae62a594 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -23,6 +23,7 @@
#include <linux/slab.h>
#include <linux/percpu-refcount.h>
#include <linux/bpf-cgroup-types.h>
+#include <linux/bpf-link.h>
#include <linux/bpfptr.h>
struct bpf_verifier_env;
@@ -946,15 +947,6 @@ struct bpf_array_aux {
struct work_struct work;
};
-struct bpf_link {
- atomic64_t refcnt;
- u32 id;
- enum bpf_link_type type;
- const struct bpf_link_ops *ops;
- struct bpf_prog *prog;
- struct work_struct work;
-};
-
struct bpf_link_ops {
void (*release)(struct bpf_link *link);
void (*dealloc)(struct bpf_link *link);
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH bpf-next 4/5] bpf: remove the cgroup -> bpf header dependecy
2021-12-13 23:42 [PATCH bpf-next 0/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
` (2 preceding siblings ...)
2021-12-13 23:42 ` [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link Jakub Kicinski
@ 2021-12-13 23:42 ` Jakub Kicinski
2021-12-14 19:27 ` kernel test robot
2021-12-13 23:42 ` [PATCH bpf-next 5/5] bpf: push down the bpf-link include Jakub Kicinski
4 siblings, 1 reply; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-13 23:42 UTC (permalink / raw)
To: ast, daniel, andrii; +Cc: bpf, Jakub Kicinski
Now that the stage has been set and actors are in place
remove the header dependency between cgroup and bpf.h.
This reduces the incremental build size of x86 allmodconfig
after bpf.h was touched from ~17k objects rebuilt to ~5k objects.
bpf.h is 2.2kLoC and is modified relatively often.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
include/linux/bpf-cgroup.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index 12474516e0be..4c932d47e7f2 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -2,7 +2,8 @@
#ifndef _BPF_CGROUP_H
#define _BPF_CGROUP_H
-#include <linux/bpf.h>
+#include <linux/bpf-cgroup-types.h>
+#include <linux/bpf-link.h>
#include <linux/errno.h>
#include <linux/jump_label.h>
#include <linux/percpu.h>
@@ -16,6 +17,7 @@ struct cgroup;
struct sk_buff;
struct bpf_map;
struct bpf_prog;
+struct bpf_prog_aux;
struct bpf_sock_ops_kern;
struct bpf_cgroup_storage;
struct ctl_table;
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH bpf-next 5/5] bpf: push down the bpf-link include
2021-12-13 23:42 [PATCH bpf-next 0/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
` (3 preceding siblings ...)
2021-12-13 23:42 ` [PATCH bpf-next 4/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
@ 2021-12-13 23:42 ` Jakub Kicinski
4 siblings, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-13 23:42 UTC (permalink / raw)
To: ast, daniel, andrii; +Cc: bpf, Jakub Kicinski
Turns out bpf_link is not dereferenced or embedded much.
Since we have separated it out to its own header why not
drop the include from bpf.h completely...
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
include/linux/bpf.h | 2 +-
kernel/bpf/bpf_iter.c | 1 +
kernel/bpf/syscall.c | 1 +
net/core/dev.c | 1 +
4 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 64bdae62a594..0be6890f01ec 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -23,12 +23,12 @@
#include <linux/slab.h>
#include <linux/percpu-refcount.h>
#include <linux/bpf-cgroup-types.h>
-#include <linux/bpf-link.h>
#include <linux/bpfptr.h>
struct bpf_verifier_env;
struct bpf_verifier_log;
struct perf_event;
+struct bpf_link;
struct bpf_prog;
struct bpf_prog_aux;
struct bpf_map;
diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c
index b7aef5b3416d..9e4d00446227 100644
--- a/kernel/bpf/bpf_iter.c
+++ b/kernel/bpf/bpf_iter.c
@@ -5,6 +5,7 @@
#include <linux/anon_inodes.h>
#include <linux/filter.h>
#include <linux/bpf.h>
+#include <linux/bpf-link.h>
struct bpf_iter_target_info {
struct list_head list;
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index ddd81d543203..9034bb833ec3 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -5,6 +5,7 @@
#include <linux/bpf_trace.h>
#include <linux/bpf_lirc.h>
#include <linux/bpf_verifier.h>
+#include <linux/bpf-link.h>
#include <linux/btf.h>
#include <linux/syscalls.h>
#include <linux/slab.h>
diff --git a/net/core/dev.c b/net/core/dev.c
index 4420086f3aeb..d8e51e826852 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -93,6 +93,7 @@
#include <linux/skbuff.h>
#include <linux/kthread.h>
#include <linux/bpf.h>
+#include <linux/bpf-link.h>
#include <linux/bpf_trace.h>
#include <net/net_namespace.h>
#include <net/sock.h>
--
2.31.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link
2021-12-13 23:42 ` [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link Jakub Kicinski
@ 2021-12-14 5:15 ` Alexei Starovoitov
2021-12-14 15:04 ` Jakub Kicinski
0 siblings, 1 reply; 11+ messages in thread
From: Alexei Starovoitov @ 2021-12-14 5:15 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf
On Mon, Dec 13, 2021 at 3:42 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> struct bpf_link needs to be embedded by cgroups.
> Put it in its own header.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> include/linux/bpf-link.h | 23 +++++++++++++++++++++++
> include/linux/bpf.h | 10 +---------
> 2 files changed, 24 insertions(+), 9 deletions(-)
> create mode 100644 include/linux/bpf-link.h
>
> diff --git a/include/linux/bpf-link.h b/include/linux/bpf-link.h
> new file mode 100644
> index 000000000000..d20f049af51a
> --- /dev/null
> +++ b/include/linux/bpf-link.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
> + */
> +#ifndef _LINUX_BPF_MIN_H
> +#define _LINUX_BPF_MIN_H 1
MIN_H ?
My understanding that patch 4 is the key.
I think the bpf-link.h bpf-cgroup-types.h and bpf-cgroup-storage.h
are too specific. We don't do a header file per type.
Maybe combine them all into one bpf-cgroup-types.h ?
That will still achieve the separation of cgroup from linux/bpf.h
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link
2021-12-14 5:15 ` Alexei Starovoitov
@ 2021-12-14 15:04 ` Jakub Kicinski
2021-12-14 15:18 ` Jakub Kicinski
0 siblings, 1 reply; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-14 15:04 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf
On Mon, 13 Dec 2021 21:15:06 -0800 Alexei Starovoitov wrote:
> On Mon, Dec 13, 2021 at 3:42 PM Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > struct bpf_link needs to be embedded by cgroups.
> > Put it in its own header.
> >
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > ---
> > include/linux/bpf-link.h | 23 +++++++++++++++++++++++
> > include/linux/bpf.h | 10 +---------
> > 2 files changed, 24 insertions(+), 9 deletions(-)
> > create mode 100644 include/linux/bpf-link.h
> >
> > diff --git a/include/linux/bpf-link.h b/include/linux/bpf-link.h
> > new file mode 100644
> > index 000000000000..d20f049af51a
> > --- /dev/null
> > +++ b/include/linux/bpf-link.h
> > @@ -0,0 +1,23 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
> > + */
> > +#ifndef _LINUX_BPF_MIN_H
> > +#define _LINUX_BPF_MIN_H 1
>
> MIN_H ?
Used to stand for "minimal", forgot to rename after I changed course.
> My understanding that patch 4 is the key.
> I think the bpf-link.h bpf-cgroup-types.h and bpf-cgroup-storage.h
> are too specific. We don't do a header file per type.
> Maybe combine them all into one bpf-cgroup-types.h ?
> That will still achieve the separation of cgroup from linux/bpf.h
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link
2021-12-14 15:04 ` Jakub Kicinski
@ 2021-12-14 15:18 ` Jakub Kicinski
2021-12-14 15:24 ` Jakub Kicinski
0 siblings, 1 reply; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-14 15:18 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf
On Tue, 14 Dec 2021 07:04:35 -0800 Jakub Kicinski wrote:
> > My understanding that patch 4 is the key.
> > I think the bpf-link.h bpf-cgroup-types.h and bpf-cgroup-storage.h
> > are too specific. We don't do a header file per type.
> > Maybe combine them all into one bpf-cgroup-types.h ?
> > That will still achieve the separation of cgroup from linux/bpf.h
The dependency tree is
bpf-link.h bpf-cgroup-types.h
^ ^
| /
bpf.h bpf-cgroup.h
^ ^
| |
| |
bpf-cgroup-storage.h
I can't merge bpf-cgroup-storage.h with the rest, it'd be a loop.
Should I leave that one be separate? Any other ideas?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link
2021-12-14 15:18 ` Jakub Kicinski
@ 2021-12-14 15:24 ` Jakub Kicinski
0 siblings, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2021-12-14 15:24 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, bpf
On Tue, 14 Dec 2021 07:18:50 -0800 Jakub Kicinski wrote:
> The dependency tree is
>
>
> bpf-link.h bpf-cgroup-types.h
> ^ ^
> | /
> bpf.h bpf-cgroup.h
> ^ ^
> | |
> | |
> bpf-cgroup-storage.h
bpf-cgroup-types.h bpf-link.h
^ ^ ^
| | /
bpf.h bpf-cgroup.h
^ ^
| |
| |
bpf-cgroup-storage.h
To be exact, bpf.h include cgroup-types, but not bpf-link, doesn't
change the question below, tho.
> I can't merge bpf-cgroup-storage.h with the rest, it'd be a loop.
> Should I leave that one be separate? Any other ideas?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH bpf-next 4/5] bpf: remove the cgroup -> bpf header dependecy
2021-12-13 23:42 ` [PATCH bpf-next 4/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
@ 2021-12-14 19:27 ` kernel test robot
0 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2021-12-14 19:27 UTC (permalink / raw)
To: Jakub Kicinski, ast, daniel, andrii; +Cc: kbuild-all, bpf, Jakub Kicinski
Hi Jakub,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Jakub-Kicinski/bpf-remove-the-cgroup-bpf-header-dependecy/20211214-074344
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: s390-randconfig-r023-20211213 (https://download.01.org/0day-ci/archive/20211215/202112150326.PHRPQfmk-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/517f95dd6d9264e4104cfc35eecdd5c1287738ae
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jakub-Kicinski/bpf-remove-the-cgroup-bpf-header-dependecy/20211214-074344
git checkout 517f95dd6d9264e4104cfc35eecdd5c1287738ae
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
arch/s390/mm/hugetlbpage.c: In function 'hugetlb_get_unmapped_area':
>> arch/s390/mm/hugetlbpage.c:352:16: error: implicit declaration of function 'check_asce_limit'; did you mean 'check_data_rlimit'? [-Werror=implicit-function-declaration]
352 | return check_asce_limit(mm, addr, len);
| ^~~~~~~~~~~~~~~~
| check_data_rlimit
cc1: some warnings being treated as errors
vim +352 arch/s390/mm/hugetlbpage.c
5f490a520bcb393 Gerald Schaefer 2020-01-16 315
5f490a520bcb393 Gerald Schaefer 2020-01-16 316 unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
5f490a520bcb393 Gerald Schaefer 2020-01-16 317 unsigned long len, unsigned long pgoff, unsigned long flags)
5f490a520bcb393 Gerald Schaefer 2020-01-16 318 {
5f490a520bcb393 Gerald Schaefer 2020-01-16 319 struct hstate *h = hstate_file(file);
5f490a520bcb393 Gerald Schaefer 2020-01-16 320 struct mm_struct *mm = current->mm;
5f490a520bcb393 Gerald Schaefer 2020-01-16 321 struct vm_area_struct *vma;
5f490a520bcb393 Gerald Schaefer 2020-01-16 322
5f490a520bcb393 Gerald Schaefer 2020-01-16 323 if (len & ~huge_page_mask(h))
5f490a520bcb393 Gerald Schaefer 2020-01-16 324 return -EINVAL;
5f490a520bcb393 Gerald Schaefer 2020-01-16 325 if (len > TASK_SIZE - mmap_min_addr)
5f490a520bcb393 Gerald Schaefer 2020-01-16 326 return -ENOMEM;
5f490a520bcb393 Gerald Schaefer 2020-01-16 327
5f490a520bcb393 Gerald Schaefer 2020-01-16 328 if (flags & MAP_FIXED) {
5f490a520bcb393 Gerald Schaefer 2020-01-16 329 if (prepare_hugepage_range(file, addr, len))
5f490a520bcb393 Gerald Schaefer 2020-01-16 330 return -EINVAL;
5f490a520bcb393 Gerald Schaefer 2020-01-16 331 goto check_asce_limit;
5f490a520bcb393 Gerald Schaefer 2020-01-16 332 }
5f490a520bcb393 Gerald Schaefer 2020-01-16 333
5f490a520bcb393 Gerald Schaefer 2020-01-16 334 if (addr) {
5f490a520bcb393 Gerald Schaefer 2020-01-16 335 addr = ALIGN(addr, huge_page_size(h));
5f490a520bcb393 Gerald Schaefer 2020-01-16 336 vma = find_vma(mm, addr);
5f490a520bcb393 Gerald Schaefer 2020-01-16 337 if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
5f490a520bcb393 Gerald Schaefer 2020-01-16 338 (!vma || addr + len <= vm_start_gap(vma)))
5f490a520bcb393 Gerald Schaefer 2020-01-16 339 goto check_asce_limit;
5f490a520bcb393 Gerald Schaefer 2020-01-16 340 }
5f490a520bcb393 Gerald Schaefer 2020-01-16 341
5f490a520bcb393 Gerald Schaefer 2020-01-16 342 if (mm->get_unmapped_area == arch_get_unmapped_area)
5f490a520bcb393 Gerald Schaefer 2020-01-16 343 addr = hugetlb_get_unmapped_area_bottomup(file, addr, len,
5f490a520bcb393 Gerald Schaefer 2020-01-16 344 pgoff, flags);
5f490a520bcb393 Gerald Schaefer 2020-01-16 345 else
5f490a520bcb393 Gerald Schaefer 2020-01-16 346 addr = hugetlb_get_unmapped_area_topdown(file, addr, len,
5f490a520bcb393 Gerald Schaefer 2020-01-16 347 pgoff, flags);
712fa5f294f377e Alexander Gordeev 2020-03-23 348 if (offset_in_page(addr))
5f490a520bcb393 Gerald Schaefer 2020-01-16 349 return addr;
5f490a520bcb393 Gerald Schaefer 2020-01-16 350
5f490a520bcb393 Gerald Schaefer 2020-01-16 351 check_asce_limit:
712fa5f294f377e Alexander Gordeev 2020-03-23 @352 return check_asce_limit(mm, addr, len);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-12-14 19:28 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 23:42 [PATCH bpf-next 0/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 1/5] bpf: add header for enum bpf_cgroup_storage_type Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 2/5] bpf: create a header for cgroup_storage_type() Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 3/5] bpf: create a header for struct bpf_link Jakub Kicinski
2021-12-14 5:15 ` Alexei Starovoitov
2021-12-14 15:04 ` Jakub Kicinski
2021-12-14 15:18 ` Jakub Kicinski
2021-12-14 15:24 ` Jakub Kicinski
2021-12-13 23:42 ` [PATCH bpf-next 4/5] bpf: remove the cgroup -> bpf header dependecy Jakub Kicinski
2021-12-14 19:27 ` kernel test robot
2021-12-13 23:42 ` [PATCH bpf-next 5/5] bpf: push down the bpf-link include Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).