Re: [PATCH] net/core/skmsg: Delete an unnecessary check before the function call “consume_skb”

2019-08-22 Thread Song Liu
by using the Coccinelle software. > > Signed-off-by: Markus Elfring Acked-by: Song Liu

Re: [PATCH v12 5/6] khugepaged: enable collapse pmd for pte-mapped THP

2019-08-15 Thread Song Liu
> On Aug 15, 2019, at 3:16 AM, Oleg Nesterov wrote: > > Hi Song, > > sorry, I forgot to reply to this email, > > On 08/13, Song Liu wrote: >> >> Do you have further comments for the version below? If not, could you >> please reply with your Acked-by o

Re: [PATCH 0/3] Rewrite x86/ftrace to use text_poke()

2019-08-28 Thread Song Liu
is not easy to back port these patches to 5.2 based kernel. Thanks, Song Tested-by: Song Liu

Re: [patch 2/2] x86/mm/pti: Do not invoke PTI functions when PTI is disabled

2019-08-28 Thread Song Liu
Make the > invocation conditional. > > Signed-off-by: Thomas Gleixner Acked-by: Song Liu

Re: [patch 1/2] x86/mm/pti: Handle unaligned address gracefully in pti_clone_pagetable()

2019-08-28 Thread Song Liu
> On Aug 28, 2019, at 8:51 AM, Thomas Gleixner wrote: > > On Wed, 28 Aug 2019, Dave Hansen wrote: >> On 8/28/19 7:24 AM, Thomas Gleixner wrote: >>> From: Song Liu >>> >>> pti_clone_pmds() assumes that the supplied address is either: >>&g

Re: [patch 1/2] x86/mm/pti: Handle unaligned address gracefully in pti_clone_pagetable()

2019-08-28 Thread Song Liu
> On Aug 28, 2019, at 1:05 PM, Thomas Gleixner wrote: > > On Wed, 28 Aug 2019, Song Liu wrote: >>> On Aug 28, 2019, at 8:51 AM, Thomas Gleixner wrote: >>> >>> On Wed, 28 Aug 2019, Dave Hansen wrote: >>>> On 8/28/19 7:24

[PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-22 Thread Song Liu
heck completely") Fixes: 585948f4f695 ("x86/mm/cpa: Avoid the 4k pages check completely") Cc: sta...@vger.kernel.org # v4.20+ Cc: Thomas Gleixner Cc: Dave Hansen Cc: Peter Zijlstra Signed-off-by: Song Liu --- arch/x86/mm/init_64.c | 4 ++-- arch/x86/mm/mm_internal.h |

Re: [PATCH v2] x86/mm/pti: in pti_clone_pgtable(), increase addr properly

2019-08-23 Thread Song Liu
> On Aug 23, 2019, at 5:59 PM, Thomas Gleixner wrote: > > On Wed, 21 Aug 2019, Thomas Gleixner wrote: >> On Wed, 21 Aug 2019, Song Liu wrote: >>>> On Aug 20, 2019, at 1:23 PM, Song Liu wrote: >>>> >>>> Before 32-bit support, pti_clone_pmds

Re: [PATCH v2] x86/mm/pti: in pti_clone_pgtable(), increase addr properly

2019-08-23 Thread Song Liu
> On Aug 21, 2019, at 3:30 AM, Peter Zijlstra wrote: > > On Wed, Aug 21, 2019 at 12:10:08PM +0200, Peter Zijlstra wrote: >> On Tue, Aug 20, 2019 at 01:23:14PM -0700, Song Liu wrote: > >>> host-5.2-after # grep "x pmd" /sys/kernel/debug/page_t

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-25 Thread Song Liu
Cc: Steven Rostedt and Suresh Siddha Hi Peter, > On Aug 23, 2019, at 2:36 AM, Peter Zijlstra wrote: > > On Thu, Aug 22, 2019 at 10:23:35PM -0700, Song Liu wrote: >> As 4k pages check was removed from cpa [1], set_kernel_text_rw() leads to >> split_large_page() for all ke

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Song Liu
> On Aug 26, 2019, at 2:23 AM, Peter Zijlstra wrote: > > So only the high mapping is ever executable; the identity map should not > be. Both should be RO. > >> kprobe (with CONFIG_KPROBES_ON_FTRACE) should work on kernel identity >> mapping. > > Please provide more information; kprobes shou

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Song Liu
> On Aug 26, 2019, at 8:08 AM, Song Liu wrote: > > > >> On Aug 26, 2019, at 2:23 AM, Peter Zijlstra wrote: >> >> So only the high mapping is ever executable; the identity map should not >> be. Both should be RO. >> >>> kprobe (with CONFI

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

2019-09-04 Thread Song Liu
* 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/c

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-14 Thread Song Liu
Hi Tejun, On Sat, Aug 31, 2019 at 6:01 AM Tejun Heo wrote: > > Hello, > > On Sat, Aug 31, 2019 at 12:03:26PM +0900, Namhyung Kim wrote: > > Hmm.. it looks hard to use fhandle as the identifier since perf > > sampling is done in NMI context. AFAICS the encode_fh part seems ok > > but getting dent

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

2019-09-16 Thread Song Liu
Hi Peter, > On Sep 4, 2019, at 2:46 PM, Song Liu wrote: > > perf_mmap() always increases user->locked_vm. As a result, "extra" could > grow bigger than "user_extra", which doesn't make sense. Here is an > example case: > > Note: Assume "us

Re: [GIT pull] x86/pti for 5.4-rc1

2019-09-17 Thread Song Liu
> On Sep 17, 2019, at 11:13 AM, Linus Torvalds > wrote: > > On Mon, Sep 16, 2019 at 6:38 AM Thomas Gleixner wrote: >> >> - Handle unaligned addresses gracefully in pti_clone_pagetable(). Not an >>issue with current callers, but a correctness problem. Adds a warning >>so any caller

Re: [GIT pull] x86/pti for 5.4-rc1

2019-09-17 Thread Song Liu
> On Sep 17, 2019, at 12:01 PM, Linus Torvalds > wrote: > > On Tue, Sep 17, 2019 at 11:49 AM Song Liu wrote: >> >> I guess we need something like the following? >> >> diff --git i/arch/x86/mm/pti.c w/arch/x86/mm/pti.c >> index b196524759ec..7846

Re: [GIT pull] x86/pti for 5.4-rc1

2019-09-18 Thread Song Liu
> On Sep 17, 2019, at 4:35 PM, Linus Torvalds > wrote: > > On Tue, Sep 17, 2019 at 4:29 PM Song Liu wrote: >> >> How about we just do: >> >> diff --git i/arch/x86/mm/pti.c w/arch/x86/mm/pti.c >> index b196524759ec..0437f65250db 100644 >> --

Re: [PATCH bpf-next 1/2] selftests/bpf: add static to enable_all_controllers()

2019-10-02 Thread Song Liu
t; [-Wmissing-prototypes] > int enable_all_controllers(char *cgroup_path) > > while samples/bpf build. > > Signed-off-by: Ivan Khoronzhuk Acked-by: Song Liu

Re: [PATCH bpf-next 2/2] selftests/bpf: correct path to include msg + path

2019-10-02 Thread Song Liu
rkdir on > 24 bytes with assumption to include also "/cgroup.subtree_control" to > the address. The cut will never happen anyway. > > Signed-off-by: Ivan Khoronzhuk Acked-by: Song Liu

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

2019-10-02 Thread Song Liu
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: > >> > >> Hello. > >> > >> This is a small fix of a typo (or, more specifically, s

Re: [PATCH v2] samples/bpf: Add a workaround for asm_inline

2019-10-02 Thread Song Liu
Florent Revest > Signed-off-by: Florent Revest > Signed-off-by: KP Singh Acked-by: Song Liu

Re: [PATCH 1/2] perf tools: Make usage of test_attr__* optional for perf-sys.h

2019-10-02 Thread Song Liu
e everything related to > sys_perf_event_open() to perf-sys.h") > Signed-off-by: Björn Töpel Acked-by: Song Liu

Re: [PATCH 2/2] samples/bpf: fix build by setting HAVE_ATTR_TEST to zero

2019-10-02 Thread Song Liu
On Tue, Oct 1, 2019 at 4:36 AM Björn Töpel wrote: > > From: Björn Töpel > > To remove that test_attr__{enabled/open} are used by perf-sys.h, we > set HAVE_ATTR_TEST to zero. > > Signed-off-by: Björn Töpel Acked-by: Song Liu

Re: [PATCH v2] samples/bpf: Add a workaround for asm_inline

2019-10-02 Thread Song Liu
> On Oct 2, 2019, at 1:22 PM, Andrii Nakryiko wrote: > > On Wed, Oct 2, 2019 at 12:17 PM KP Singh wrote: >> >> From: KP Singh >> >> This was added in: >> >> commit eb111869301e ("compiler-types.h: add asm_inline definition") >> >> and breaks samples/bpf as clang does not support asm __i

[PATCH] perf/core: fix corner case in perf_rotate_context()

2019-10-02 Thread Song Liu
ble rotate_ctx() to handle event == NULL case. Fixes: 8d5bce0c37fa ("perf/core: Optimize perf_rotate_context() event scheduling") Cc: sta...@vger.kernel.org # v4.17+ Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Thomas Gleixner Signed-off-by: Song Liu --- kernel/event

Re: [PATCH tip/core/rcu 6/9] bpf/cgroup: Replace rcu_swap_protected() with rcu_replace()

2019-10-03 Thread Song Liu
a step towards removing > > rcu_swap_protected(). > > > > Link: > > https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=z7-ggtm6wcvtyytxza1+bhqta4gg...@mail.gmail.com/ > > Reported-by: Linus Torvalds > > Signed-off-by: Paul E. McKenney > > Cc: Alexei

Re: [PATCH] tools: bpf: Use !building_out_of_srctree to determine srctree

2019-09-27 Thread Song Liu
On Thu, Sep 26, 2019 at 6:14 PM Shuah Khan wrote: > > make TARGETS=bpf kselftest fails with: > > Makefile:127: tools/build/Makefile.include: No such file or directory > > When the bpf tool make is invoked from tools Makefile, srctree is > cleared and the current logic check for srctree equals to e

Re: [PATCH] tools: bpf: Use !building_out_of_srctree to determine srctree

2019-09-27 Thread Song Liu
> On Sep 27, 2019, at 12:03 PM, Shuah Khan wrote: > > On 9/27/19 12:44 PM, Song Liu wrote: >> On Thu, Sep 26, 2019 at 6:14 PM Shuah Khan wrote: >>> >>> make TARGETS=bpf kselftest fails with: >>> >>> Makefile:127: tools/build/Makefile.inclu

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

2019-09-29 Thread Song Liu
> On Sep 16, 2019, at 1:10 PM, Hechao Li wrote: > > Song Liu wrote on Mon [2019-Sep-16 12:43:16 -0700]: >> Hi Peter, >> >>> On Sep 4, 2019, at 2:46 PM, Song Liu wrote: >>> >>> perf_mmap() always increases user->locked_vm. As a result, &qu

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

2019-09-29 Thread Song Liu
Hi Peter, > On Sep 18, 2019, at 10:23 PM, Song Liu wrote: > > This patch tries to enable PMU sharing. To make perf event scheduling > fast, we use special data structures. > > An array of "struct perf_event_dup" is added to the perf_event_context, > to remember

Re: [PATCH] md/raid0: Fix an error message in raid0_make_request()

2019-10-01 Thread Song Liu
On Fri, Sep 20, 2019 at 11:00 PM Dan Carpenter wrote: > > The first argument to WARN() is supposed to be a condition. The > original code will just print the mdname() instead of the full warning > message. > > Fixes: c84a1372df92 ("md/raid0: avoid RAID0 data corruption due to layout > confusion.

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

2019-10-01 Thread Song Liu
On Fri, Sep 20, 2019 at 8:58 AM Eugene Syromiatnikov wrote: > > Hello. > > This is a small fix of a typo (or, more specifically, some remnant of > the old patch version spelling) in RWH_WRITE_LIFE_NOT_SET constant, > which is named as RWF_WRITE_LIFE_NOT_SET currently. Since the name > with "H" is

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

2019-10-07 Thread Song Liu
: Song Liu Cc: Steven Rostedt (VMware) Cc: Masami Hiramatsu Cc: Peter Zijlstra (Intel) --- include/linux/trace_events.h| 3 ++- kernel/events/core.c| 20 kernel/trace/trace_event_perf.c | 5 +++-- kernel/trace/trace_kprobe.c | 4 ++-- kernel/trace

Re: [PATCH] perf/core: fix corner case in perf_rotate_context()

2019-10-08 Thread Song Liu
> On Oct 8, 2019, at 2:35 AM, Peter Zijlstra wrote: > > On Wed, Oct 02, 2019 at 11:43:17PM -0700, Song Liu wrote: >> This is a rare corner case, but it does happen: >> >> In perf_rotate_context(), when the first cpu flexible event fail to >> schedule, cpu_rot

[PATCH v2] perf/core: fix corner case in perf_rotate_context()

2019-10-08 Thread Song Liu
to ctx_event_to_rotate(), which is more accurate. Fixes: 8d5bce0c37fa ("perf/core: Optimize perf_rotate_context() event scheduling") Cc: sta...@vger.kernel.org # v4.17+ Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Thomas Gleixner Cc: Sasha Levin Signed-off-by: Song Liu ---

Re: [PATCH] kmemleak: Do not corrupt the object_list during clean-up

2019-10-09 Thread Song Liu
t; > Fixes: c5665868183f ("mm: kmemleak: use the memory pool for early > > allocations") > > Reported-by: Alexey Kardashevskiy > > Reported-by: Marc Dionne > > Cc: Andrew Morton > > Signed-off-by: Catalin Marinas > > > Tested-by: Alexey Kardashevskiy Tested-by: Song Liu This fixes my vm, which could not boot with 5.4-rc3. Thanks, Song

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

2019-10-09 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-09 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-09 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/core: fix corner case in perf_rotate_context()

2019-10-05 Thread Song Liu
> On Oct 2, 2019, at 11:43 PM, Song Liu wrote: > > This is a rare corner case, but it does happen: > > In perf_rotate_context(), when the first cpu flexible event fail to > schedule, cpu_rotate is 1, while cpu_event is NULL. Since cpu_event is > NULL, perf_rotate_co

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

2019-10-07 Thread Song Liu
Hi Peter, > On Sep 30, 2019, at 2:02 AM, Peter Zijlstra wrote: > > On Wed, Sep 04, 2019 at 02:46:18PM -0700, Song Liu wrote: >> perf_mmap() always increases user->locked_vm. As a result, "extra" could >> grow bigger than "user_extra", which do

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

2019-09-18 Thread Song Liu
perf_event_dup. Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Alexey Budankov Cc: Namhyung Kim Cc: Tejun Heo Signed-off-by: Song Liu --- include/linux/perf_event.h | 61 kernel/events/core.c | 294 ++--- 2 files changed,

[PATCH] x86/mm/pti: Handle unaligned addr to PMD-mapped page in pti_clone_pgtable

2019-09-18 Thread Song Liu
ix.de/ Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Peter Zijlstra (Intel) Cc: Linus Torvalds Signed-off-by: Song Liu --- arch/x86/mm/pti.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index 7f2140414440..d224115c350d 100644 --- a/arch/x86/mm/pti.c

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-18 Thread Song Liu
On Mon, Sep 16, 2019 at 4:23 PM Tejun Heo wrote: > > Hello, Song. > > On Sat, Sep 14, 2019 at 03:02:51PM +0100, Song Liu wrote: > > I think we don't need a perfect identifier in this case. IIUC, the goal of > > I really don't want different versions of imp

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-20 Thread Song Liu
Hi Namhyung, On Fri, Sep 20, 2019 at 1:47 AM Namhyung Kim wrote: > > Hello Song, > > On Thu, Sep 19, 2019 at 3:43 PM Song Liu wrote: > > > Sharing some offline discussions with Tejun. > > > > ino in current kernfs is not a good unique ID for cgroup, because it d

[PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE

2019-08-20 Thread Song Liu
ned-off-by: Song Liu Cc: Joerg Roedel Cc: Thomas Gleixner Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra --- arch/x86/mm/pti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index b196524759ec..5a67c3015f59 100644 --- a/arch/x8

Re: [PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE

2019-08-20 Thread Song Liu
> On Aug 20, 2019, at 2:12 AM, Thomas Gleixner wrote: > > On Tue, 20 Aug 2019, Song Liu wrote: > >> pti_clone_pgtable() increases addr by PUD_SIZE for pud_none(*pud) case. >> This is not accurate because addr may not be PUD_SIZE aligned. > > You fail to expla

Re: [PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE

2019-08-20 Thread Song Liu
> On Aug 20, 2019, at 3:00 AM, Peter Zijlstra wrote: > > On Tue, Aug 20, 2019 at 12:51:28AM -0700, Song Liu wrote: >> pti_clone_pgtable() increases addr by PUD_SIZE for pud_none(*pud) case. >> This is not accurate because addr may not be PUD_SIZE aligned. >&g

Re: [PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE

2019-08-20 Thread Song Liu
> On Aug 20, 2019, at 4:16 AM, Thomas Gleixner wrote: > > On Tue, 20 Aug 2019, Peter Zijlstra wrote: >> What that code wants to do is skip to the end of the pud, a pmd_size >> increase will not do that. And right below this, there's a second >> instance of this exact pattern. >> >> Did I get

Re: [PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE

2019-08-20 Thread Song Liu
> On Aug 20, 2019, at 6:55 AM, Rik van Riel wrote: > > On Tue, 2019-08-20 at 09:21 -0400, Song Liu wrote: >>> On Aug 20, 2019, at 4:16 AM, Thomas Gleixner >>> wrote: >>> >>> On Tue, 20 Aug 2019, Peter Zijlstra wrote: >>>> Wh

Re: [PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE

2019-08-20 Thread Song Liu
> On Aug 20, 2019, at 6:57 AM, Dave Hansen wrote: > > On 8/20/19 12:51 AM, Song Liu wrote: >> In our x86_64 kernel, pti_clone_pgtable() fails to clone 7 PMDs because >> of this issuse, including PMD for the irq entry table. For a memcache >> like workload, this intr

Re: [PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE

2019-08-20 Thread Song Liu
> On Aug 20, 2019, at 7:18 AM, Dave Hansen wrote: > > On 8/20/19 7:14 AM, Song Liu wrote: >>> *But*, that shouldn't get hit on a Skylake CPU since those have PCIDs >>> and shouldn't have a global kernel image. Could you confirm whether >>> PC

Re: [PATCH] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE

2019-08-20 Thread Song Liu
> On Aug 20, 2019, at 9:05 AM, Song Liu wrote: > > > >> On Aug 20, 2019, at 7:18 AM, Dave Hansen wrote: >> >> On 8/20/19 7:14 AM, Song Liu wrote: >>>> *But*, that shouldn't get hit on a Skylake CPU since those have PCIDs >>>> a

[PATCH v2] x86/mm/pti: in pti_clone_pgtable(), increase addr properly

2019-08-20 Thread Song Liu
a...@vger.kernel.org # v4.19+ Fixes: 16a3fe634f6a ("x86/mm/pti: Clone kernel-image on PTE level for 32 bit") Reviewed-by: Rik van Riel Signed-off-by: Song Liu Cc: Joerg Roedel Cc: Thomas Gleixner Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra --- arch/x86/mm/pti.c | 4 ++--

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

2020-05-01 Thread Song Liu
lho de 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_e

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

2020-04-29 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
't been 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 W

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

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(&event->count) + atomic64_read(&event->child_count); >> +u64 count; >> + >> +if (likely(event->dup_master != event)) >> +

[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 loc

[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
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): u

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_cac

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

2019-10-17 Thread Song Liu
. 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: only do FOLL_SPLIT_PMD for uprobe register William Kucharski (1): mm: Support removing arbitrary sized pages from mapp

[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-17 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 c

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

2019-10-17 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 co

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

2019-10-18 Thread Song Liu
> On Oct 18, 2019, at 8:41 AM, Rik van Riel wrote: > > On Fri, 2019-10-18 at 16:34 +0300, Kirill A. Shutemov wrote: >> On Thu, Oct 17, 2019 at 10:08:32PM -0700, Song Liu wrote: >>> In collapse_file(), after locking the page, it is necessary to >>> rechec

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

2019-10-18 Thread Song Liu
Signed-off-by: Song Liu --- Changes v1 => v2: Rearrange the checks per feedback from Johannes, Rik, and Kirill. --- mm/khugepaged.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 0a1b4b484ac5..40c549302d36 10

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

2019-10-18 Thread Song Liu
> On Oct 18, 2019, at 9:58 AM, Johannes Weiner wrote: > > On Fri, Oct 18, 2019 at 12:49:46PM -0400, Johannes Weiner wrote: >> On Fri, Oct 18, 2019 at 09:37:54AM -0700, Song Liu wrote: >>> In collapse_file(), after locking the page, it is necessary to recheck >>

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

2019-10-18 Thread Song Liu
Signed-off-by: Song Liu --- Changes v1 => v2: Rearrange the checks per feedback from Johannes, Rik, and Kirill. Changes v2 => v3: Remove redudant checks before trylock_page(). (Johannes) --- mm/khugepaged.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(

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

2019-10-18 Thread Song Liu
> On Oct 18, 2019, at 6:17 PM, Andrew Morton wrote: > > On Fri, 18 Oct 2019 11:03:45 -0700 Song Liu wrote: > >> In collapse_file(), after locking the page, it is necessary to recheck >> that the page is up-to-date. Add PageUptodate() check for both shmem THP >>

Re: [PATCH] trace: fix race in perf_trace_buf initialization

2019-10-21 Thread Song Liu
x27;t > hear anything I'll send it out. > Sorry for the late response. The fix looks good to me. Acked-by: Song Liu

Re: [PATCH v1] md: Convert to use int_pow()

2019-07-26 Thread Song Liu
> On Jul 26, 2019, at 9:48 AM, Andy Shevchenko > wrote: > > On Tue, Jul 23, 2019 at 11:41:55PM +0300, Andy Shevchenko wrote: >> Instead of linear approach to calculate power of 10, use generic int_pow() >> which does it better. > > I took into Cc drivers/dm guys as they might have known some

Re: [PATCH v1] md: Convert to use int_pow()

2019-07-26 Thread Song Liu
On Fri, Jul 26, 2019 at 12:50 PM Andy Shevchenko wrote: > > On Fri, Jul 26, 2019 at 05:18:09PM +, Song Liu wrote: > > > > > > > On Jul 26, 2019, at 9:48 AM, Andy Shevchenko > > > wrote: > > > > > > On Tue, Jul 23, 2019 at 11:41:55PM

Re: [PATCH v8 2/4] uprobe: use original page when all uprobes are removed

2019-07-26 Thread Song Liu
> On Jul 26, 2019, at 1:44 AM, Oleg Nesterov wrote: > > On 07/25, Song Liu wrote: >> >> I guess I know the case now. We can probably avoid this with an simple >> check for old_page == new_page? > > better yet, I think we can check PageAnon(ol

Re: [PATCH v9 4/4] uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT

2019-07-26 Thread Song Liu
> On Jul 26, 2019, at 4:02 PM, Andrew Morton wrote: > > On Thu, 25 Jul 2019 22:46:54 -0700 Song Liu wrote: > >> This patches uses newly added FOLL_SPLIT_PMD in uprobe. This enables easy >> regroup of huge pmd after the uprobe is disabled (in next patch). > >

Re: [PATCH v9 4/4] uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT

2019-07-26 Thread Song Liu
> On Jul 26, 2019, at 4:52 PM, Andrew Morton wrote: > > On Fri, 26 Jul 2019 23:44:34 +0000 Song Liu wrote: > >> >> >>> On Jul 26, 2019, at 4:02 PM, Andrew Morton >>> wrote: >>> >>> On Thu, 25 Jul 2019 22:46:54 -0

Re: [PATCH v9 5/6] mm,thp: add read-only THP support for (non-shmem) FS

2019-07-27 Thread Song Liu
> On Jul 23, 2019, at 4:59 PM, Huang, Kai wrote: > > On Mon, 2019-06-24 at 17:12 -0700, Song Liu wrote: >> This patch is (hopefully) the first step to enable THP for non-shmem >> filesystems. >> >> This patch enables an application to put part of its text se

[PATCH 1/2] khugepaged: enable collapse pmd for pte-mapped THP

2019-07-28 Thread Song Liu
because some subpage of the THP may be replaced, for example by uprobe. In such cases, it is not possible to collapse the pmd. Signed-off-by: Song Liu --- include/linux/khugepaged.h | 15 mm/khugepaged.c| 136 + 2 files changed, 151 insertions

[PATCH 2/2] uprobe: collapse THP pmd after removing all uprobes

2019-07-28 Thread Song Liu
After all uprobes are removed from the huge page (with PTE pgtable), it is possible to collapse the pmd and benefit from THP again. This patch does the collapse by calling khugepaged_add_pte_mapped_thp(). Signed-off-by: Song Liu --- kernel/events/uprobes.c | 9 + 1 file changed, 9

[PATCH 0/2] khugepaged: collapse pmd for pte-mapped THP

2019-07-28 Thread Song Liu
THP. After [2], uprobe only splits the PMD. When the uprobe is disabled, we get pte-mapped THP. After this set, these pte-mapped THP will be collapsed as pmd-mapped. [1] https://lkml.org/lkml/2019/6/23/23 [2] https://www.spinics.net/lists/linux-mm/msg185889.html Song Liu (2): khugepaged: enable

Re: + uprobe-use-original-page-when-all-uprobes-are-removed.patch added to -mm tree

2019-07-29 Thread Song Liu
> On Jul 29, 2019, at 8:05 AM, Oleg Nesterov wrote: > > I didn't see this version, so let me reply here. > > On 07/26, Andrew Morton wrote: >> >> +/* try orig_page only for unregister and anonymous old_page */ >> +if (!is_register && PageAnon(old_page)) { > > Well, this is confusing

Re: [PATCH 5/9] perf, bpf: save bpf_prog_info in a rbtree in perf_env

2019-02-14 Thread Song Liu
> On Feb 14, 2019, at 4:33 AM, Jiri Olsa wrote: > > On Fri, Feb 08, 2019 at 05:17:01PM -0800, Song Liu wrote: >> bpf_prog_info contains information necessary to annotate bpf programs. >> This patch saves bpf_prog_info for bpf programs loaded in the system. >

Re: [PATCH 5/9] perf, bpf: save bpf_prog_info in a rbtree in perf_env

2019-02-14 Thread Song Liu
> On Feb 14, 2019, at 4:26 AM, Jiri Olsa wrote: > > On Fri, Feb 08, 2019 at 05:17:01PM -0800, Song Liu wrote: > > SNIP > >> diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h >> index d01b8355f4ca..5894a177b7cf 100644 >> --- a/tools/perf/util/

[PATCH v2 perf,bpf 00/11] perf annotation of BPF programs

2019-02-14 Thread Song Liu
= This set is also available at: https://github.com/liu-song-6/linux/tree/bpf-annotation Thanks!! Song Liu (11): perf, bpf: consider events with attr.bpf_event as side-band events bpf: libbpf: introduce bpf_program__get_prog_info_

<    1   2   3   4   5   6   7   8   9   10   >