Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-16 Thread Song Liu
> On Oct 16, 2019, at 5:10 AM, Oleg Nesterov wrote: > > On 10/16, Song Liu wrote: >> >> --- a/kernel/events/uprobes.c >> +++ b/kernel/events/uprobes.c >> @@ -474,14 +474,17 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, >> struct mm_struct

Re: [PATCH v3 0/3] Fix typo in RWH_WRITE_LIFE_NOT_SET constant name

2019-10-16 Thread Song Liu
Hi Jeff and J. Bruce, On Wed, Oct 2, 2019 at 9:55 AM Song Liu wrote: > > On Tue, Oct 1, 2019 at 5:55 PM Jens Axboe wrote: > > > > On 10/1/19 5:12 PM, Song Liu wrote: > > > On Fri, Sep 20, 2019 at 8:58 AM Eugene Syromiatnikov > > > wrote: > > >>

Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-17 Thread Song Liu
> On Oct 17, 2019, at 1:47 AM, Oleg Nesterov wrote: > > On 10/16, Song Liu wrote: >> >>> On Oct 16, 2019, at 5:10 AM, Oleg Nesterov wrote: >>> >>>> @@ -489,6 +492,9 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, &g

Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-17 Thread Song Liu
> On Oct 17, 2019, at 7:28 AM, Oleg Nesterov wrote: > > On 10/17, Song Liu wrote: >> >> >>> On Oct 17, 2019, at 1:47 AM, Oleg Nesterov wrote: >>> >>> On 10/16, Song Liu wrote: >>>> >>>>> On Oct 16, 20

Re: [PATCH 3/4] mm/thp: allow drop THP from page cache

2019-10-17 Thread Song Liu
> On Oct 17, 2019, at 9:12 AM, Matthew Wilcox wrote: > > On Wed, Oct 16, 2019 at 12:37:30AM -0700, Song Liu wrote: >> From: "Kirill A. Shutemov" >> >> Once a THP is added to the page cache, it cannot be dropped via >> /proc/sys/vm/drop_

[PATCH v2 0/5] Fixes for THP in page cache

2019-10-17 Thread Song Liu
(3): proc/meminfo: fix output alignment mm/thp: fix node page state in split_huge_page_to_list() mm/thp: allow drop THP from page cache Song Liu (1): uprobe: only do FOLL_SPLIT_PMD for uprobe register William Kucharski (1): mm: Support removing arbitrary sized pages from mapping fs/p

[PATCH v2 5/5] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-17 Thread Song Liu
() to confirm uprobe unregister never work on huge pages, and abort the operation when this WARN() triggers. Fixes: 5a52c9df62b4 ("uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT") Cc: Kirill A. Shutemov Cc: Srikar Dronamraju Cc: Oleg Nesterov Signed-off-by: Song Liu --- kernel/events

[PATCH v2 4/5] mm/thp: allow drop THP from page cache

2019-10-17 Thread Song Liu
: Kirill A. Shutemov Tested-by: Song Liu Signed-off-by: Song Liu --- mm/truncate.c | 12 1 file changed, 12 insertions(+) diff --git a/mm/truncate.c b/mm/truncate.c index 8563339041f6..dd9ebc1da356 100644 --- a/mm/truncate.c +++ b/mm/truncate.c @@ -592,6 +592

[PATCH v2 2/5] mm/thp: fix node page state in split_huge_page_to_list()

2019-10-17 Thread Song Liu
From: "Kirill A. Shutemov" Make sure split_huge_page_to_list() handle the state of shmem THP and file THP properly. Fixes: 60fbf0ab5da1 ("mm,thp: stats for file backed THP") Signed-off-by: Kirill A. Shutemov Tested-by: Song Liu Signed-off-by: Song Liu --- mm/huge_memor

[PATCH v2 3/5] mm: Support removing arbitrary sized pages from mapping

2019-10-17 Thread Song Liu
ox (Oracle) Signed-off-by: Song Liu --- mm/vmscan.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index c6659bb758a4..f870da1f4bb7 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -932,10 +932,7 @@ static int __remove_mapping(struct address_spac

[PATCH v2 1/5] proc/meminfo: fix output alignment

2019-10-17 Thread Song Liu
From: "Kirill A. Shutemov" Add extra space for FileHugePages and FilePmdMapped, so the output is aligned with other rows. Fixes: 60fbf0ab5da1 ("mm,thp: stats for file backed THP") Signed-off-by: Kirill A. Shutemov Tested-by: Song Liu Signed-off-by: Song Liu --- fs/proc/m

[PATCH] mm,thp: recheck each page before collapsing file THP

2019-10-17 Thread Song Liu
: Johannes Weiner Cc: Hugh Dickins Cc: William Kucharski Cc: Andrew Morton Signed-off-by: Song Liu --- mm/khugepaged.c | 8 1 file changed, 8 insertions(+) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 0a1b4b484ac5..7da49b643c4d 100644 --- a/mm/khugepaged.c +++ b/mm/kh

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-18 Thread Song Liu
> On Oct 17, 2019, at 5:27 PM, Stephane Eranian wrote: > > This patch complements the following commit: > 7fa343b7fdc4 ("perf/core: Fix corner case in perf_rotate_context()") > > The fix from Song addresses the consequences of the problem but > not the cause. This patch fixes the causes and

Re: [PATCH] perf/core: fix multiplexing event scheduling issue

2019-10-18 Thread Song Liu
> On Oct 17, 2019, at 11:19 PM, Stephane Eranian wrote: > > On Thu, Oct 17, 2019 at 11:13 PM Song Liu wrote: >> >> >> >>> On Oct 17, 2019, at 5:27 PM, Stephane Eranian wrote: >>> >>> This patch complements the following

[PATCH bpf-next 1/2] sched: introduce this_rq_is_locked()

2019-10-10 Thread Song Liu
ffset instead of address") Cc: sta...@vger.kernel.org # v4.17+ Cc: Peter Zijlstra Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Tejun Heo Signed-off-by: Song Liu --- include/linux/sched.h | 1 + kernel/sched/core.c | 8 2 files changed, 9 insertions(+) diff --git a/include/linux

[PATCH bpf-next 2/2] bpf/stackmap: fix A-A deadlock in bpf_get_stack()

2019-10-10 Thread Song Liu
save binary_build_id+offset instead of address") Cc: sta...@vger.kernel.org # v4.17+ Cc: Peter Zijlstra Cc: Alexei Starovoitov Cc: Daniel Borkmann Reported-by: Tejun Heo Signed-off-by: Song Liu Reproducer: 8< char *filename; void *w

[PATCH bpf-next 0/2] bpf/stackmap: fix A-A deadlock in bpf_get_stack()

2019-10-10 Thread Song Liu
do_syscall_64+0x42/0x100 entry_SYSCALL_64_after_hwframe+0x44/0xa9 For more details on how to reproduce this is error, please refer to 2/2. Fix this issue by checking a new helper this_rq_is_locked(). If the rq_lock is already locked, postpone up_read() in irq_work, just like the in_nmi() case. Song

Re: [PATCH] perf/kprobe: maxactive for fd-based kprobe (pmu perf_kprobe)

2019-10-10 Thread Song Liu
> On Oct 7, 2019, at 4:34 PM, Masami Hiramatsu wrote: > > Hi, > > On Mon, 7 Oct 2019 15:31:11 -0700 > Song Liu wrote: > >> Enable specifying maxactive for fd based kretprobe. This will be useful >> for tracing tools like bcc and bpftrace. [1] discussed the

[PATCH v13] perf: Sharing PMU counters across compatible events

2020-05-01 Thread Song Liu
e Melo Cc: Jiri Olsa Cc: Alexey Budankov Cc: Namhyung Kim Cc: Tejun Heo Reported-by: kernel test robot Signed-off-by: Song Liu --- Changes in v13: Fix memory ordering in perf_event_exit_dup_master and perf_event_count. Remove test code in perf_event_can_share(). Changes in v12: Add perf_event-

Re: [PATCH v12] perf: Sharing PMU counters across compatible events

2020-04-29 Thread Song Liu
> On Apr 20, 2020, at 4:04 PM, Peter Zijlstra wrote: >> >> static inline u64 perf_event_count(struct perf_event *event) >> { >> -return local64_read(>count) + atomic64_read(>child_count); >> +u64 count; >> + >> +if (likely(event->dup_master != event)) >> +count =

Re: [PATCH] md/raid0: add config parameters to specify zone layout

2020-04-30 Thread Song Liu
Hi Jason, > On Apr 27, 2020, at 2:10 PM, Jason Baron wrote: > > > > On 4/25/20 12:31 AM, Coly Li wrote: >> On 2020/3/26 23:28, Jason Baron wrote: >>> Let's add some CONFIG_* options to directly configure the raid0 layout >>> if you know in advance how your raid0 array was created. This can be

[PATCH v4] mm,thp: recheck each page before collapsing file THP

2019-10-22 Thread Song Liu
en flushed since first write. In such case, calls filemap_flush() and defer the collapse. Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Cc: Kirill A. Shutemov Cc: Hugh Dickins Cc: William Kucharski Cc: Andrew Morton Acked-by: Johannes Weiner Sig

[PATCH v2 bpf-next] bpf/stackmap: fix deadlock with rq_lock in bpf_get_stack()

2019-10-14 Thread Song Liu
Cc: Daniel Borkmann Signed-off-by: Song Liu Reproducer: 8< char *filename; void *worker(void *p) { void *ptr; int fd; char *pptr; fd = open(filename, O_RDONLY); if (fd < 0)

Re: [PATCH bpf-next 2/2] bpf/stackmap: fix A-A deadlock in bpf_get_stack()

2019-10-14 Thread Song Liu
Thanks Peter! > On Oct 14, 2019, at 2:09 AM, Peter Zijlstra wrote: > > On Thu, Oct 10, 2019 at 06:06:14PM +, Alexei Starovoitov wrote: >> On 10/10/19 10:46 AM, Peter Zijlstra wrote: > >>> All of stack_map_get_build_id_offset() is just disguisting games; I did >>> tell you guys how to do

[PATCH 3/4] mm/thp: allow drop THP from page cache

2019-10-16 Thread Song Liu
FS") Signed-off-by: Kirill A. Shutemov Tested-by: Song Liu Signed-off-by: Song Liu --- mm/truncate.c | 12 mm/vmscan.c | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mm/truncate.c b/mm/truncate.c index 8563339041f6..dd9ebc1da356 100644 --- a/mm

[PATCH 2/4] mm/thp: fix node page state in split_huge_page_to_list()

2019-10-16 Thread Song Liu
From: "Kirill A. Shutemov" Make sure split_huge_page_to_list() handle the state of shmem THP and file THP properly. Fixes: 60fbf0ab5da1 ("mm,thp: stats for file backed THP") Signed-off-by: Kirill A. Shutemov Tested-by: Song Liu Signed-off-by: Song Liu --- mm/huge_memor

[PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-16 Thread Song Liu
a WARN() to confirm uprobe unregister never work on huge pages. Fixes: 5a52c9df62b4 ("uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT") Cc: Kirill A. Shutemov Cc: Srikar Dronamraju Cc: Oleg Nesterov Signed-off-by: Song Liu --- kernel/events/uprobes.c | 10 -- 1 file changed, 8

[PATCH 1/4] proc/meminfo: fix output alignment

2019-10-16 Thread Song Liu
From: "Kirill A. Shutemov" Add extra space for FileHugePages and FilePmdMapped, so the output is aligned with other rows. Fixes: 60fbf0ab5da1 ("mm,thp: stats for file backed THP") Signed-off-by: Kirill A. Shutemov Tested-by: Song Liu Signed-off-by: Song Liu --- fs/proc/m

[PATCH 0/4] Fixes for THP in page cache

2019-10-16 Thread Song Liu
This set includes a few fixes for THP in page cache. They are based on Linus's master branch. Thanks, Song Kirill A. Shutemov (3): proc/meminfo: fix output alignment mm/thp: fix node page state in split_huge_page_to_list() mm/thp: allow drop THP from page cache Song Liu (1): uprobe

[PATCH] perf: rework memory accounting in perf_mmap()

2019-09-04 Thread Song Liu
10 * user_extra | 4 * user_extra| Fix this by maintaining proper user_extra and extra. Reported-by: Hechao Li Cc: Jie Meng Cc: Peter Zijlstra Signed-off-by: Song Liu --- kernel/events/core.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/kernel/events/core.c

Re: [PATCH bpf-next v2] Documentation/bpf: Use valid and new links in index.rst

2020-07-29 Thread Song Liu
On Wed, Jul 29, 2020 at 6:17 AM Tiezhu Yang wrote: > > There exists an error "404 Not Found" when I click the html link of > "Documentation/networking/filter.rst" in the BPF documentation [1], > fix it. > > Additionally, use the new links about "BPF and XDP Reference Guide" > and "bpf(2)" to

[PATCH v2 bpf-next 4/4] selftests/bpf: add bpf_iter test with bpf_get_task_stack()

2020-06-25 Thread Song Liu
The new test is similar to other bpf_iter tests. Signed-off-by: Song Liu --- .../selftests/bpf/prog_tests/bpf_iter.c | 17 ++ .../selftests/bpf/progs/bpf_iter_task_stack.c | 60 +++ 2 files changed, 77 insertions(+) create mode 100644 tools/testing/selftests/bpf/progs

[PATCH v2 bpf-next 0/4] bpf: introduce bpf_get_task_stack()

2020-06-25 Thread Song Liu
s v1 => v2: 1. Reuse most of bpf_get_stack() logic. (Andrii) 2. Fix unsigned long vs. u64 mismatch for 32-bit systems. (Yonghong) 3. Add %pB support in bpf_trace_printk(). (Daniel) 4. Fix buffer size to bytes. Song Liu (4): perf: export get/put_chain_entry() bpf: introduce helper bpf_get_task

[PATCH v2 bpf-next 1/4] perf: export get/put_chain_entry()

2020-06-25 Thread Song Liu
This would be used by bpf stack mapo. Signed-off-by: Song Liu --- include/linux/perf_event.h | 2 ++ kernel/events/callchain.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index b4bb32082342c..00ab5efa38334

[PATCH v2 bpf-next 2/4] bpf: introduce helper bpf_get_task_stak()

2020-06-25 Thread Song Liu
-bit systems, we need to translate it to u64 array. Signed-off-by: Song Liu --- include/linux/bpf.h| 1 + include/uapi/linux/bpf.h | 35 ++- kernel/bpf/stackmap.c | 79 -- kernel/trace/bpf_trace.c | 2 + scripts

[PATCH v2 bpf-next 3/4] bpf: allow %pB in bpf_seq_printf() and bpf_trace_printk()

2020-06-25 Thread Song Liu
This makes it easy to dump stack trace in text. Signed-off-by: Song Liu --- kernel/trace/bpf_trace.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 65fa62723e2f8..1cb90b0868817 100644 --- a/kernel/trace

Re: [PATCH bpf-next v2 01/35] bpf: memcg-based memory accounting for bpf progs

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:20 PM Roman Gushchin wrote: > > Include memory used by bpf programs into the memcg-based accounting. > This includes the memory used by programs itself, auxiliary data > and statistics. > > Signed-off-by: Roman Gushchin > --- > kernel/bpf/core.c | 8 > 1 file

Re: [PATCH bpf-next v2 02/35] bpf: memcg-based memory accounting for bpf maps

2020-07-27 Thread Song Liu
ing for > some map types. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH bpf-next v2 03/35] bpf: refine memcg-based memory accounting for arraymap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:23 PM Roman Gushchin wrote: > > Include percpu arrays and auxiliary data into the memcg-based memory > accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH bpf-next v2 29/35] bpf: libbpf: cleanup RLIMIT_MEMLOCK usage

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 3:07 PM Andrii Nakryiko wrote: > > On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > > > As bpf is not using memlock rlimit for memory accounting anymore, > > let's remove the related code from libbpf. > > > > Bpf operations can't fail because of exceeding the

Re: [PATCH bpf-next v2 04/35] bpf: refine memcg-based memory accounting for cpumap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:23 PM Roman Gushchin wrote: > > Include metadata and percpu data into the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/cpumap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deleti

Re: [PATCH bpf-next v2 05/35] bpf: memcg-based memory accounting for cgroup storage maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Account memory used by cgroup storage maps including the percpu memory > for the percpu flavor of cgroup storage and map metadata. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH bpf-next v2 06/35] bpf: refine memcg-based memory accounting for devmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Include map metadata and the node size (struct bpf_dtab_netdev) on > element update into the accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH bpf-next v2 07/35] bpf: refine memcg-based memory accounting for hashtab maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:20 PM Roman Gushchin wrote: > > Include percpu objects and the size of map metadata into the > accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH bpf-next v2 08/35] bpf: memcg-based memory accounting for lpm_trie maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Include lpm trie and lpm trie node objects into the memcg-based memory > accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/lpm_trie.c | 4 ++-- > 1 file changed, 2 in

Re: [PATCH bpf-next v2 09/35] bpf: memcg-based memory accounting for bpf ringbuffer

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Enable the memcg-based memory accounting for the memory used by > the bpf ringbuffer. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/ringbuf.c | 9 + > 1 file changed, 5 in

Re: [PATCH bpf-next v2 10/35] bpf: memcg-based memory accounting for socket storage maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:28 PM Roman Gushchin wrote: > > Account memory used by the socket storage. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/core/bpf_sk_storage.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) >

Re: [PATCH bpf-next v2 11/35] bpf: refine memcg-based memory accounting for sockmap and sockhash maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:27 PM Roman Gushchin wrote: > > Include internal metadata into the memcg-based memory accounting. > Also include the memory allocated on updating an element. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/core/sock_map.c

Re: [PATCH bpf-next v2 12/35] bpf: refine memcg-based memory accounting for xskmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: > > Extend xskmap memory accounting to include the memory taken by > the xsk_map_node structure. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/xdp/xskmap.c | 3 ++- > 1 file changed, 2 i

Re: [PATCH bpf-next v2 13/35] bpf: eliminate rlimit-based memory accounting for arraymap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for arraymap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kerne

Re: [PATCH bpf-next v2 01/35] bpf: memcg-based memory accounting for bpf progs

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 5:08 PM Roman Gushchin wrote: > > On Mon, Jul 27, 2020 at 03:11:42PM -0700, Song Liu wrote: > > On Mon, Jul 27, 2020 at 12:20 PM Roman Gushchin wrote: > > > > > > Include memory used by bpf programs into the memcg-based accounting. >

Re: [Linux-kernel-mentees] [PATCH net] xdp: Prevent kernel-infoleak in xsk_getsockopt()

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 7:30 PM Peilin Ye wrote: > > xsk_getsockopt() is copying uninitialized stack memory to userspace when > `extra_stats` is `false`. Fix it by initializing `stats` with memset(). > > Cc: sta...@vger.kernel.org 8aa5a33578e9 is not in stable branches yet, so we don't need to

Re: [PATCH bpf-next v2 14/35] bpf: eliminate rlimit-based memory accounting for bpf_struct_ops maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for bpf_struct_ops maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH bpf-next v2 15/35] bpf: eliminate rlimit-based memory accounting for cpumap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for cpumap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/cpumap.c | 16

Re: [PATCH bpf-next v2 16/35] bpf: eliminate rlimit-based memory accounting for cgroup storage maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for cgroup storage maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf

Re: [PATCH bpf-next v2 17/35] bpf: eliminate rlimit-based memory accounting for devmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:20 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for devmap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/devmap.c | 18 ++

Re: [PATCH bpf-next v2 19/35] bpf: eliminate rlimit-based memory accounting for lpm_trie maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for lpm_trie maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/lpm_trie.c |

Re: [PATCH bpf-next v2 18/35] bpf: eliminate rlimit-based memory accounting for hashtab maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for hashtab maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kern

Re: [PATCH bpf-next v2 20/35] bpf: eliminate rlimit-based memory accounting for queue_stack_maps maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for queue_stack maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/qu

Re: [PATCH bpf-next v2 21/35] bpf: eliminate rlimit-based memory accounting for reuseport_array maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:23 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for reuseport_array maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/r

Re: [PATCH bpf-next v2 22/35] bpf: eliminate rlimit-based memory accounting for bpf ringbuffer

2020-07-27 Thread Song Liu
er, so to simplify the code make it return NULL > in the first case. This allows to drop a couple of lines in > ringbuf_map_alloc() and also makes it look similar to other memory > allocating function like kmalloc(). > > Signed-off-by: Roman Gushchin Acked-by: Song Liu &

Re: [PATCH bpf-next v2 23/35] bpf: eliminate rlimit-based memory accounting for sockmap and sockhash maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for sockmap and sockhash maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net

Re: [PATCH bpf-next v2 24/35] bpf: eliminate rlimit-based memory accounting for stackmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for stackmap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/stackmap.c | 16

Re: [PATCH bpf-next v2 25/35] bpf: eliminate rlimit-based memory accounting for socket storage maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for socket storage maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/core/

Re: [PATCH bpf-next v2 26/35] bpf: eliminate rlimit-based memory accounting for xskmap maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for xskmap maps. > It has been replaced with the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > net/xdp/xskmap.c | 10

Re: [PATCH bpf-next v2 27/35] bpf: eliminate rlimit-based memory accounting infra for bpf maps

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Remove rlimit-based accounting infrastructure code, which is not used > anymore. > > Signed-off-by: Roman Gushchin [...] > > static void bpf_map_put_uref(struct bpf_map *map) > @@ -541,7 +484,7 @@ static void bpf_map_show_fdinfo(struct

Re: [PATCH bpf-next v2 28/35] bpf: eliminate rlimit-based memory accounting for bpf progs

2020-07-27 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Do not use rlimit-based memory accounting for bpf progs. It has been > replaced with memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu

Re: [PATCH bpf-next v2 30/35] bpf: bpftool: do not touch RLIMIT_MEMLOCK

2020-07-28 Thread Song Liu
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin wrote: > > Since bpf stopped using memlock rlimit to limit the memory usage, > there is no more reason for bpftool to alter its own limits. > > Signed-off-by: Roman Gushchin I think we will need feature check for memcg based accounting. Thanks,

Re: [PATCH bpf-next v2 27/35] bpf: eliminate rlimit-based memory accounting infra for bpf maps

2020-07-28 Thread Song Liu
On Mon, Jul 27, 2020 at 10:58 PM Andrii Nakryiko wrote: > > On Mon, Jul 27, 2020 at 10:47 PM Song Liu wrote: > > > > On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > > > > > Remove rlimit-based accounting infrastructure code, which is not used &

Re: [PATCH bpf-next v2 32/35] bpf: selftests: delete bpf_rlimit.h

2020-07-28 Thread Song Liu
> On Jul 27, 2020, at 11:06 PM, Andrii Nakryiko > wrote: > > On Mon, Jul 27, 2020 at 12:25 PM Roman Gushchin wrote: >> >> As rlimit-based memory accounting is not used by bpf anymore, >> there are no more reasons to play with memlock rlimit. >> >> Delete bpf_rlimit.h which contained a

Re: [PATCH bpf-next v2 34/35] bpf: samples: do not touch RLIMIT_MEMLOCK

2020-07-28 Thread Song Liu
On Mon, Jul 27, 2020 at 12:26 PM Roman Gushchin wrote: > > Since bpf is not using rlimit memlock for the memory accounting > and control, do not change the limit in sample applications. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- [...] > samples/bp

Re: [Linux-kernel-mentees] [PATCH net v2] xdp: Prevent kernel-infoleak in xsk_getsockopt()

2020-07-28 Thread Song Liu
"xsk: Add new statistics") >> Suggested-by: Dan Carpenter >> Signed-off-by: Peilin Ye >> --- > > Acked-by: Björn Töpel Acked-by: Song Liu [...]

Re: [PATCH] md: fix deadlock causing by sysfs_notify

2020-07-14 Thread Song Liu
On Mon, Jul 13, 2020 at 11:41 PM Junxiao Bi wrote: > > On 7/13/20 11:17 PM, Song Liu wrote: > > > On Thu, Jul 9, 2020 at 4:36 PM Junxiao Bi wrote: > >> The following deadlock was captured. The first process is holding > >> 'kernfs_mutex' > &

Re: decruft the early init / initrd / initramfs code v2

2020-07-14 Thread Song Liu
> b/include/linux/syscalls.h | 16 -- > > > b/init/Makefile |1 > > > b/init/do_mounts.c | 70 +-- > > > b/init/do_mounts.h | 21 --- > > > b/init/do_mounts_initrd.c | 13 -- > > > b/init/do_mounts_rd.c | 102 +++-- > > > b/init/initramfs.c | 103 + > > > b/init/main.c | 16 +- > > > include/linux/raid/md_u.h | 13 -- > > > 24 files changed, 251 insertions(+), 452 deletions(-) > > > > I guess I could say something here... ;) > > Like adding an ACK? :) For the md bits: Acked-by: Song Liu Thanks!

[PATCH v2 bpf-next 0/2] bpf: fix stackmap on perf_events with PEBS

2020-07-14 Thread Song Liu
oid introducing new helper function. (Andrii) Song Liu (2): bpf: separate bpf_get_[stack|stackid] for perf events BPF selftests/bpf: add callchain_stackid include/linux/bpf.h | 2 + kernel/bpf/stackmap.c | 204 -- kernel/tr

[PATCH v2 bpf-next 1/2] bpf: separate bpf_get_[stack|stackid] for perf events BPF

2020-07-14 Thread Song Liu
errors. To fix this, add separate version of these two helpers, bpf_get_[stack|stackid]_pe. These two hepers use callchain in bpf_perf_event_data_kern->data->callchain. Signed-off-by: Song Liu --- include/linux/bpf.h | 2 + kernel/bpf/stackmap.c

[PATCH v2 bpf-next 2/2] selftests/bpf: add callchain_stackid

2020-07-14 Thread Song Liu
This tests new helper function bpf_get_stackid_pe and bpf_get_stack_pe. These two helpers have different implementation for perf_event with PEB entries. Signed-off-by: Song Liu --- .../bpf/prog_tests/perf_event_stackmap.c | 120 ++ .../selftests/bpf/progs

[PATCH v5 bpf-next 2/5] bpf: fail PERF_EVENT_IOC_SET_BPF when bpf_get_[stack|stackid] cannot work

2020-07-23 Thread Song Liu
this error and print proper hint message. Signed-off-by: Song Liu --- include/linux/filter.h | 3 ++- kernel/bpf/verifier.c | 3 +++ kernel/events/core.c | 18 ++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index

[PATCH v5 bpf-next 5/5] selftests/bpf: add get_stackid_cannot_attach

2020-07-23 Thread Song Liu
This test confirms that BPF program that calls bpf_get_stackid() cannot attach to perf_event with precise_ip > 0 but not PERF_SAMPLE_CALLCHAIN; and cannot attach if the perf_event has exclude_callchain_kernel. Signed-off-by: Song Liu --- .../prog_tests/get_stackid_cannot_attach.c|

[PATCH v5 bpf-next 0/5] bpf: fix stackmap on perf_events with PEBS

2020-07-23 Thread Song Liu
oid introducing new helper function. (Andrii) Song Liu (5): bpf: separate bpf_get_[stack|stackid] for perf events BPF bpf: fail PERF_EVENT_IOC_SET_BPF when bpf_get_[stack|stackid] cannot work libbpf: print hint when PERF_EVENT_IOC_SET_BPF returns -EPROTO selftests/bpf: add ca

[PATCH v5 bpf-next 1/5] bpf: separate bpf_get_[stack|stackid] for perf events BPF

2020-07-23 Thread Song Liu
errors. To fix this, add separate version of these two helpers, bpf_get_[stack|stackid]_pe. These two hepers use callchain in bpf_perf_event_data_kern->data->callchain. Signed-off-by: Song Liu --- include/linux/bpf.h | 2 + kernel/bpf/stackmap.c

[PATCH v5 bpf-next 3/5] libbpf: print hint when PERF_EVENT_IOC_SET_BPF returns -EPROTO

2020-07-23 Thread Song Liu
The kernel prevents potential unwinder warnings and crashes by blocking BPF program with bpf_get_[stack|stackid] on perf_event without PERF_SAMPLE_CALLCHAIN, or with exclude_callchain_[kernel|user]. Print a hint message in libbpf to help the user debug such issues. Signed-off-by: Song Liu

[PATCH bpf-next] bpf: fix build on architectures with special bpf_user_pt_regs_t

2020-07-24 Thread Song Liu
) Reported-by: kernel test robot Signed-off-by: Song Liu --- kernel/bpf/stackmap.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c index 5beb2f8c23da1..4fd830a62be2d 100644 --- a/kernel/bpf/stackmap.c +++ b/kernel/bpf/

[PATCH v3 bpf-next 0/2] bpf: fix stackmap on perf_events with PEBS

2020-07-16 Thread Song Liu
kip field. (Andrii) 2. Simplify the code in a few places. (Andrii) Changes v1 => v2: 1. Simplify the design and avoid introducing new helper function. (Andrii) Song Liu (2): bpf: separate bpf_get_[stack|stackid] for perf events BPF selftests/bpf: add callchain_stackid include/linux

[PATCH v3 bpf-next 1/2] bpf: separate bpf_get_[stack|stackid] for perf events BPF

2020-07-16 Thread Song Liu
errors. To fix this, add separate version of these two helpers, bpf_get_[stack|stackid]_pe. These two hepers use callchain in bpf_perf_event_data_kern->data->callchain. Signed-off-by: Song Liu --- include/linux/bpf.h | 2 + kernel/bpf/stackmap.c

Re: [PATCH v3 bpf-next 1/2] bpf: separate bpf_get_[stack|stackid] for perf events BPF

2020-07-21 Thread Song Liu
> On Jul 21, 2020, at 12:10 PM, Alexei Starovoitov > wrote: > > On Thu, Jul 16, 2020 at 03:59:32PM -0700, Song Liu wrote: >> + >> +BPF_CALL_3(bpf_get_stackid_pe, struct bpf_perf_event_data_kern *, ctx, >> + struct bpf_map *, map, u64, flags) >> +{ &g

Re: [PATCH v3 bpf-next 1/2] bpf: separate bpf_get_[stack|stackid] for perf events BPF

2020-07-21 Thread Song Liu
> On Jul 21, 2020, at 3:43 PM, Alexei Starovoitov > wrote: > > On Tue, Jul 21, 2020 at 3:40 PM Song Liu wrote: >> >> We only need to block precise_ip >= 2. precise_ip == 1 is OK. > > Are you sure? > intel_pmu_hw_config() has: > if (e

Re: [PATCH] raid: md_p.h: drop duplicated word in a comment

2020-07-21 Thread Song Liu
On Fri, Jul 17, 2020 at 4:37 PM Randy Dunlap wrote: > > From: Randy Dunlap > > Drop the doubled word "the" in a comment. > > Signed-off-by: Randy Dunlap > Cc: Song Liu > Cc: linux-r...@vger.kernel.org Applied to md-next. Thanks! > --- > include/ua

Re: [PATCH v4 19/24] raid5: Use sequence counter with associated spinlock

2020-07-22 Thread Song Liu
gt; If lockdep is disabled this lock association is compiled out and has > neither storage size nor runtime overhead. > > Signed-off-by: Ahmed S. Darwish Acked-by: Song Liu

Re: [PATCH v3 bpf-next 1/2] bpf: separate bpf_get_[stack|stackid] for perf events BPF

2020-07-22 Thread Song Liu
> On Jul 22, 2020, at 8:40 AM, Peter Zijlstra wrote: > > On Tue, Jul 21, 2020 at 10:40:19PM +0000, Song Liu wrote: > >> We only need to block precise_ip >= 2. precise_ip == 1 is OK. > > Uuuh, how? Anything PEBS would have the same problem. Sure, precise_ip >

[PATCH v4 bpf-next 0/4] bpf: fix stackmap on perf_events with PEBS

2020-07-22 Thread Song Liu
Andrii) 2. Simplify the code in a few places. (Andrii) Changes v1 => v2: 1. Simplify the design and avoid introducing new helper function. (Andrii) Song Liu (4): bpf: separate bpf_get_[stack|stackid] for perf events BPF bpf: fail PERF_EVENT_IOC_SET_BPF when bpf_get_[stack|stackid] can

[PATCH v4 bpf-next 4/4] selftests/bpf: add get_stackid_cannot_attach

2020-07-22 Thread Song Liu
This test confirms that BPF program that calls bpf_get_stackid() cannot attach to perf_event with precise_ip > 0 but not PERF_SAMPLE_CALLCHAIN; and cannot attach if the perf_event has exclude_callchain_kernel. Signed-off-by: Song Liu --- .../prog_tests/get_stackid_cannot_attach.c|

[PATCH v4 bpf-next 1/4] bpf: separate bpf_get_[stack|stackid] for perf events BPF

2020-07-22 Thread Song Liu
errors. To fix this, add separate version of these two helpers, bpf_get_[stack|stackid]_pe. These two hepers use callchain in bpf_perf_event_data_kern->data->callchain. Signed-off-by: Song Liu --- include/linux/bpf.h | 2 + kernel/bpf/stackmap.c

[PATCH v4 bpf-next 2/4] bpf: fail PERF_EVENT_IOC_SET_BPF when bpf_get_[stack|stackid] cannot work

2020-07-22 Thread Song Liu
bpf_get_[stack|stackid] on perf_events with precise_ip uses callchain attached to perf_sample_data. If this callchain is not presented, do not allow attaching BPF program that calls bpf_get_[stack|stackid] to this event. Signed-off-by: Song Liu --- include/linux/filter.h | 3 ++- kernel/bpf

Re: general protection fault in khugepaged

2020-07-22 Thread Song Liu
> On Jul 20, 2020, at 2:08 AM, Kirill A. Shutemov wrote: > > On Sat, Jul 18, 2020 at 04:54:09PM +0800, Hillf Danton wrote: >> >> Wed, 08 Jul 2020 23:43:19 -0700 >>> syzbot found the following crash on: >>> >>> HEAD commit:e44f65fd xen-netfront: remove redundant assignment to vari.. >>>

Re: [PATCH v4 bpf-next 2/4] bpf: fail PERF_EVENT_IOC_SET_BPF when bpf_get_[stack|stackid] cannot work

2020-07-23 Thread Song Liu
> On Jul 22, 2020, at 10:55 PM, Alexei Starovoitov > wrote: > > On Wed, Jul 22, 2020 at 11:42:08AM -0700, Song Liu wrote: >> diff --git a/kernel/events/core.c b/kernel/events/core.c >> index 856d98c36f562..f77d009fcce95 100644 >> --- a/kernel/events/core.c

Re: [PATCH 4.19 108/114] Revert "Dont jump to compute_result state from check_result state"

2019-05-25 Thread Song Liu
> On May 25, 2019, at 9:07 AM, Greg Kroah-Hartman > wrote: > > On Sat, May 25, 2019 at 02:08:35PM +0200, Pavel Machek wrote: >> On Thu 2019-05-23 21:06:47, Greg Kroah-Hartman wrote: >>> From: Song Liu >>> >>> commit a25d8c327bb41742dbd59f8c545

Re: [PATCH] selftests: bpf: fix compiler warning

2019-05-28 Thread Song Liu
On Thu, May 23, 2019 at 5:31 PM Alakesh Haloi wrote: > > Add missing header file following compiler warning > > prog_tests/flow_dissector.c: In function ‘tx_tap’: > prog_tests/flow_dissector.c:175:9: warning: implicit declaration of function > ‘writev’; did you mean ‘write’?

Re: [PATCH bpf v2] selftests: bpf: fix compiler warning

2019-05-28 Thread Song Liu
rite’? [-Wimplicit-function-declaration] > return writev(fd, iov, ARRAY_SIZE(iov)); > ^~ > write > > Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less > mode") > Signed-off-by: Alakesh Haloi Acked-by: Song Liu Thanks f

[PATCH v5 3/6] mm,thp: stats for file backed THP

2019-06-20 Thread Song Liu
In preparation for non-shmem THP, this patch adds two stats and exposes them in /proc/meminfo Acked-by: Rik van Riel Signed-off-by: Song Liu --- fs/proc/meminfo.c | 4 include/linux/mmzone.h | 2 ++ mm/vmstat.c| 2 ++ 3 files changed, 8 insertions(+) diff --git a/fs/proc

<    3   4   5   6   7   8   9   10   11   12   >