Re: [PATCH] bpf: Fix backport of "bpf: restrict unknown scalars of mixed signed bounds for unprivileged"

2021-04-19 Thread Yonghong Song
uot;) Signed-off-by: Samuel Mendoza-Jonas Reviewed-by: Frank van der Linden Reviewed-by: Ethan Chen Just to be clear, the patch is for 4.14 stable branch. Acked-by: Yonghong Song

[PATCH] ice: set the value of global config lock timeout longer

2021-04-19 Thread Liwei Song
-by: Liwei Song --- drivers/net/ethernet/intel/ice/ice_type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h index 266036b7a49a..8a90c47e337d 100644 --- a/drivers/net/ethernet/intel/ice

Re: [PATCH v2] tools: do not include scripts/Kbuild.include

2021-04-16 Thread Yonghong Song
M although I see some tools Makefile directly added ".DELETE_ON_ERROR:" in their Makefile. Acked-by: Yonghong Song

Re: [PATCHv2 RFC bpf-next 0/7] bpf: Add support for ftrace probe

2021-04-15 Thread Yonghong Song
On 4/15/21 11:18 AM, Steven Rostedt wrote: On Thu, 15 Apr 2021 19:39:45 +0200 Jiri Olsa wrote: I don't know how the BPF code does it, but if you are tracing the exit of a function, I'm assuming that you hijack the return pointer and replace it with a call to a trampoline that has access to

Re: 5.?? regression: strace testsuite OOpses kernel on ia64

2021-04-10 Thread Yonghong Song
On 4/9/21 2:20 PM, Sergei Trofimovich wrote: On Tue, 23 Feb 2021 18:53:21 + Sergei Trofimovich wrote: The crash seems to be related to sock_filter-v test from strace: https://github.com/strace/strace/blob/master/tests/seccomp-filter-v.c Here is an OOps: [ 818.089904] BUG: Bad pa

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-06 Thread Song Liu
> On Apr 6, 2021, at 9:48 AM, Cong Wang wrote: > > On Mon, Apr 5, 2021 at 11:18 PM Song Liu wrote: >> >> >> >>> On Apr 5, 2021, at 6:24 PM, Cong Wang wrote: >>> >>> On Mon, Apr 5, 2021 at 6:08 PM Song Liu wrote: >>>&g

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-05 Thread Song Liu
> On Apr 5, 2021, at 6:24 PM, Cong Wang wrote: > > On Mon, Apr 5, 2021 at 6:08 PM Song Liu wrote: >> >> >> >>> On Apr 5, 2021, at 4:49 PM, Cong Wang wrote: >>> >>> On Fri, Apr 2, 2021 at 4:31 PM Song Liu wrote: >>>&g

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-05 Thread Song Liu
> On Apr 5, 2021, at 4:49 PM, Cong Wang wrote: > > On Fri, Apr 2, 2021 at 4:31 PM Song Liu wrote: >> >> >> >>> On Apr 2, 2021, at 1:57 PM, Cong Wang wrote: >>> >>> Ideally I even prefer to create timers in kernel-space too, but a

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Song Liu
> On Apr 2, 2021, at 1:57 PM, Cong Wang wrote: > > On Fri, Apr 2, 2021 at 12:45 PM Song Liu wrote: >> >> >> >>> On Apr 2, 2021, at 12:08 PM, Cong Wang wrote: >>> >>> On Fri, Apr 2, 2021 at 10:57 AM Song Liu wrote: >>>>

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Song Liu
> On Apr 2, 2021, at 12:08 PM, Cong Wang wrote: > > On Fri, Apr 2, 2021 at 10:57 AM Song Liu wrote: >> >> >> >>> On Apr 2, 2021, at 10:34 AM, Cong Wang wrote: >>> >>> On Thu, Apr 1, 2021 at 1:17 PM Song Liu wrote: >>>>

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-02 Thread Song Liu
> On Apr 2, 2021, at 10:34 AM, Cong Wang wrote: > > On Thu, Apr 1, 2021 at 1:17 PM Song Liu wrote: >> >> >> >>> On Apr 1, 2021, at 10:28 AM, Cong Wang wrote: >>> >>> On Wed, Mar 31, 2021 at 11:38 PM Song Liu wrote: >>>>

Re: [syzbot] WARNING in bpf_test_run

2021-04-01 Thread Yonghong Song
On 4/1/21 3:05 PM, Yonghong Song wrote: On 4/1/21 4:29 AM, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:    36e79851 libbpf: Preserve empty DATASEC BTFs during static.. git tree:   bpf-next console output: https://syzkaller.appspot.com/x/log.txt?x

Re: [PATCH -next] libbpf: remove redundant semi-colon

2021-04-01 Thread Song Liu
On Thu, Apr 1, 2021 at 10:58 AM Yang Yingliang wrote: > > Signed-off-by: Yang Yingliang Please add a short commit log. Thanks, Song > --- > tools/lib/bpf/linker.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/lib/bpf/linker.c b/tools/lib

Re: [PATCH] linux/bpf.h: Remove repeated struct declaration

2021-04-01 Thread Song Liu
On Thu, Apr 1, 2021 at 12:22 AM Wan Jiabing wrote: > > struct btf_type is declared twice. One is declared at 35th line. > The blew one is not needed. Remove the duplicate. > > Signed-off-by: Wan Jiabing Acked-by: Song Liu

Re: [syzbot] WARNING in bpf_test_run

2021-04-01 Thread Yonghong Song
On 4/1/21 4:29 AM, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:36e79851 libbpf: Preserve empty DATASEC BTFs during static.. git tree: bpf-next console output: https://syzkaller.appspot.com/x/log.txt?x=1569bb06d0 kernel config: https://syzkaller.appspo

Re: [PATCH bpf-next] cpumap: bulk skb using netif_receive_skb_list

2021-04-01 Thread Song Liu
b_core(skb); > > > - if (ret == NET_RX_DROP) > > > - drops++; > > > > I guess we stop tracking "drops" with this patch? > > > > Thanks, > > Song > > Hi Song, > > we do not report th

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-04-01 Thread Song Liu
> On Apr 1, 2021, at 10:28 AM, Cong Wang wrote: > > On Wed, Mar 31, 2021 at 11:38 PM Song Liu wrote: >> >> >> >>> On Mar 31, 2021, at 9:26 PM, Cong Wang wrote: >>> >>> From: Cong Wang >>> >>> (This patch is still

Re: [PATCH bpf-next] cpumap: bulk skb using netif_receive_skb_list

2021-04-01 Thread Song Liu
_run(void *data) > continue; > } > > - /* Inject into network stack */ > - ret = netif_receive_skb_core(skb); > - if (ret == NET_RX_DROP) > -

RE: [PATCH net-next v4 0/6] stmmac: Add XDP support

2021-04-01 Thread Song, Yoong Siang
tes from 169.254.1.11: icmp_seq=10 ttl=64 time=0.870 ms --- 169.254.1.11 ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 909ms rtt min/avg/max/mdev = 0.829/1.020/1.136/0.101 ms LP:~# ping 169.254.1.11 -s 500 -i 0.1 -c 10 PING 169.254.1.11 (169.254.1.11) 500(528) bytes of data. From 169.254.1.11 icmp_seq=7 Frag needed and DF set (mtu = 386) From 169.254.1.11 icmp_seq=9 Frag needed and DF set (mtu = 386) --- 169.254.1.11 ping statistics --- 10 packets transmitted, 0 received, +2 errors, 100% packet loss, time 930ms Regards Song, Yoong Siang

Re: [PATCH] linux/bpf-cgroup.h: Delete repeated struct declaration

2021-03-31 Thread Song Liu
> On Mar 31, 2021, at 11:46 PM, Wan Jiabing wrote: > > struct bpf_prog is declared twice. There is one declaration > which is independent on the MACRO at 18th line. > So the below one is not needed though. Remove the duplicate. > > Signed-off-by: Wan Jiabing

Re: [RFC Patch bpf-next] bpf: introduce bpf timer

2021-03-31 Thread Song Liu
e don't have to address "creating a timer but not adding it to a map" problem in the kernel. If the user forgot it, the user should debug it. Thanks, Song [...]

Re: [Patch bpf-next] bpf: remove unused parameter from ___bpf_prog_run

2021-03-31 Thread Song Liu
On Wed, Mar 31, 2021 at 12:14 AM He Fengqing wrote: > > 'stack' parameter is not used in ___bpf_prog_run, > the base address have been set to FP reg. So consequently remove it. > > Signed-off-by: He Fengqing Acked-by: Song Liu

Re: [PATCH bpf-next v2] bpf: check flags in 'bpf_ringbuf_discard()' and 'bpf_ringbuf_submit()'

2021-03-30 Thread Song Liu
> On Mar 30, 2021, at 3:37 PM, Pedro Tammela wrote: > > The current code only checks flags in 'bpf_ringbuf_output()'. > > Signed-off-by: Pedro Tammela Acked-by: Song Liu

Re: [PATCH bpf-next] bpf: check flags in 'bpf_ringbuf_discard()' and 'bpf_ringbuf_submit()'

2021-03-30 Thread Song Liu
> On Mar 30, 2021, at 7:22 AM, Pedro Tammela wrote: > > Em seg., 29 de mar. de 2021 às 13:10, Song Liu > escreveu: >> >> >> >>> On Mar 28, 2021, at 9:10 AM, Pedro Tammela wrote: >>> >>> The current code only checks flags in 

Re: [Patch bpf-next] net: filter: Remove unused bpf_load_pointer

2021-03-30 Thread Song Liu
On Mon, Mar 29, 2021 at 7:11 PM He Fengqing wrote: > > Remove unused bpf_load_pointer function in filter.h > > Signed-off-by: He Fengqing Acked-by: Song Liu [...]

Re: [PATCH bpf-next 2/2] bpf: selftests: Update clang requirement in README.rst for testing kfunc call

2021-03-29 Thread Song Liu
> On Mar 29, 2021, at 10:41 PM, Martin KaFai Lau wrote: > > This patch updates the README.rst to specify the clang requirement > to compile the bpf selftests that call kernel function. > > Signed-off-by: Martin KaFai Lau Acked-by: Song Liu

Re: [PATCH bpf-next 1/2] bpf: Update bpf_design_QA.rst to clarify the kfunc call is not ABI

2021-03-29 Thread Song Liu
> On Mar 29, 2021, at 10:41 PM, Martin KaFai Lau wrote: > > This patch updates bpf_design_QA.rst to clarify that the kernel > function callable by bpf program is not an ABI. > > Signed-off-by: Martin KaFai Lau Acked-by: Song Liu

Re: [RFC PATCH bpf-next 4/4] selftests/bpf: Test that module can't be unloaded with attached trampoline

2021-03-29 Thread Song Liu
> On Mar 28, 2021, at 4:26 AM, Jiri Olsa wrote: > > Adding test to verify that once we attach module's trampoline, > the module can't be unloaded. > > Signed-off-by: Jiri Olsa Acked-by: Song Liu [...]

Re: [RFC PATCH bpf-next 2/4] selftests/bpf: Add re-attach test to fentry_test

2021-03-29 Thread Song Liu
ch(fentry_skel); > + if (CHECK(err, "fentry_attach", "fentry re-attach failed: %d\n", err)) > + goto cleanup; > + > + link = bpf_program__attach(fentry_skel->progs.test1); > + if (CHECK(!IS_ERR(link), "attach_fentry re-attach without de

Re: [RFC PATCH bpf-next 1/4] bpf: Allow trampoline re-attach

2021-03-29 Thread Song Liu
ernel program. > > Signed-off-by: Jiri Olsa LGTM. Acked-by: Song Liu [...]

Re: [PATCH v3 bpf-next] tools/resolve_btfids: Fix warnings

2021-03-29 Thread Song Liu
On Mon, Mar 29, 2021 at 3:35 PM Stanislav Fomichev wrote: > > * make eprintf static, used only in main.c > * initialize ret in eprintf > * remove unused *tmp > > v3: > * remove another err (Song Liu) > > v2: > * remove unused 'int err = -1' > > Cc:

Re: [PATCH] selftests/bpf: add LDFLAGS when building test_verifier

2021-03-29 Thread Song Liu
On Mon, Mar 29, 2021 at 11:13 AM Jisheng Zhang wrote: > > From: Jisheng Zhang > > This is useful for cross compile process to point linker to the > correct libelf, libcap, libz path. LGTM: Acked-by: Song Liu btw: Do we also need LDFLAGS for some other binaries, like test_cpp,

Re: [PATCH v2 bpf-next] tools/resolve_btfids: Fix warnings

2021-03-29 Thread Song Liu
On Mon, Mar 29, 2021 at 9:46 AM Stanislav Fomichev wrote: > > * make eprintf static, used only in main.c > * initialize ret in eprintf > * remove unused *tmp > * remove unused 'int err = -1' > > Signed-off-by: Stanislav Fomichev > --- > tools/bpf/resolve_btfids/main.c | 7 +++ > 1 file chang

Re: [PATCH bpf-next] libbpf: Add '_wait()' and '_nowait()' macros for 'bpf_ring_buffer__poll()'

2021-03-29 Thread Song Liu
I think we don't need ring_buffer__poll_wait() as ring_buffer__poll() already means "wait for timeout_ms". Actually, I think ring_buffer__poll() is enough. ring_buffer__poll_nowait() is not that useful either. Thanks, Song

Re: [PATCH bpf-next] bpf: check flags in 'bpf_ringbuf_discard()' and 'bpf_ringbuf_submit()'

2021-03-29 Thread Song Liu
c > @@ -397,26 +397,35 @@ static void bpf_ringbuf_commit(void *sample, u64 flags, > bool discard) > > BPF_CALL_2(bpf_ringbuf_submit, void *, sample, u64, flags) > { > + if (unlikely(flags & ~(BPF_RB_NO_WAKEUP | BPF_RB_FORCE_WAKEUP))) > + return -EINVAL; We can move this check to bpf_ringbuf_commit(). Thanks, Song [...]

Re: [PATCH bpf-next] bpf: add 'BPF_RB_MAY_WAKEUP' flag

2021-03-29 Thread Song Liu
e might notify the consumer if it already caught up in processing, > so let's provide a more descriptive notation for this value. > > Signed-off-by: Pedro Tammela Acked-by: Song Liu

Re: [PATCH bpf-next] libbpf: fix memory leak when emitting final btf_ext

2021-03-29 Thread Song Liu
support") > Signed-off-by: Andrii Nakryiko Acked-by: Song Liu > --- > tools/lib/bpf/linker.c | 24 > 1 file changed, 16 insertions(+), 8 deletions(-) > > diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c > index a29d62ff8041..46b16cb

Re: [PATCH] bpf: remove redundant assignment of variable id

2021-03-26 Thread Song Liu
On Fri, Mar 26, 2021 at 12:45 PM Colin King wrote: > > From: Colin Ian King > > The variable id is being assigned a value that is never > read, the assignment is redundant and can be removed. > > Addresses-Coverity: ("Unused value") > Signed-off-by: Colin I

Re: [PATCH bpf v2 2/2] bpf: program: refuse non-O_RDWR flags in BPF_OBJ_GET

2021-03-26 Thread Song Liu
*pathname, int > flags) > return PTR_ERR(raw); For both patches, shall we do the check before bpf_obj_do_get(), which is a few lines above? Thanks, Song > > if (type == BPF_TYPE_PROG) > - ret = bpf_prog_new_fd(raw); > + ret = (f_

Re: [PATCH bpf-next] libbpf: preserve empty DATASEC BTFs during static linking

2021-03-25 Thread Yonghong Song
support") Signed-off-by: Andrii Nakryiko Ack with a nit below. Acked-by: Yonghong Song --- tools/lib/bpf/linker.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index 5e0aa2f2c0ca..2c43943da30c 100644 --- a

Re: linux-next: manual merge of the net-next tree with the net tree

2021-03-19 Thread Yonghong Song
On 3/19/21 12:21 AM, Daniel Borkmann wrote: On 3/19/21 3:11 AM, Piotr Krysiuk wrote: Hi Daniel, On Fri, Mar 19, 2021 at 12:16 AM Stephen Rothwell wrote: diff --cc kernel/bpf/verifier.c index 44e4ec1640f1,f9096b049cd6.. --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@

Re: [PATCH] bpf: selftests: remove unused 'nospace_err' in tests for batched ops in array maps

2021-03-15 Thread Yonghong Song
On 3/15/21 6:29 AM, Pedro Tammela wrote: This seems to be a reminiscent from the hashmap tests. Signed-off-by: Pedro Tammela Acked-by: Yonghong Song

Re: [PATCH bpf-next] bpf: Make symbol 'bpf_task_storage_busy' static

2021-03-11 Thread Song Liu
atic? > > This symbol is not used outside of bpf_task_storage.c, so this > commit marks it static. > > Fixes: bc235cdb423a ("bpf: Prevent deadlock from recursive > bpf_task_storage_[get|delete]") > Reported-by: Hulk Robot > Signed-off-by: Wei Yongjun Acked-b

Re: [BUG] hitting bug when running spinlock test

2021-03-09 Thread Yonghong Song
On 3/9/21 10:21 AM, Roman Gushchin wrote: On Mon, Mar 08, 2021 at 09:44:08PM -0800, Yonghong Song wrote: On 3/5/21 1:10 PM, Yonghong Song wrote: On 3/5/21 12:38 PM, Roman Gushchin wrote: On Thu, Mar 04, 2021 at 08:03:33PM +0100, Jiri Olsa wrote: hi, I'm getting attached BUG/crash

Re: [BUG] hitting bug when running spinlock test

2021-03-08 Thread Yonghong Song
On 3/5/21 1:10 PM, Yonghong Song wrote: On 3/5/21 12:38 PM, Roman Gushchin wrote: On Thu, Mar 04, 2021 at 08:03:33PM +0100, Jiri Olsa wrote: hi, I'm getting attached BUG/crash when running in parralel selftests, like:    while :; do ./test_progs -t spinlock; done    while

Re: [PATCH bpf-next] selftests/bpf: fix compiler warning in BPF_KPROBE definition in loop6.c

2021-03-08 Thread Yonghong Song
ed, struct scatterlist **sgs, ^ 1 warning generated. Fixes: 86a35af628e5 ("selftests/bpf: Add a verifier scale test with unknown bounded loop") Signed-off-by: Andrii Nakryiko Oh, my bad. Thanks for fixing it! Acked-by: Yonghong Song

Re: [BUG] hitting bug when running spinlock test

2021-03-05 Thread Yonghong Song
On 3/5/21 12:38 PM, Roman Gushchin wrote: On Thu, Mar 04, 2021 at 08:03:33PM +0100, Jiri Olsa wrote: hi, I'm getting attached BUG/crash when running in parralel selftests, like: while :; do ./test_progs -t spinlock; done while :; do ./test_progs ; done it's the latest bpf-next/master,

Re: [BUG] hitting bug when running spinlock test

2021-03-04 Thread Yonghong Song
On 3/4/21 11:03 AM, Jiri Olsa wrote: hi, I'm getting attached BUG/crash when running in parralel selftests, like: while :; do ./test_progs -t spinlock; done while :; do ./test_progs ; done it's the latest bpf-next/master, I can send the .config if needed, but I don't think there's anyt

Re: [Patch bpf-next v2 8/9] sock_map: update sock type checks for UDP

2021-03-03 Thread Yonghong Song
On 3/3/21 10:02 AM, Cong Wang wrote: On Tue, Mar 2, 2021 at 10:37 PM Yonghong Song wrote: On 3/1/21 6:37 PM, Cong Wang wrote: From: Cong Wang Now UDP supports sockmap and redirection, we can safely update the sock type checks for it accordingly. Cc: John Fastabend Cc: Daniel

Re: [PATCH] selftests/bpf: Simplify the calculation of variables

2021-03-03 Thread Yonghong Song
On 3/2/21 11:52 PM, Jiapeng Chong wrote: Fix the following coccicheck warnings: ./tools/testing/selftests/bpf/test_sockmap.c:735:35-37: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Yonghong Song

Re: [PATCH] bpf: Simplify the calculation of variables

2021-03-03 Thread Yonghong Song
On 3/2/21 11:20 PM, Jiapeng Chong wrote: Fix the following coccicheck warnings: ./tools/bpf/bpf_dbg.c:1201:55-57: WARNING !A || A && B is equivalent to !A || B. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Yonghong Song

Re: [Patch bpf-next v2 8/9] sock_map: update sock type checks for UDP

2021-03-03 Thread Yonghong Song
On 3/1/21 6:37 PM, Cong Wang wrote: From: Cong Wang Now UDP supports sockmap and redirection, we can safely update the sock type checks for it accordingly. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- net/core/sock_map.c | 5

Re: [Patch bpf-next v2 4/9] udp: implement ->read_sock() for sockmap

2021-03-03 Thread Yonghong Song
On 3/1/21 6:37 PM, Cong Wang wrote: From: Cong Wang Some even simple commit message here will be preferred compared to empty commit message. Cc: John Fastabend Cc: Daniel Borkmann Cc: Jakub Sitnicki Cc: Lorenz Bauer Signed-off-by: Cong Wang --- include/net/udp.h | 2 ++ net/ipv

Re: [PATCH bpf-next] tools/runqslower: allow substituting custom vmlinux.h for the build

2021-03-02 Thread Yonghong Song
allow to provide pre-generated vmlinux.h for runqslower build. Cc: Martin Lau Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song

Re: [PATCH bpf-next] selftests/bpf: Fix test_attach_probe for powerpc uprobes

2021-03-02 Thread Yonghong Song
On 3/2/21 3:14 AM, Jiri Olsa wrote: On Mon, Mar 01, 2021 at 04:34:24PM -0800, Andrii Nakryiko wrote: On Mon, Mar 1, 2021 at 11:11 AM Jiri Olsa wrote: When testing uprobes we the test gets GEP (Global Entry Point) address from kallsyms, but then the function is called locally so the uprobe

Re: [External] Re: [PATCH 4/5] mm: memcontrol: move remote memcg charging APIs to CONFIG_MEMCG_KMEM

2021-03-02 Thread Muchun Song
On Tue, Mar 2, 2021 at 9:15 AM Roman Gushchin wrote: > > On Mon, Mar 01, 2021 at 02:22:26PM +0800, Muchun Song wrote: > > The remote memcg charing APIs is a mechanism to charge kernel memory > > to a given memcg. So we can move the infrastructure to the scope of > &g

Re: [External] Re: [PATCH 2/5] mm: memcontrol: make page_memcg{_rcu} only applicable for non-kmem page

2021-03-02 Thread Muchun Song
On Tue, Mar 2, 2021 at 11:36 AM Shakeel Butt wrote: > > On Mon, Mar 1, 2021 at 7:03 PM Muchun Song wrote: > > > > On Tue, Mar 2, 2021 at 2:11 AM Shakeel Butt wrote: > > > > > > On Sun, Feb 28, 2021 at 10:25 PM Muchun Song > > > wrote: > >

Re: [External] Re: [PATCH 2/5] mm: memcontrol: make page_memcg{_rcu} only applicable for non-kmem page

2021-03-02 Thread Muchun Song
st. I will reduce the CC list in the next version. Thanks. > > On Mon, Mar 01, 2021 at 10:11:45AM -0800, Shakeel Butt wrote: > > On Sun, Feb 28, 2021 at 10:25 PM Muchun Song > > wrote: > > > > > > We want to reuse the obj_cgroup APIs to reparent the kmem p

Re: [External] Re: [PATCH 2/5] mm: memcontrol: make page_memcg{_rcu} only applicable for non-kmem page

2021-03-02 Thread Muchun Song
On Tue, Mar 2, 2021 at 2:11 AM Shakeel Butt wrote: > > On Sun, Feb 28, 2021 at 10:25 PM Muchun Song wrote: > > > > We want to reuse the obj_cgroup APIs to reparent the kmem pages when > > the memcg offlined. If we do this, we should store an object cgroup > > point

Re: [External] Re: [PATCH 0/5] Use obj_cgroup APIs to change kmem pages

2021-03-02 Thread Muchun Song
On Tue, Mar 2, 2021 at 9:12 AM Roman Gushchin wrote: > > Hi Muchun! > > On Mon, Mar 01, 2021 at 02:22:22PM +0800, Muchun Song wrote: > > Since Roman series "The new cgroup slab memory controller" applied. All > > slab objects are changed via the new APIs of obj_c

Re: [PATCH bpf-next] selftests/bpf: Fix test_attach_probe for powerpc uprobes

2021-03-02 Thread Yonghong Song
On 3/1/21 11:04 AM, Jiri Olsa wrote: When testing uprobes we the test gets GEP (Global Entry Point) address from kallsyms, but then the function is called locally so the uprobe is not triggered. Fixing this by adjusting the address to LEP (Local Entry Point) for powerpc arch. Signed-off-by:

[PATCH 5/5] mm: memcontrol: use object cgroup for remote memory cgroup charging

2021-02-28 Thread Muchun Song
. Actually, the slab core use obj_cgroup APIs for memory cgroup charing, so we can hold a refcount to obj_cgroup instead of memory cgroup. In this case, the infrastructure of remote meory charging also do not hold a refcount to memory cgroup. Signed-off-by: Muchun Song --- fs/buffer.c

[PATCH 4/5] mm: memcontrol: move remote memcg charging APIs to CONFIG_MEMCG_KMEM

2021-02-28 Thread Muchun Song
The remote memcg charing APIs is a mechanism to charge kernel memory to a given memcg. So we can move the infrastructure to the scope of the CONFIG_MEMCG_KMEM. As a bonus, on !CONFIG_MEMCG_KMEM build some functions and variables can be compiled out. Signed-off-by: Muchun Song --- include/linux

[PATCH 3/5] mm: memcontrol: reparent the kmem pages on cgroup removal

2021-02-28 Thread Muchun Song
mem page. Signed-off-by: Muchun Song --- include/linux/memcontrol.h | 66 +++ mm/memcontrol.c| 155 - 2 files changed, 124 insertions(+), 97 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol

[PATCH 1/5] mm: memcontrol: introduce obj_cgroup_{un}charge_page

2021-02-28 Thread Muchun Song
movement without any functional change. Signed-off-by: Muchun Song --- mm/memcontrol.c | 46 +++--- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2db2aeac8a9e..2eafbae504ac 100644 --- a/mm/memcontrol.c

[PATCH 2/5] mm: memcontrol: make page_memcg{_rcu} only applicable for non-kmem page

2021-02-28 Thread Muchun Song
age_memcg_check in the later patch. Signed-off-by: Muchun Song --- include/linux/memcontrol.h | 56 +++--- mm/memcontrol.c| 23 ++- mm/page_alloc.c| 4 ++-- 3 files changed, 63 insertions(+), 20 deletions(-)

[PATCH 0/5] Use obj_cgroup APIs to change kmem pages

2021-02-28 Thread Muchun Song
cgroup. So I also make it use the APIs of obj_cgroup. Patch 4-5 are doing this. Muchun Song (5): mm: memcontrol: introduce obj_cgroup_{un}charge_page mm: memcontrol: make page_memcg{_rcu} only applicable for non-kmem page mm: memcontrol: reparent the kmem pages on cgroup removal m

[PATCH v6 bpf-next 5/6] bpf: runqslower: prefer using local vmlimux to generate vmlinux.h

2021-02-25 Thread Song Liu
Update the Makefile to prefer using $(O)/vmlinux, $(KBUILD_OUTPUT)/vmlinux (for selftests) or ../../../vmlinux. These two files should have latest definitions for vmlinux.h. Acked-by: Andrii Nakryiko Signed-off-by: Song Liu --- tools/bpf/runqslower/Makefile | 5 - 1 file changed, 4

[PATCH v6 bpf-next 6/6] bpf: runqslower: use task local storage

2021-02-25 Thread Song Liu
, as those in handle__sched_wakeup, are much faster with task local storage. If we disable hashtab prealloc, task local storage is much faster for all 3 functions. Acked-by: Andrii Nakryiko Signed-off-by: Song Liu --- tools/bpf/runqslower/runqslower.bpf.c | 33 +-- 1 file

[PATCH v6 bpf-next 4/6] selftests/bpf: test deadlock from recursive bpf_task_storage_[get|delete]

2021-02-25 Thread Song Liu
Add a test with recursive bpf_task_storage_[get|delete] from fentry programs on bpf_local_storage_lookup and bpf_local_storage_update. Without proper deadlock prevent mechanism, this test would cause deadlock. Signed-off-by: Song Liu --- .../bpf/prog_tests/task_local_storage.c | 23

[PATCH v6 bpf-next 3/6] selftests/bpf: add non-BPF_LSM test for task local storage

2021-02-25 Thread Song Liu
should not). Signed-off-by: Song Liu --- .../bpf/prog_tests/task_local_storage.c | 69 +++ .../selftests/bpf/progs/task_local_storage.c | 64 + .../bpf/progs/task_local_storage_exit_creds.c | 32 + 3 files changed, 165 insertions(+) create mode 100644

[PATCH v6 bpf-next 2/6] bpf: prevent deadlock from recursive bpf_task_storage_[get|delete]

2021-02-25 Thread Song Liu
le, if bpf_local_storage_map owns the counters, it cannot prevent deadlock on bpf_local_storage->lock when two maps are used. Signed-off-by: Song Liu --- include/linux/bpf_local_storage.h | 3 +- kernel/bpf/bpf_inode_storage.c| 2 +- kernel/bpf/bpf_local_storage.c| 11 +- kernel/bpf/bpf_task_

[PATCH v6 bpf-next 1/6] bpf: enable task local storage for tracing programs

2021-02-25 Thread Song Liu
allocate new storage when the task is not refcounted (task->usage == 0). Acked-by: KP Singh Acked-by: Martin KaFai Lau Signed-off-by: Song Liu --- include/linux/bpf.h| 7 ++ include/linux/bpf_lsm.h| 22 - include/linux/bpf_types.h | 2 +- incl

[PATCH v6 bpf-next 0/6] bpf: enable task local storage for tracing programs

2021-02-25 Thread Song Liu
or a task being freed. 3. Minor changes in runqslower. Song Liu (6): bpf: enable task local storage for tracing programs bpf: prevent deadlock from recursive bpf_task_storage_[get|delete] selftests/bpf: add non-BPF_LSM test for task local storage selftests/bpf: test deadlock

Re: [PATCH v5 bpf-next 1/6] bpf: enable task local storage for tracing programs

2021-02-23 Thread Yonghong Song
On 2/23/21 2:28 PM, Song Liu wrote: To access per-task data, BPF programs usually creates a hash table with pid as the key. This is not ideal because: 1. The user need to estimate the proper size of the hash table, which may be inaccurate; 2. Big hash tables are slow; 3. To clean

[PATCH v5 bpf-next 6/6] bpf: runqslower: use task local storage

2021-02-23 Thread Song Liu
, as those in handle__sched_wakeup, are much faster with task local storage. If we disable hashtab prealloc, task local storage is much faster for all 3 functions. Acked-by: Andrii Nakryiko Signed-off-by: Song Liu --- tools/bpf/runqslower/runqslower.bpf.c | 33 +-- 1 file

[PATCH v5 bpf-next 3/6] selftests/bpf: add non-BPF_LSM test for task local storage

2021-02-23 Thread Song Liu
should not). Signed-off-by: Song Liu --- .../bpf/prog_tests/task_local_storage.c | 69 +++ .../selftests/bpf/progs/task_local_storage.c | 64 + .../bpf/progs/task_local_storage_exit_creds.c | 32 + 3 files changed, 165 insertions(+) create mode 100644

[PATCH v5 bpf-next 5/6] bpf: runqslower: prefer using local vmlimux to generate vmlinux.h

2021-02-23 Thread Song Liu
Update the Makefile to prefer using $(O)/vmlinux, $(KBUILD_OUTPUT)/vmlinux (for selftests) or ../../../vmlinux. These two files should have latest definitions for vmlinux.h. Acked-by: Andrii Nakryiko Signed-off-by: Song Liu --- tools/bpf/runqslower/Makefile | 5 - 1 file changed, 4

[PATCH v5 bpf-next 4/6] selftests/bpf: test deadlock from recursive bpf_task_storage_[get|delete]

2021-02-23 Thread Song Liu
Add a test with recursive bpf_task_storage_[get|delete] from fentry programs on bpf_local_storage_lookup and bpf_local_storage_update. Without proper deadlock prevent mechanism, this test would cause deadlock. Signed-off-by: Song Liu --- .../bpf/prog_tests/task_local_storage.c | 23

[PATCH v5 bpf-next 0/6] bpf: enable task local storage for tracing programs

2021-02-23 Thread Song Liu
nges with runqslower. (Andrii) 3. Shortern CC list to make it easy for vger. Changes v1 => v2: 1. Do not allocate task local storage when the task is being freed. 2. Revise the selftest and added a new test for a task being freed. 3. Minor changes in runqslower. Song Liu (6): bpf: enable task local

[PATCH v5 bpf-next 1/6] bpf: enable task local storage for tracing programs

2021-02-23 Thread Song Liu
allocate new storage when the task is not refcounted (task->usage == 0). Reported-by: kernel test robot Acked-by: KP Singh Signed-off-by: Song Liu --- include/linux/bpf.h| 7 ++ include/linux/bpf_lsm.h| 22 - include/linux/bpf_types.h |

[PATCH v5 bpf-next 2/6] bpf: prevent deadlock from recursive bpf_task_storage_[get|delete]

2021-02-23 Thread Song Liu
le, if bpf_local_storage_map owns the counters, it cannot prevent deadlock on bpf_local_storage->lock when two maps are used. Signed-off-by: Song Liu --- kernel/bpf/bpf_task_storage.c | 57 ++- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/kernel/bpf/bpf_task_

Re: [PATCH v4 bpf-next 1/6] bpf: enable task local storage for tracing programs

2021-02-23 Thread Song Liu
> On Feb 23, 2021, at 11:23 AM, Martin Lau wrote: > > On Mon, Feb 22, 2021 at 05:20:09PM -0800, Song Liu wrote: > [ ... ] > >> diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c >> index e0da0258b732d..2034019966d44 100644 >> --

Re: [PATCH v4 bpf-next 2/6] bpf: prevent deadlock from recursive bpf_task_storage_[get|delete]

2021-02-23 Thread Song Liu
> On Feb 23, 2021, at 3:06 AM, Peter Zijlstra wrote: > > On Mon, Feb 22, 2021 at 05:20:10PM -0800, Song Liu wrote: >> BPF helpers bpf_task_storage_[get|delete] could hold two locks: >> bpf_local_storage_map_bucket->lock and bpf_local_storage->lock. Calling >>

Re: [PATCH v4 bpf-next 2/6] bpf: prevent deadlock from recursive bpf_task_storage_[get|delete]

2021-02-22 Thread Song Liu
> On Feb 22, 2021, at 10:21 PM, Andrii Nakryiko > wrote: > > On Mon, Feb 22, 2021 at 5:23 PM Song Liu wrote: >> >> BPF helpers bpf_task_storage_[get|delete] could hold two locks: >> bpf_local_storage_map_bucket->lock and bpf_local_storage->lock. Callin

[PATCH v4 bpf-next 3/6] selftests/bpf: add non-BPF_LSM test for task local storage

2021-02-22 Thread Song Liu
should not). Signed-off-by: Song Liu --- .../bpf/prog_tests/task_local_storage.c | 69 +++ .../selftests/bpf/progs/task_local_storage.c | 64 + .../bpf/progs/task_local_storage_exit_creds.c | 32 + 3 files changed, 165 insertions(+) create mode 100644

[PATCH v4 bpf-next 4/6] selftests/bpf: test deadlock from recursive bpf_task_storage_[get|delete]

2021-02-22 Thread Song Liu
Add a test with recursive bpf_task_storage_[get|delete] from fentry programs on bpf_local_storage_lookup and bpf_local_storage_update. Without proper deadlock prevent mechanism, this test would cause deadlock. Signed-off-by: Song Liu --- .../bpf/prog_tests/task_local_storage.c | 23

[PATCH v4 bpf-next 6/6] bpf: runqslower: use task local storage

2021-02-22 Thread Song Liu
, as those in handle__sched_wakeup, are much faster with task local storage. If we disable hashtab prealloc, task local storage is much faster for all 3 functions. Acked-by: Andrii Nakryiko Signed-off-by: Song Liu --- tools/bpf/runqslower/runqslower.bpf.c | 33 +-- 1 file

[PATCH v4 bpf-next 5/6] bpf: runqslower: prefer using local vmlimux to generate vmlinux.h

2021-02-22 Thread Song Liu
Update the Makefile to prefer using $(O)/mvlinux, $(KBUILD_OUTPUT)/vmlinux (for selftests) or ../../../vmlinux. These two files should have latest definitions for vmlinux.h. Signed-off-by: Song Liu --- tools/bpf/runqslower/Makefile | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v4 bpf-next 2/6] bpf: prevent deadlock from recursive bpf_task_storage_[get|delete]

2021-02-22 Thread Song Liu
other lock. For example, if bpf_local_storage_map owns the counters, it cannot prevent deadlock on bpf_local_storage->lock when two maps are used. Signed-off-by: Song Liu --- kernel/bpf/bpf_task_storage.c | 57 ++- 1 file changed, 50 insertions(+), 7 deletions

[PATCH v4 bpf-next 1/6] bpf: enable task local storage for tracing programs

2021-02-22 Thread Song Liu
allocate new storage when the task is not refcounted (task->usage == 0). Acked-by: KP Singh Signed-off-by: Song Liu --- include/linux/bpf.h| 7 +++ include/linux/bpf_lsm.h| 22 -- include/linux/bpf_types.h | 2 +- include/linux/sche

[PATCH v4 bpf-next 0/6] bpf: enable task local storage for tracing programs

2021-02-22 Thread Song Liu
evise the selftest and added a new test for a task being freed. 3. Minor changes in runqslower. Song Liu (6): bpf: enable task local storage for tracing programs bpf: prevent deadlock from recursive bpf_task_storage_[get|delete] selftests/bpf: add non-BPF_LSM test for task local storage self

[PATCH net 1/1] net: stmmac: fix CBS idleslope and sendslope calculation

2021-02-17 Thread Song Yoong Siang
From: "Song, Yoong Siang" When link speed is not 100 Mbps, port transmit rate and speed divider are set to 8 and 100 respectively. These values are incorrect for CBS idleslope and sendslope HW values calculation if the link speed is not 1 Gbps. This patch adds switch statement

[PATCH v7 bpf-next 1/3] bpf: introduce task_vma bpf_iter

2021-02-12 Thread Song Liu
p(). Acked-by: Yonghong Song Signed-off-by: Song Liu --- kernel/bpf/task_iter.c | 267 - 1 file changed, 266 insertions(+), 1 deletion(-) diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c index 175b7b42bfc46..b68cb5d6d6ebc 100644 --- a

[PATCH v7 bpf-next 3/3] selftests/bpf: add test for bpf_iter_task_vma

2021-02-12 Thread Song Liu
The test dumps information similar to /proc/pid/maps. The first line of the output is compared against the /proc file to make sure they match. Acked-by: Yonghong Song Signed-off-by: Song Liu --- .../selftests/bpf/prog_tests/bpf_iter.c | 118 -- tools/testing/selftests/bpf

[PATCH v7 bpf-next 0/3] introduce bpf_iter for task_vma

2021-02-12 Thread Song Liu
mmap_lock while calling BPF program. This enables the BPF program to access the real vma with BTF. (Alexei) 2. Fix the logic when the control is returned to user space. (Yonghong) 3. Revise commit log and cover letter. (Yonghong) Changes v1 => v2: 1. Small fixes in task_iter.c and

[PATCH v7 bpf-next 2/3] bpf: allow bpf_d_path in bpf_iter program

2021-02-12 Thread Song Liu
task_file and task_vma iter programs have access to file->f_path. Enable bpf_d_path to print paths of these file. Acked-by: Yonghong Song Signed-off-by: Song Liu --- kernel/trace/bpf_trace.c | 4 1 file changed, 4 insertions(+) diff --git a/kernel/trace/bpf_trace.c b/kernel/tr

[PATCH v6 bpf-next 4/4] selftests/bpf: add test for bpf_iter_task_vma

2021-02-11 Thread Song Liu
The test dumps information similar to /proc/pid/maps. The first line of the output is compared against the /proc file to make sure they match. Acked-by: Yonghong Song Signed-off-by: Song Liu --- .../selftests/bpf/prog_tests/bpf_iter.c | 118 -- tools/testing/selftests/bpf

[PATCH v6 bpf-next 3/4] libbpf: introduce section "iter.s/" for sleepable bpf_iter program

2021-02-11 Thread Song Liu
Sleepable iterator program have access to helper functions like bpf_d_path. Acked-by: Yonghong Song Acked-by: KP Singh Signed-off-by: Song Liu --- tools/lib/bpf/libbpf.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index

[PATCH v6 bpf-next 0/4] introduce bpf_iter for task_vma

2021-02-11 Thread Song Liu
exei) 2. Fix the logic when the control is returned to user space. (Yonghong) 3. Revise commit log and cover letter. (Yonghong) Changes v1 => v2: 1. Small fixes in task_iter.c and the selftests. (Yonghong) Song Liu (4): bpf: introduce task_vma bpf_iter bpf: allow bpf_d_path in

  1   2   3   4   5   6   7   8   9   10   >