> 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
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:
> > >>
> 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
> 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
> 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_
(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
() 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
: 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
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
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
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
: 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
> 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
> 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
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
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
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
> 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
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-
> 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 =
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
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
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)
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
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
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
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
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
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
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
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
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
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
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
-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
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
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
ing for
> some map types.
>
> Signed-off-by: Roman Gushchin
Acked-by: 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
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
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
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
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
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
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
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
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(-)
>
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
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
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
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.
>
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
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
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
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
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 ++
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 |
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
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
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
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
&
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
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
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/
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
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
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
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,
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
&
> 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
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
"xsk: Add new statistics")
>> Suggested-by: Dan Carpenter
>> Signed-off-by: Peilin Ye
>> ---
>
> Acked-by: Björn Töpel
Acked-by: 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'
> &
> 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!
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
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
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
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
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|
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
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
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
)
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/
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
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
> 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
> 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
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
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
> 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
>
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
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|
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
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
> 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..
>>>
> 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
> 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
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’?
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
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
701 - 800 of 1581 matches
Mail list logo