Re: [PATCH] tcp: Export to userspace the TCP state names for the trace events

2017-11-11 Thread Yafang Shao
2017-11-11 3:32 GMT+00:00 Steven Rostedt : > On Sat, 11 Nov 2017 02:06:00 + > Yafang Shao wrote: > >> 2017-11-10 15:07 GMT+00:00 Steven Rostedt : >> > On Fri, 10 Nov 2017 12:56:06 +0800 >> > Yafang Shao wrote: >> > >> >> Could the macro

[PATCH net-next] tcp: add SNMP counter for the number of packets pruned from ofo queue

2018-07-25 Thread Yafang Shao
LINUX_MIB_OFOPRUNEDROP, which could be showed in netstat as OfoPruneDrop. Signed-off-by: Yafang Shao --- include/uapi/linux/snmp.h | 1 + net/ipv4/proc.c | 1 + net/ipv4/tcp_input.c | 1 + 3 files changed, 3 insertions(+) diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h index

Re: [PATCH net-next] tcp: add SNMP counter for the number of packets pruned from ofo queue

2018-07-25 Thread Yafang Shao
On Wed, Jul 25, 2018 at 9:33 PM, Eric Dumazet wrote: > > > On 07/25/2018 06:06 AM, Yafang Shao wrote: >> LINUX_MIB_OFOPRUNED is used to count how many times ofo queue is pruned, >> but sometimes we want to know how many packets are pruned from this queue, >> that

Re: [PATCH net-next] tcp: add SNMP counter for the number of packets pruned from ofo queue

2018-07-25 Thread Yafang Shao
On Wed, Jul 25, 2018 at 9:55 PM, Eric Dumazet wrote: > > > On 07/25/2018 06:40 AM, Yafang Shao wrote: > >> >> Because we want to know why packets were dropped. >> If that could be show in netstat, we could easily find that it is >> dropped due to ofo prune.

[PATCH] mm: avoid bothering interrupted task when charge memcg in softirq

2018-07-14 Thread Yafang Shao
arge failes. Signed-off-by: Yafang Shao --- mm/memcontrol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 68ef266..13f95db 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2123,6 +2123,9 @@ static int try_charge(struct mem_cgroup *me

Re: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq

2018-07-14 Thread Yafang Shao
On Sat, Jul 14, 2018 at 11:38 PM, Shakeel Butt wrote: > On Sat, Jul 14, 2018 at 1:32 AM Yafang Shao wrote: >> >> try_charge maybe executed in packet receive path, which is in interrupt >> context. >> In this situation, the 'current' is the interrupted task, w

Re: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq

2018-07-14 Thread Yafang Shao
On Sun, Jul 15, 2018 at 10:10 AM, Yafang Shao wrote: > On Sat, Jul 14, 2018 at 11:38 PM, Shakeel Butt wrote: >> On Sat, Jul 14, 2018 at 1:32 AM Yafang Shao wrote: >>> >>> try_charge maybe executed in packet receive path, which is in interrupt >>> context. >

Re: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq

2018-07-14 Thread Yafang Shao
On Sun, Jul 15, 2018 at 12:25 PM, Shakeel Butt wrote: > On Sat, Jul 14, 2018 at 7:10 PM Yafang Shao wrote: >> >> On Sat, Jul 14, 2018 at 11:38 PM, Shakeel Butt wrote: >> > On Sat, Jul 14, 2018 at 1:32 AM Yafang Shao wrote: >> >> >> >> try_charge

Re: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq

2018-07-15 Thread Yafang Shao
On Sun, Jul 15, 2018 at 2:34 PM, Shakeel Butt wrote: > On Sat, Jul 14, 2018 at 10:26 PM Yafang Shao wrote: >> >> On Sun, Jul 15, 2018 at 12:25 PM, Shakeel Butt wrote: >> > On Sat, Jul 14, 2018 at 7:10 PM Yafang Shao wrote: >> >> >> >>

Re: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq

2018-07-15 Thread Yafang Shao
On Sun, Jul 15, 2018 at 11:04 PM, Shakeel Butt wrote: > On Sun, Jul 15, 2018 at 1:02 AM Yafang Shao wrote: >> >> On Sun, Jul 15, 2018 at 2:34 PM, Shakeel Butt wrote: >> > On Sat, Jul 14, 2018 at 10:26 PM Yafang Shao wrote: >> >> >> >>

Re: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq

2018-07-15 Thread Yafang Shao
On Mon, Jul 16, 2018 at 11:09 AM, Shakeel Butt wrote: > On Sun, Jul 15, 2018 at 6:50 PM Yafang Shao wrote: >> >> On Sun, Jul 15, 2018 at 11:04 PM, Shakeel Butt wrote: >> > On Sun, Jul 15, 2018 at 1:02 AM Yafang Shao wrote: >> >> >> >> On S

[PATCH bpf-next] cgroup: support attaching eBPF programs to net_prio cgroup

2018-01-25 Thread Yafang Shao
If net_prio is used, we could also use eBPF programs to attach it, because the net_prio cgroup could be got with prioidx in struct sock_cgroup_data. Hence it should not only be limited to cgroup2. Signed-off-by: Yafang Shao --- include/linux/cgroup.h | 18 -- kernel/cgroup

[PATCH bpf-next] cgroup: support attaching eBPF programs to net_prio cgroup

2018-01-25 Thread Yafang Shao
If net_prio is used, we could also use eBPF programs to attach it, because the net_prio cgroup could be got with prioidx in struct sock_cgroup_data. Hence it should not only be limited to cgroup2. Signed-off-by: Yafang Shao --- include/linux/cgroup.h | 16 +++- kernel/cgroup

Re: [PATCH bpf-next] cgroup: support attaching eBPF programs to net_prio cgroup

2018-01-25 Thread Yafang Shao
On Thu, Jan 25, 2018 at 11:50 PM, Tejun Heo wrote: > On Thu, Jan 25, 2018 at 11:38:48PM +0800, Yafang Shao wrote: >> If net_prio is used, we could also use eBPF programs to attach it, >> because the net_prio cgroup could be got with prioidx in struct >> sock_cgroup_data. &

[PATCH net-next] net: tracepoint: adding new tracepoint arguments in inet_sock_set_state

2018-01-04 Thread Yafang Shao
sk->sk_protocol and sk->sk_family are exposed as tracepoint arguments. Then we can conveniently use these two arguments to do the filter. Suggested-by: Brendan Gregg Signed-off-by: Yafang Shao --- include/trace/events/sock.h | 24 ++-- net/ipv4/af_inet.c

Re: [PATCH net-next] net: tracepoint: adding new tracepoint arguments in inet_sock_set_state

2018-01-05 Thread Yafang Shao
On Fri, Jan 5, 2018 at 3:21 PM, Song Liu wrote: > >> On Jan 4, 2018, at 10:42 PM, Yafang Shao wrote: >> >> sk->sk_protocol and sk->sk_family are exposed as tracepoint arguments. >> Then we can conveniently use these two arguments to do the filter. >> >&g

Re: [PATCH net-next] net: tracepoint: adding new tracepoint arguments in inet_sock_set_state

2018-01-06 Thread Yafang Shao
On Sun, Jan 7, 2018 at 1:46 AM, Song Liu wrote: > >> On Jan 5, 2018, at 12:09 AM, Yafang Shao wrote: >> >> On Fri, Jan 5, 2018 at 3:21 PM, Song Liu wrote: >>> >>>> On Jan 4, 2018, at 10:42 PM, Yafang Shao wrote: >>>> >>>> sk-

[PATCH v2 net-next] net: tracepoint: exposing sk_faimily in tracepoint inet_sock_set_state

2018-01-06 Thread Yafang Shao
em as tracepoint arguments. Suggested-by: Brendan Gregg Suggested-by: Song Liu Signed-off-by: Yafang Shao --- include/trace/events/sock.h | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h index 3537c5f..31

Re: [PATCH] procfs: fix the output format in /proc/PID/wchan

2018-11-23 Thread Yafang Shao
On Thu, Nov 22, 2018 at 9:38 PM Alexey Dobriyan wrote: > > On Thu, Nov 22, 2018 at 09:29:52PM +0800, Yafang Shao wrote: > > On Thu, Nov 22, 2018 at 7:40 PM Alexey Dobriyan wrote: > > > > > > On Wed, Nov 21, 2018 at 07:28:44PM -0800, Andrew Morton wrote: > > &g

[PATCH] arch/x86/kernel/process.c: avoid unnecessary NULL check in get_wchan

2018-11-21 Thread Yafang Shao
Because the task p is always guaranteed to be non-NULL. Signed-off-by: Yafang Shao --- arch/x86/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index c93fcfd..3c3ee89 100644 --- a/arch/x86/kernel

Re: [PATCH] procfs: fix the output format in /proc/PID/wchan

2018-11-22 Thread Yafang Shao
On Thu, Nov 22, 2018 at 7:40 PM Alexey Dobriyan wrote: > > On Wed, Nov 21, 2018 at 07:28:44PM -0800, Andrew Morton wrote: > > On Mon, 19 Nov 2018 19:17:52 +0800 Yafang Shao wrote: > > > > > Just add the missing newline. > > > > > > ... > > >

[PATCH] mm/filemap.c: minor optimization in write_iter file operation

2018-11-18 Thread Yafang Shao
This little adjustment on bitwise operation could make the code a little faster. As write_iter is used in lots of critical path, so this code change is useful for performance. Signed-off-by: Yafang Shao --- mm/filemap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm

Re: [PATCH] mm/filemap.c: minor optimization in write_iter file operation

2018-11-18 Thread Yafang Shao
On Sun, Nov 18, 2018 at 8:13 PM Matthew Wilcox wrote: > > On Sun, Nov 18, 2018 at 08:02:18PM +0800, Yafang Shao wrote: > > This little adjustment on bitwise operation could make the code a little > > faster. > > As write_iter is used in lots of critical path, so this code

[PATCH] procfs: fix the output format in /proc/PID/wchan

2018-11-19 Thread Yafang Shao
Just add the missing newline. Signed-off-by: Yafang Shao --- fs/proc/base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index ce34654..d7f49fb 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -370,11 +370,12 @@ static int

[PATCH net-next] tcp: use data length instead of skb->len in tcp_probe

2018-05-24 Thread Yafang Shao
skb->len is meaningless to user. data length could be more helpful, with which we can easily filter out the packet without payload. Signed-off-by: Yafang Shao --- include/trace/events/tcp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/trace/events/tcp.

[PATCH v2 net-next] tcp: use data length instead of skb->len in tcp_probe

2018-05-25 Thread Yafang Shao
skb->len is meaningless to user. data length could be more helpful, with which we can easily filter out the packet without payload. Signed-off-by: Yafang Shao --- include/trace/events/tcp.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/trace/events/tcp.

Re: [PATCH net-next] bpfilter: fix a build err

2018-05-26 Thread Yafang Shao
On Sat, May 26, 2018 at 10:25 AM, YueHaibing wrote: > On 2018/5/26 0:19, Alexei Starovoitov wrote: >> On Fri, May 25, 2018 at 06:17:57PM +0800, YueHaibing wrote: >>> gcc-7.3.0 report following err: >>> >>> HOSTCC net/bpfilter/main.o >>> In file included from net/bpfilter/main.c:9:0: >>> ./inclu

Re: [PATCH 4/5] netfilter: fix missed NULL check in nf_conntrack_proto_pernet_init()

2018-12-13 Thread Yafang Shao
On Thu, Dec 13, 2018 at 7:26 AM Pablo Neira Ayuso wrote: > > On Wed, Dec 05, 2018 at 08:56:29PM +0800, Yafang Shao wrote: > > nf_ct_l4proto_net() may return NULL. > > That may happens if some module forget to set both l4proto->get_net_proto > > and l4proto->net_id. &

[PATCH net-next] tcp: minor optimization for calculating packets_out in tcp connect

2018-12-15 Thread Yafang Shao
ve us a little improvement. Signed-off-by: Yafang Shao --- net/ipv4/tcp_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 730bc44..12bb5e7 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -

[PATCH] proc: sysctl: fix double drop_sysctl_table()

2018-12-21 Thread Yafang Shao
The callers of insert_header() will drop sysctl table whatever insert_header() successes or fails. So we can't call drop_sysctl_table() in insert_header(). The call sites of insert_header() are all in fs/proc/proc_sysctl.c. Signed-off-by: Yafang Shao --- fs/proc/proc_sysctl.c | 1 - 1

Re: [PATCH] proc: sysctl: fix double drop_sysctl_table()

2018-12-22 Thread Yafang Shao
On Sat, Dec 22, 2018 at 11:17 AM Al Viro wrote: > > On Sat, Dec 22, 2018 at 10:12:21AM +0800, Yafang Shao wrote: > > The callers of insert_header() will drop sysctl table whatever > > insert_header() successes or fails. > > So we can't call drop_sysctl_table() in inse

Re: [PATCH] mm: avoid bothering interrupted task when charge memcg in softirq

2018-07-16 Thread Yafang Shao
On Mon, Jul 16, 2018 at 3:58 PM, Michal Hocko wrote: > On Sat 14-07-18 16:32:02, Yafang Shao wrote: >> try_charge maybe executed in packet receive path, which is in interrupt >> context. >> In this situation, the 'current' is the interrupted task, which may has &

[PATCH v5 3/3] vsprintf: dump full information of page flags in pGp

2021-02-15 Thread Yafang Shao
f) The documentation and test cases are also updated. The output of the test cases as follows, [11585.830272] test_printf: loaded. [11585.830454] test_printf: all 388 tests passed [11585.831401] test_printf: unloaded. Signed-off-by: Yafang Shao Cc: David Hildenbrand Cc: Joe Perches Cc: Miaohe

[PATCH v5 1/3] mm, slub: use pGp to print page flags

2021-02-15 Thread Yafang Shao
ut is, [ 8846.517809] INFO: Slab 0xf42a2c60 objects=33 used=3 fp=0x60d32ca8 flags=0x17c0010200(slab|head) Signed-off-by: Yafang Shao Reviewed-by: David Hildenbrand Reviewed-by: Vlastimil Babka Acked-by: David Rientjes Acked-by: Christoph Lameter Reviewed-by: Matthew Wilcox (Oracle) Rev

[PATCH v5 0/3] mm, vsprintf: dump full information of page flags in pGp

2021-02-15 Thread Yafang Shao
x of it, per Joe and Matthew - introduce new format instead of changing pGp, per Andy v2: - various coding improvement, per Joe, Miaohe, Vlastimil and Andy - remove the prefix completely in patch #2, per Vlastimil - Update the test cases, per Andy Yafang Shao (3): mm, slub: use pGp to print p

[PATCH v5 2/3] mm, slub: don't combine pr_err with INFO

2021-02-15 Thread Yafang Shao
(slab|head) - after the patch [ 6343.396602] Slab 0x4382e02b objects=33 used=3 fp=0x9ae06ffc flags=0x17c0010200(slab|head) [1]. https://lore.kernel.org/linux-mm/b9c0f2b6-e9b0-0c36-ebdd-2bc684c5a...@redhat.com/#t Suggested-by: Vlastimil Babka Signed-off-by: Yafang Shao Acked-by

[PATCH v3 net-next 1/2] tcp: use data length instead of skb->len in tcp_probe

2018-05-28 Thread Yafang Shao
At this point skb->len is including tcp header length, so it is meaningless to user. data length could be more helpful, with which we can easily filter out the packet without payload. Cc: Eric Dumazet Acked-by: Song Liu Signed-off-by: Yafang Shao --- v3: tcp_hdr() is a little expensive t

[PATCH v3 net-next 2/2] tcp: minor optimization around tcp_hdr() usage in tcp receive path

2018-05-28 Thread Yafang Shao
This is additional to the commit ea1627c20c34 ("tcp: minor optimizations around tcp_hdr() usage"). At this point, skb->data is same with tcp_hdr() as tcp header has not been pulled yet. Cc: Eric Dumazet Signed-off-by: Yafang Shao --- net/ipv4/tcp_ipv4.c | 2 +- net/ipv6/tcp_ipv

Re: [PATCH v3 net-next 2/2] tcp: minor optimization around tcp_hdr() usage in tcp receive path

2018-05-28 Thread Yafang Shao
On Tue, May 29, 2018 at 12:36 AM, Eric Dumazet wrote: > On Mon, May 28, 2018 at 8:36 AM Yafang Shao wrote: > >> This is additional to the commit ea1627c20c34 ("tcp: minor optimizations > around tcp_hdr() usage"). >> At this point, skb->data is same with tcp_h

Re: [PATCH v2 net-next] tcp: use data length instead of skb->len in tcp_probe

2018-05-29 Thread Yafang Shao
On Tue, May 29, 2018 at 10:42 PM, Eric Dumazet wrote: > > > On 05/29/2018 07:36 AM, Yafang Shao wrote: >> On Tue, May 29, 2018 at 10:15 PM, David Miller wrote: >>> From: Yafang Shao >>> Date: Fri, 25 May 2018 18:14:05 +0800 >>> >>>> skb-

[PATCH] mm: vmscan: drop may_writepage and classzone_idx from direct reclaim begin template

2019-02-28 Thread Yafang Shao
drop them all. Signed-off-by: Yafang Shao --- include/trace/events/vmscan.h | 26 ++ mm/vmscan.c | 14 +++--- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index a1

[PATCH v2] mm: vmscan: add tracepoints for node reclaim

2019-02-28 Thread Yafang Shao
: Yafang Shao --- include/trace/events/vmscan.h | 32 mm/vmscan.c | 6 ++ 2 files changed, 38 insertions(+) diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index a1cb913..c1ddf28 100644 --- a/include/trace/events

[PATCH] mm: vmscan: show zone type in kswapd tracepoints

2019-02-28 Thread Yafang Shao
If we want to know the zone type, we have to check whether CONFIG_ZONE_DMA, CONFIG_ZONE_DMA32 and CONFIG_HIGHMEM are set or not, that's not so convenient. We'd better show the zone type directly. Signed-off-by: Yafang Shao --- include/trace/events/vmscan.h | 9 ++--- 1 file

[PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint

2019-03-01 Thread Yafang Shao
show the gfp flag names instead of the gfp_mask could make the trace more convenient. Signed-off-by: Yafang Shao --- include/trace/events/compaction.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h

[PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set

2019-03-01 Thread Yafang Shao
Only mm_compaction_isolate_{free, migrate}pages may be used when CONFIG_COMPACTION is not set. All others are used only when CONFIG_COMPACTION is set. Signed-off-by: Yafang Shao --- include/trace/events/compaction.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a

Re: [PATCH] mm: vmscan: show zone type in kswapd tracepoints

2019-03-12 Thread Yafang Shao
On Mon, Mar 11, 2019 at 4:47 PM Michal Hocko wrote: > > On Fri 01-03-19 15:38:54, Yafang Shao wrote: > > If we want to know the zone type, we have to check whether > > CONFIG_ZONE_DMA, CONFIG_ZONE_DMA32 and CONFIG_HIGHMEM are set or not, > > that's not so convenient.

Re: [PATCH] mm: vmscan: show zone type in kswapd tracepoints

2019-03-12 Thread Yafang Shao
On Tue, Mar 12, 2019 at 9:38 PM Michal Hocko wrote: > > On Tue 12-03-19 19:04:43, Yafang Shao wrote: > > On Mon, Mar 11, 2019 at 4:47 PM Michal Hocko wrote: > > > > > > On Fri 01-03-19 15:38:54, Yafang Shao wrote: > > > > If we want to kn

Re: [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set

2019-03-12 Thread Yafang Shao
On Wed, Mar 13, 2019 at 12:18 AM Michal Hocko wrote: > > On Sat 02-03-19 12:38:58, Yafang Shao wrote: > > Only mm_compaction_isolate_{free, migrate}pages may be used when > > CONFIG_COMPACTION is not set. > > All others are used only when CONFIG_COMPACTION is set. > &

Re: [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set

2019-03-12 Thread Yafang Shao
On Wed, Mar 13, 2019 at 12:44 AM Michal Hocko wrote: > > On Wed 13-03-19 00:29:57, Yafang Shao wrote: > > On Wed, Mar 13, 2019 at 12:18 AM Michal Hocko wrote: > > > > > > On Sat 02-03-19 12:38:58, Yafang Shao wrote: > > > > Only mm_compaction_iso

Re: [PATCH] mm: vmscan: drop may_writepage and classzone_idx from direct reclaim begin template

2019-03-14 Thread Yafang Shao
On Fri, Mar 1, 2019 at 2:24 PM Yafang Shao wrote: > > There are three tracepoints using this template, which are > mm_vmscan_direct_reclaim_begin, > mm_vmscan_memcg_reclaim_begin, > mm_vmscan_memcg_softlimit_reclaim_begin. > > Regarding mm_vmscan_direct_reclaim_begin,

Re: [PATCH] mm: vmscan: drop may_writepage and classzone_idx from direct reclaim begin template

2019-03-14 Thread Yafang Shao
On Thu, Mar 14, 2019 at 6:19 PM Michal Hocko wrote: > > On Fri 01-03-19 14:24:12, Yafang Shao wrote: > > There are three tracepoints using this template, which are > > mm_vmscan_direct_reclaim_begin, > > mm_vmscan_memcg_reclaim_begin, > > mm_vmscan_memcg_softlimit_re

[PATCH] sched: fair: fix error statement in check_schedstat_required()

2019-03-15 Thread Yafang Shao
remove the statement about sched_stat_runtime in check_schedstat_required(). Some other minor changes in this patch, - stat_wait is missed in the print log before. - CONFIG_SCHEDSTATS is unnecessary as schedstat_enabled() is used. Signed-off-by: Yafang Shao --- kernel/sched/fair.c | 7 ++---

[PATCH v2 3/3] rcu: validate arguments for rcu tracepoints

2019-03-26 Thread Yafang Shao
When CONFIG_RCU_TRACE is not set, all these tracepoints are defined as do-nothing macro. We'd better make those inline functions that take proper arguments. As RCU_TRACE() is defined as do-nothing marco as well when CONFIG_RCU_TRACE is not set, so we can clean it up. Signed-off-by: Yafang

[PATCH v2 2/3] sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set

2019-03-26 Thread Yafang Shao
The tracepoints trace_sched_stat_{iowait, blocked, wait, sleep} should be not exposed to user if CONFIG_SCHEDSTATS is not set. Signed-off-by: Yafang Shao --- include/trace/events/sched.h | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/include/trace

[PATCH v2 1/3] tracing: introduce TRACE_EVENT_NOP()

2019-03-26 Thread Yafang Shao
Sometimes we want to define a tracepoint as a do-nothing function. So I introduce TRACE_EVENT_NOP, DECLARE_EVENT_CLASS_NOP and DEFINE_EVENT_NOP for this kind of usage. Signed-off-by: Yafang Shao --- include/linux/tracepoint.h | 15 +++ include/trace/define_trace.h | 8 2

[PATCH v2 0/3] tracing: introduce TRACE_EVENT_NOP and use it

2019-03-26 Thread Yafang Shao
ating arguments, that is not proper. We should validate the arguments. Yafang Shao (3): tracing: introduce TRACE_EVENT_NOP() sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set rcu: validate arguments for rcu tracepoints include/linux/tracepoint.h

Re: [PATCH v2 3/3] rcu: validate arguments for rcu tracepoints

2019-03-26 Thread Yafang Shao
On Tue, Mar 26, 2019 at 11:30 PM Steven Rostedt wrote: > > On Tue, 26 Mar 2019 08:18:15 -0700 > "Paul E. McKenney" wrote: > > > On Tue, Mar 26, 2019 at 08:13:11PM +0800, Yafang Shao wrote: > > > When CONFIG_RCU_TRACE is not set, all these tracepoints

Re: [PATCH v5 3/3] vsprintf: dump full information of page flags in pGp

2021-02-22 Thread Yafang Shao
On Mon, Feb 22, 2021 at 8:38 PM Petr Mladek wrote: > > Hello, > > first, I am sorry for the late reply. I have marked the thread as > proceed by mistake last week... > > > On Mon 2021-02-15 23:51:41, Yafang Shao wrote: > > Currently the pGp only shows the names of p

[PATCH 1/1] vsprintf: dump full information of page flags in pGp fix

2021-02-22 Thread Yafang Shao
e flags in pGp" [1] [1]. https://lore.kernel.org/linux-mm/20210215155141.47432-1-laoar.s...@gmail.com/ Signed-off-by: Yafang Shao Cc: Petr Mladek Cc: Matthew Wilcox Cc: Andy Shevchenko Cc: Vlastimil Babka Cc: Miaohe Lin Cc: Joe Perches Cc: David Hildenbrand --- lib/vsprintf.c | 2 +-

Re: [PATCH v4 3/3] vsprintf: dump full information of page flags in pGp

2021-02-10 Thread Yafang Shao
On Wed, Feb 10, 2021 at 8:51 PM Petr Mladek wrote: > > On Wed 2021-02-10 00:21:37, Yafang Shao wrote: > > On Tue, Feb 9, 2021 at 9:53 PM Petr Mladek wrote: > > > > > > On Tue 2021-02-09 18:56:13, Yafang Shao wrote: > > > > Currently the pGp only

Re: [PATCH 3/3] printk: dump full information of page flags in pGp

2021-01-28 Thread Yafang Shao
On Thu, Jan 28, 2021 at 10:50 PM Andy Shevchenko wrote: > > On Thu, Jan 28, 2021 at 09:18:24PM +0800, Yafang Shao wrote: > > On Thu, Jan 28, 2021 at 8:11 PM Andy Shevchenko > > wrote: > > ... > > > Thanks for the explanation. > > I will change it as you s

[PATCH v2 0/3] mm, vsprintf: dump full information of page flags in pGp

2021-02-01 Thread Yafang Shao
est_printf: unloaded. v2: - various coding improvement, per Joe, Miaohe, Vlastimil and Andy - remove the prefix completely in patch #2, per Vlastimil - Update the test cases, per Andy Yafang Shao (3): mm, slub: use pGp to print page flags mm, slub: don't combine pr_err with INFO vspr

[PATCH v2 1/3] mm, slub: use pGp to print page flags

2021-02-01 Thread Yafang Shao
ut is, [ 8846.517809] INFO: Slab 0xf42a2c60 objects=33 used=3 fp=0x60d32ca8 flags=0x17c0010200(slab|head) Reviewed-by: David Hildenbrand Reviewed-by: Vlastimil Babka Acked-by: David Rientjes Signed-off-by: Yafang Shao --- mm/slub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 dele

[PATCH v2 3/3] vsprintf: dump full information of page flags in pGp

2021-02-01 Thread Yafang Shao
tation and test cases are also updated. Cc: David Hildenbrand Cc: Joe Perches Cc: Miaohe Lin Cc: Vlastimil Babka Cc: Andy Shevchenko Signed-off-by: Yafang Shao --- Documentation/core-api/printk-formats.rst | 2 +- lib/test_printf.c | 65 ++- lib/

[PATCH v2 2/3] mm, slub: don't combine pr_err with INFO

2021-02-01 Thread Yafang Shao
(slab|head) - after the patch [ 6343.396602] Slab 0x4382e02b objects=33 used=3 fp=0x9ae06ffc flags=0x17c0010200(slab|head) [1]. https://lore.kernel.org/linux-mm/b9c0f2b6-e9b0-0c36-ebdd-2bc684c5a...@redhat.com/#t Suggested-by: Vlastimil Babka Cc: David Hildenbrand Signed-off-b

Re: [PATCH v2 3/3] vsprintf: dump full information of page flags in pGp

2021-02-01 Thread Yafang Shao
On Mon, Feb 1, 2021 at 9:05 PM Joe Perches wrote: > > On Mon, 2021-02-01 at 19:56 +0800, Yafang Shao wrote: > > Currently the pGp only shows the names of page flags, rather than > > the full information including section, node, zone, last cpupid and > > kasan tag. While

Re: [PATCH v2 3/3] vsprintf: dump full information of page flags in pGp

2021-02-01 Thread Yafang Shao
On Mon, Feb 1, 2021 at 9:27 PM Andy Shevchenko wrote: > > On Mon, Feb 01, 2021 at 07:56:10PM +0800, Yafang Shao wrote: > > Currently the pGp only shows the names of page flags, rather than > > the full information including section, node, zone, last cpupid and > > kasan t

Re: [PATCH v2 3/3] vsprintf: dump full information of page flags in pGp

2021-02-01 Thread Yafang Shao
On Mon, Feb 1, 2021 at 9:34 PM Andy Shevchenko wrote: > > On Mon, Feb 01, 2021 at 02:23:33PM +0100, David Hildenbrand wrote: > > On 01.02.21 12:56, Yafang Shao wrote: > > > Currently the pGp only shows the names of page flags, rather than > > > the full information

Re: [PATCH v2 3/3] vsprintf: dump full information of page flags in pGp

2021-02-01 Thread Yafang Shao
On Mon, Feb 1, 2021 at 10:15 PM Matthew Wilcox wrote: > > On Mon, Feb 01, 2021 at 07:56:10PM +0800, Yafang Shao wrote: > > - Before the patch, > > [ 6343.396602] Slab 0x4382e02b objects=33 used=3 > > fp=0x9ae06ffc flags=0x17c0010200(slab|head) &

Re: [PATCH v2 3/3] vsprintf: dump full information of page flags in pGp

2021-02-02 Thread Yafang Shao
On Tue, Feb 2, 2021 at 12:16 AM Andy Shevchenko wrote: > > On Mon, Feb 01, 2021 at 09:49:59PM +0800, Yafang Shao wrote: > > On Mon, Feb 1, 2021 at 9:27 PM Andy Shevchenko > > wrote: > > > On Mon, Feb 01, 2021 at 07:56:10PM +0800, Yafang Shao wrote: > >

[PATCH v4 0/3] mm, vsprintf: dump full information of page flags in pGp

2021-02-09 Thread Yafang Shao
anging pGp, per Andy v2: - various coding improvement, per Joe, Miaohe, Vlastimil and Andy - remove the prefix completely in patch #2, per Vlastimil - Update the test cases, per Andy Yafang Shao (3): mm, slub: use pGp to print page flags mm, slub: don't combine pr_err with INFO vsprin

[PATCH v4 1/3] mm, slub: use pGp to print page flags

2021-02-09 Thread Yafang Shao
ut is, [ 8846.517809] INFO: Slab 0xf42a2c60 objects=33 used=3 fp=0x60d32ca8 flags=0x17c0010200(slab|head) Signed-off-by: Yafang Shao Reviewed-by: David Hildenbrand Reviewed-by: Vlastimil Babka Acked-by: David Rientjes Acked-by: Christoph Lameter Reviewed-by: Matthew Wilcox (Oracle) Rev

[PATCH v4 2/3] mm, slub: don't combine pr_err with INFO

2021-02-09 Thread Yafang Shao
(slab|head) - after the patch [ 6343.396602] Slab 0x4382e02b objects=33 used=3 fp=0x9ae06ffc flags=0x17c0010200(slab|head) [1]. https://lore.kernel.org/linux-mm/b9c0f2b6-e9b0-0c36-ebdd-2bc684c5a...@redhat.com/#t Suggested-by: Vlastimil Babka Signed-off-by: Yafang Shao Acked-by

[PATCH v4 3/3] vsprintf: dump full information of page flags in pGp

2021-02-09 Thread Yafang Shao
f) The documentation and test cases are also updated. The output of the test cases as follows, [ 501.485081] test_printf: loaded. [ 501.485768] test_printf: all 388 tests passed [ 501.488762] test_printf: unloaded. Signed-off-by: Yafang Shao Cc: David Hildenbrand Cc: Joe Perches Cc: Miaohe

Re: [PATCH v4 3/3] vsprintf: dump full information of page flags in pGp

2021-02-09 Thread Yafang Shao
On Tue, Feb 9, 2021 at 9:53 PM Petr Mladek wrote: > > On Tue 2021-02-09 18:56:13, Yafang Shao wrote: > > Currently the pGp only shows the names of page flags, rather than > > the full information including section, node, zone, last cpupid and > > kasan tag. While it is

Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page

2020-05-20 Thread Yafang Shao
On Thu, May 21, 2020 at 2:00 AM Naresh Kamboju wrote: > > On Wed, 20 May 2020 at 17:26, Naresh Kamboju > wrote: > > > > > > This issue is specific on 32-bit architectures i386 and arm on linux-next > > tree. > > As per the test results history this problem started happening from > > Bad : next-

Re: mm: mkfs.ext4 invoked oom-killer on i386 - pagecache_get_page

2020-05-21 Thread Yafang Shao
On Thu, May 21, 2020 at 4:59 PM Naresh Kamboju wrote: > > On Thu, 21 May 2020 at 08:10, Yafang Shao wrote: > > > > On Thu, May 21, 2020 at 2:00 AM Naresh Kamboju > > wrote: > > > > > > On Wed, 20 May 2020 at 17:26, Naresh Kamboju > > > wrote

[PATCH v6 resend 0/3] mm, vsprintf: dump full information of page flags in pGp

2021-03-19 Thread Yafang Shao
the test cases, per Andy Yafang Shao (3): mm, slub: use pGp to print page flags mm, slub: don't combine pr_err with INFO vsprintf: dump full information of page flags in pGp Documentation/core-api/printk-formats.rst | 2 +- lib/test_printf.c | 90 ++

[PATCH v6 resend 3/3] vsprintf: dump full information of page flags in pGp

2021-03-19 Thread Yafang Shao
f) The documentation and test cases are also updated. The output of the test cases as follows, [68599.816764] test_printf: loaded. [68599.819068] test_printf: all 388 tests passed [68599.830367] test_printf: unloaded. [l...@intel.com: reported issues in the prev version in test_printf.c] Signe

[PATCH v6 resend 2/3] mm, slub: don't combine pr_err with INFO

2021-03-19 Thread Yafang Shao
(slab|head) - after the patch [ 6343.396602] Slab 0x4382e02b objects=33 used=3 fp=0x9ae06ffc flags=0x17c0010200(slab|head) [1]. https://lore.kernel.org/linux-mm/b9c0f2b6-e9b0-0c36-ebdd-2bc684c5a...@redhat.com/#t Suggested-by: Vlastimil Babka Signed-off-by: Yafang Shao Acked-by

[PATCH v6 resend 1/3] mm, slub: use pGp to print page flags

2021-03-19 Thread Yafang Shao
ut is, [ 8846.517809] INFO: Slab 0xf42a2c60 objects=33 used=3 fp=0x60d32ca8 flags=0x17c0010200(slab|head) Signed-off-by: Yafang Shao Reviewed-by: David Hildenbrand Reviewed-by: Vlastimil Babka Acked-by: David Rientjes Acked-by: Christoph Lameter Reviewed-by: Matthew Wilcox (Oracle) Rev

Re: [PATCH v6 resend 0/3] mm, vsprintf: dump full information of page flags in pGp

2021-03-19 Thread Yafang Shao
On Fri, Mar 19, 2021 at 6:13 PM Yafang Shao wrote: > > The existed pGp shows the names of page flags only, rather than the full > information including section, node, zone, last cpuipid and kasan tag. > While it is not easy to parse these information manually because there > are

[PATCH v2 0/6] sched: support schedstats for RT sched class

2021-03-27 Thread Yafang Shao
Mel. - make struct schedstats independent of fair sched class Yafang Shao (6): sched, fair: use __schedstat_set() in set_next_entity() sched: make struct sched_statistics independent of fair sched class sched: make schedstats helpers independent of fair sched class sched: introduce task block t

[PATCH v2 1/6] sched, fair: use __schedstat_set() in set_next_entity()

2021-03-27 Thread Yafang Shao
schedstat_enabled() has been already checked, so we can use __schedstat_set() directly. Signed-off-by: Yafang Shao Acked-by: Mel Gorman --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index aaa0dfa29d53

[PATCH v2 2/6] sched: make struct sched_statistics independent of fair sched class

2021-03-27 Thread Yafang Shao
6.0~6.1 kernel.sched_schedstats=1 6.2~6.46.2~6.4 No obvious impact on the sched performance. No functional change. [l...@intel.com: reported build failure in prev version] Signed-off-by: Yafang Shao Acked-by: Mel Gorman Cc: kernel test robot --- include/lin

[PATCH v2 3/6] sched: make schedstats helpers independent of fair sched class

2021-03-27 Thread Yafang Shao
re in prev version] Signed-off-by: Yafang Shao Acked-by: Mel Gorman Cc: kernel test robot --- kernel/sched/fair.c | 133 +++ kernel/sched/stats.c | 103 + kernel/sched/stats.h | 34 +++ 3 files changed, 156 insertio

[PATCH v2 4/6] sched: introduce task block time in schedstats

2021-03-27 Thread Yafang Shao
it is more critital than S state. So it is worth to add a metric to measure it. Signed-off-by: Yafang Shao --- include/linux/sched.h | 2 ++ kernel/sched/debug.c | 6 -- kernel/sched/stats.c | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/sched.h b/in

[PATCH v2 5/6] sched, rt: support sched_stat_runtime tracepoint for RT sched class

2021-03-27 Thread Yafang Shao
48[039] d.h. 113.521352: sched_stat_runtime: comm=stress pid=9748 runtime=998203 [ns] vruntime=0 [ns] Signed-off-by: Yafang Shao --- kernel/sched/rt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 34ad07fb924e..ae5282484710 100644 --- a/ke

[PATCH v2 6/6] sched, rt: support schedstats for RT sched class

2021-03-27 Thread Yafang Shao
elay=1001238954 [ns] [ In sleep.sh, it sleeps 1 sec each time. ] [l...@intel.com: reported build failure in prev version] Signed-off-by: Yafang Shao Cc: kernel test robot --- kernel/sched/rt.c | 137 ++ 1 file changed, 137 insertions(+) diff --g

[PATCH] delayacct: clear right task's flag after blkio completes

2021-04-14 Thread Yafang Shao
helpers, after that change, the callsite will specifilly set the right task, which should make it less error prone. Signed-off-by: Yafang Shao Cc: Tejun Heo Cc: Josh Snyder --- include/linux/delayacct.h | 20 ++-- mm/memory.c | 8 2 files changed, 14 ins

Re: [PATCH v2 0/6] sched: support schedstats for RT sched class

2021-04-06 Thread Yafang Shao
On Sat, Mar 27, 2021 at 6:13 PM Yafang Shao wrote: > > We want to measure the latency of RT tasks in our production > environment with schedstats facility, but currently schedstats is only > supported for fair sched class. In order to support if for other sched > classes, we

Re: [PATCH v5 3/3] vsprintf: dump full information of page flags in pGp

2021-02-22 Thread Yafang Shao
On Mon, Feb 15, 2021 at 11:53 PM Yafang Shao wrote: > > Currently the pGp only shows the names of page flags, rather than > the full information including section, node, zone, last cpupid and > kasan tag. While it is not easy to parse these information manually > because there

[RFC PATCH 1/4] sched: define task_of() as a common helper

2020-11-18 Thread Yafang Shao
task_of() is used to get task_struct from sched_entity. As sched_entity in struct task_struct can be used by all sched class, we'd better move this macro into sched.h, then it can be used by all sched class. Signed-off-by: Yafang Shao --- kernel/sched/fair.c | 11 --- kernel/

[RFC PATCH 0/4] sched: support schedstat for RT sched class

2020-11-18 Thread Yafang Shao
trace RT tasks as well after that patchset. PATCH #1 ~ #3 are the preparation of PATCH #4. Yafang Shao (4): sched: define task_of() as a common helper sched: make schedstats helpers not depend on cfs_rq sched: define update_stats_curr_start() as a common helper sched, rt: support schedstat

[RFC PATCH 2/4] sched: make schedstats helpers not depend on cfs_rq

2020-11-18 Thread Yafang Shao
The 'cfs_rq' in these helpers is only used to get the rq_clock, so we can pass the rq_clock directly. After that, these helpers can be used by all sched class. Signed-off-by: Yafang Shao --- kernel/sched/fair.c | 148 ++- kernel/sched/sta

[RFC PATCH 3/4] sched: define update_stats_curr_start() as a common helper

2020-11-18 Thread Yafang Shao
update_stats_curr_start() is used to update the exec_start when we are starting a new run period, which is used by all sched class. So we'd better define it as a common helper. Signed-off-by: Yafang Shao --- kernel/sched/fair.c | 14 +- kernel/sched/rt.c| 2 +- kernel/

[RFC PATCH 4/4] sched, rt: support schedstat for RT sched class

2020-11-18 Thread Yafang Shao
RT tasks as well. Signed-off-by: Yafang Shao --- kernel/sched/rt.c| 61 kernel/sched/sched.h | 2 ++ 2 files changed, 63 insertions(+) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index b9ec886702a1..a318236b7166 100644 --- a/kernel/sched

Re: [RFC PATCH 2/4] sched: make schedstats helpers not depend on cfs_rq

2020-11-19 Thread Yafang Shao
On Thu, Nov 19, 2020 at 3:45 PM Mel Gorman wrote: > > On Thu, Nov 19, 2020 at 11:52:28AM +0800, Yafang Shao wrote: > > The 'cfs_rq' in these helpers is only used to get the rq_clock, so we > > can pass the rq_clock directly. After that, these helpers can be

[PATCH 0/6] sched: support schedstats for RT sched class

2020-12-01 Thread Yafang Shao
s well. Detailed examples of the output of schedstats for RT tasks are in patch #6. Changes since RFC: - improvement of schedstats helpers, per Mel. - make struct schedstats independent of fair sched class Yafang Shao (6): sched: don't include stats.h in sched.h sched, fair: use __sched

[PATCH 1/6] sched: don't include stats.h in sched.h

2020-12-01 Thread Yafang Shao
igned-off-by: Yafang Shao --- kernel/sched/core.c | 1 + kernel/sched/deadline.c | 1 + kernel/sched/debug.c | 1 + kernel/sched/fair.c | 1 + kernel/sched/idle.c | 1 + kernel/sched/rt.c| 2 +- kernel/sched/sched.h | 6 +- kernel/sched/stats.c | 1 + kernel/

  1   2   3   4   >