Re: [PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-08-01 Thread Yafang Shao
t; You diff is broken, this is very much not the clear_buddies() function. You're right. it is in pick_next_entity(). 2017-08-01 16:38 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: > On Tue, Aug 01, 2017 at 06:01:56PM +0800, Yafang Shao wrote: >> When we select CFQ as the schedu

Re: [PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-08-01 Thread Yafang Shao
Hi Peter, 2017-08-01 17:12 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: > On Tue, Aug 01, 2017 at 04:57:43PM +0800, Yafang Shao wrote: >> > And how would that happen? We only call pick_next_entity(.curr=NULL) >> > when we _know_ cfs_rq->nr_running. >>

Re: [PATCH v2] scheduler: enhancement to show_state_filter

2017-08-08 Thread Yafang Shao
pet...@infradead.org>: > On Tue, Aug 08, 2017 at 08:53:10PM +0800, Yafang Shao wrote: >> Sometimes we want to get tasks in TASK_RUNNING sepcifically, >> instead of dump all tasks. >> For example, when the loadavg are high, we want to dump >> tasks in TASK_RUNNING and TASK_

[PATCH v2] scheduler: enhancement to show_state_filter

2017-08-07 Thread Yafang Shao
. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- drivers/tty/sysrq.c | 2 +- include/linux/sched.h | 1 + include/linux/sched/debug.h | 6 -- kernel/sched/core.c | 7 --- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/tty/sysrq.c b/drive

[PATCH] scheduler: enhancement to show_state_filter

2017-08-07 Thread Yafang Shao
. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- drivers/tty/sysrq.c | 2 +- include/linux/sched.h | 1 + include/linux/sched/debug.h | 6 -- kernel/sched/core.c | 7 --- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/tty/sysrq.c b/drive

[PATCH v3] scheduler: enhancement to show_state_filter and SysRq

2017-08-08 Thread Yafang Shao
is that dumping both blocked tasks and running tasks is more helpful than dump blocked tasks only. That's an improvement. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- drivers/tty/sysrq.c | 15 --- include/linux/sched.h | 1 + include/linux/sched/debug.

Re: [PATCH v3] scheduler: enhancement to show_state_filter and SysRq

2017-08-09 Thread Yafang Shao
2017-08-09 15:43 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: > On Wed, Aug 09, 2017 at 06:31:28PM +0800, Yafang Shao wrote: >> Sometimes we want to get tasks in TASK_RUNNING sepcifically, >> instead of dump all tasks. >> >> For example, when the loadavg a

Re: [PATCH v3] scheduler: enhancement to show_state_filter and SysRq

2017-08-09 Thread Yafang Shao
2017-08-09 17:09 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: > On Wed, Aug 09, 2017 at 04:01:49PM +0800, Yafang Shao wrote: >> 2017-08-09 15:43 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: >> > On Wed, Aug 09, 2017 at 06:31:28PM +0800, Yafang Shao wrote:

[PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-07-31 Thread Yafang Shao
' and 'curr' could both be NULL, then this will cause NULL pointer issue. In order to fix this issue, we just need return NULL under the condition that both 'left' and 'curr' are NULL, meaning that no entity available. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- kernel/sched/fair

Re: [PATCH v2] scheduler: enhancement to show_state_filter

2017-08-08 Thread Yafang Shao
2017-08-08 19:24 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing in e-mail?On Tue, Aug 08, 2017 at > 07:

Re: [PATCH v2] scheduler: enhancement to show_state_filter

2017-08-08 Thread Yafang Shao
Okay. I will submit the whole work in a new patch later. 2017-08-08 19:04 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: > On Tue, Aug 08, 2017 at 06:36:41PM +0800, Yafang Shao wrote: >> After this change got approved, I will try to make some changes in SysRq. > > No, th

Re: [PATCH v2] scheduler: enhancement to show_state_filter

2017-08-08 Thread Yafang Shao
key, or something else). But in order to introduce the new key, we should made this change first. After this change got approved, I will try to make some changes in SysRq. Thanks Yafang 2017-08-08 18:24 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: > On Tue, Aug 08, 2017 at 04:50:23PM

Re: [PATCH v3] scheduler: enhancement to show_state_filter and SysRq

2017-08-09 Thread Yafang Shao
2017-08-10 0:42 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: > On Wed, Aug 09, 2017 at 05:26:14PM +0800, Yafang Shao wrote: >> 2017-08-09 17:09 GMT+08:00 Peter Zijlstra <pet...@infradead.org>: >> > On Wed, Aug 09, 2017 at 04:01:49PM +0800, Yafang Shao wrote: &g

Re: [PATCH] mm: introduce sanity check on dirty ratio sysctl value

2017-09-18 Thread Yafang Shao
2017-09-18 18:22 GMT+08:00 Jan Kara <j...@suse.cz>: > On Mon 18-09-17 01:39:28, Yafang Shao wrote: >> we can find the logic in domain_dirty_limits() that >> when dirty bg_thresh is bigger than dirty thresh, >> bg_thresh will be set as thresh * 1 / 2. >&

[PATCH v2] mm: introduce validity check on vm dirtiness settings

2017-09-18 Thread Yafang Shao
ess successfully. This behavior may mislead us. We'd better do this validity check at the beginning. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- Documentation/sysctl/vm.txt | 5 +++ mm/page-writeback.c | 86 - 2 files changed, 83 inserti

Re: [PATCH v2] mm: introduce validity check on vm dirtiness settings

2017-09-19 Thread Yafang Shao
2017-09-19 16:35 GMT+08:00 Jan Kara <j...@suse.cz>: > On Tue 19-09-17 06:53:00, Yafang Shao wrote: >> we can find the logic in domain_dirty_limits() that >> when dirty bg_thresh is bigger than dirty thresh, >> bg_thresh will be set as thresh * 1 / 2. >&

Re: [PATCH v2] mm: introduce validity check on vm dirtiness settings

2017-09-20 Thread Yafang Shao
2017-09-20 23:33 GMT+08:00 Jan Kara <j...@suse.cz>: > On Tue 19-09-17 19:48:00, Yafang Shao wrote: >> 2017-09-19 16:35 GMT+08:00 Jan Kara <j...@suse.cz>: >> > On Tue 19-09-17 06:53:00, Yafang Shao wrote: >> >> + if (

[PATCH v4] mm: introduce validity check on vm dirtiness settings

2017-09-21 Thread Yafang Shao
ess successfully. This behavior may mislead us. We'd better do this validity check at the beginning. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- Documentation/sysctl/vm.txt | 6 kernel/sysctl.c | 4 +-- mm/page-writeback.c

[PATCH] mm: introduce sanity check on dirty ratio sysctl value

2017-09-17 Thread Yafang Shao
tio successfully. This behavior may mislead us. So we should do this sanity check at the beginning. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- Documentation/sysctl/vm.txt | 5 +++ mm/page-writeback.c | 84 - 2 files changed, 81 inserti

[PATCH v3] mm: introduce validity check on vm dirtiness settings

2017-09-19 Thread Yafang Shao
ess successfully. This behavior may mislead us. We'd better do this validity check at the beginning. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- Documentation/sysctl/vm.txt | 6 +++ mm/page-writeback.c | 92 + 2 files changed, 90 inserti

[PATCH] mm/page-writeback.c: fix bug caused by disable periodic writeback

2017-10-06 Thread Yafang Shao
by writing a non-zero value to dirty_writeback_centisecs As it can be disabled by sysctl, it should be able to enable by sysctl as well. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- mm/page-writeback.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/m

Re: [PATCH] mm/page-writeback.c: fix bug caused by disable periodic writeback

2017-10-10 Thread Yafang Shao
2017-10-10 16:48 GMT+08:00 Jan Kara <j...@suse.cz>: > On Tue 10-10-17 16:00:29, Yafang Shao wrote: >> 2017-10-10 6:42 GMT+08:00 Andrew Morton <a...@linux-foundation.org>: >> > On Sat, 7 Oct 2017 06:58:04 +0800 Yafang Shao <laoar.s...@gmail.com> >>

Re: [PATCH] mm/page-writeback.c: fix bug caused by disable periodic writeback

2017-10-10 Thread Yafang Shao
2017-10-10 6:42 GMT+08:00 Andrew Morton <a...@linux-foundation.org>: > On Sat, 7 Oct 2017 06:58:04 +0800 Yafang Shao <laoar.s...@gmail.com> wrote: > >> After disable periodic writeback by writing 0 to >> dirty_writeback_centisecs, the handler wb_workfn() will

[PATCH for linux-next] mm/page-writeback.c: make changes of dirty_writeback_centisecs take effect immediately

2017-10-13 Thread Yafang Shao
threads immediately fixes it. Cc: Jens Axboe <ax...@kernel.dk> Cc: Jan Kara <j...@suse.cz> Cc: Andrew Morton <a...@linux-foundation.org> Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- mm/page-writeback.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(

[PATCH resend] mm/page-writeback.c: make changes of dirty_writeback_centisecs take effect immediately

2017-10-13 Thread Yafang Shao
is triggered. - When the tunable was set to one hour and is reset to one second, the new setting will not take effect for up to one hour. Kicking the flusher threads immediately fixes these issues. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- mm/page-writeback.c | 19

Re: [PATCH v3] mm: introduce validity check on vm dirtiness settings

2017-09-26 Thread Yafang Shao
2017-09-26 18:25 GMT+08:00 Michal Hocko <mho...@kernel.org>: > On Wed 20-09-17 06:43:35, Yafang Shao wrote: >> we can find the logic in domain_dirty_limits() that >> when dirty bg_thresh is bigger than dirty thresh, >> bg_thresh will be set as thresh * 1 / 2. >&

Re: [PATCH v3] mm: introduce validity check on vm dirtiness settings

2017-09-26 Thread Yafang Shao
2017-09-26 19:26 GMT+08:00 Michal Hocko <mho...@kernel.org>: > On Tue 26-09-17 19:06:37, Yafang Shao wrote: >> 2017-09-26 18:25 GMT+08:00 Michal Hocko <mho...@kernel.org>: >> > On Wed 20-09-17 06:43:35, Yafang Shao wrote: >> >> we can find the logic in d

Re: [PATCH] mm/page-writeback.c: fix bug caused by disable periodic writeback

2017-10-09 Thread Yafang Shao
2017-10-09 19:03 GMT+08:00 Jan Kara <j...@suse.cz>: > On Mon 09-10-17 18:44:23, Yafang Shao wrote: >> 2017-10-09 17:56 GMT+08:00 Jan Kara <j...@suse.cz>: >> > On Sat 07-10-17 06:58:04, Yafang Shao wrote: >> >> After disable periodic writeback by wr

Re: [PATCH] mm/page-writeback.c: fix bug caused by disable periodic writeback

2017-10-09 Thread Yafang Shao
2017-10-09 17:56 GMT+08:00 Jan Kara <j...@suse.cz>: > On Sat 07-10-17 06:58:04, Yafang Shao wrote: >> After disable periodic writeback by writing 0 to >> dirty_writeback_centisecs, the handler wb_workfn() will not be >> entered again until the dirty background limit

Re: [PATCH] mm/page-writeback.c: fix bug caused by disable periodic writeback

2017-10-10 Thread Yafang Shao
2017-10-10 17:33 GMT+08:00 Jan Kara <j...@suse.cz>: > On Tue 10-10-17 17:14:48, Yafang Shao wrote: >> 2017-10-10 16:48 GMT+08:00 Jan Kara <j...@suse.cz>: >> > On Tue 10-10-17 16:00:29, Yafang Shao wrote: >> >> 2017-10-10 6:42 GMT+08:00 Andrew Morton <a

[PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-02 Thread Yafang Shao
newstate) When do TCP/IP state transition, we should use these two helpers or use tcp_set_state() other than assigning a value to sk_state directly. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- v2: test --- include/net/tcp.h | 2 ++ net/ipv4/inet_connection_sock.

Re: [PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-04 Thread Yafang Shao
2017-12-05 3:28 GMT+08:00 Marcelo Ricardo Leitner <marcelo.leit...@gmail.com>: > On Sat, Dec 02, 2017 at 09:36:41AM +0000, Yafang Shao wrote: >> The TCP/IP transition from TCP_LISTEN to TCP_SYN_RECV and some other >> transitions are not traced with tcp_set_state tracepoint. &g

Re: [PATCH net-next 1/3] net:tracepoint: replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-13 Thread Yafang Shao
2017-12-13 9:19 GMT+08:00 Song Liu <songliubrav...@fb.com>: > >> On Dec 10, 2017, at 7:31 AM, Yafang Shao <laoar.s...@gmail.com> wrote: >> >> As sk_state is a common field for struct sock, so the state >> transition should not be a TCP specific feature.

Re: [PATCH v2 net-next 2/4] net: tracepoint: replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-15 Thread Yafang Shao
2017-12-16 6:47 GMT+08:00 Song Liu <songliubrav...@fb.com>: > >> On Dec 15, 2017, at 9:56 AM, Yafang Shao <laoar.s...@gmail.com> wrote: >> >> As sk_state is a common field for struct sock, so the state >> transition should not be a TCP specific feature.

[PATCH v2 net-next 1/4] tcp: Export to userspace the TCP state names for the trace events

2017-12-15 Thread Yafang Shao
TCP_FIN_WAIT2" }, { 6, "TCP_TIME_WAIT" }, { 7, "TCP_CLOSE" }, { 8, "TCP_CLOSE_WAIT" }, { 9, "TCP_LAST_ACK" }, { 10, "TCP_LISTEN" }, { 11, "TCP_CLOSING" }, { 12, "TCP_NEW_SYN_RECV" }) Signed-off-by: Ste

[PATCH v2 net-next 2/4] net: tracepoint: replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-15 Thread Yafang Shao
-by: Yafang Shao <laoar.s...@gmail.com> --- include/net/sock.h | 15 +- include/trace/events/sock.h | 106 include/trace/events/tcp.h | 91 -- net/core/sock.c | 13 + ne

[PATCH v2 net-next 3/4] net: tracepoint: using sock_set_state tracepoint to trace DCCP state transition

2017-12-15 Thread Yafang Shao
With changes in inet_ files, DCCP state transitions are traced with sock_set_state tracepoint. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- net/dccp/proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 9d43c1f..2

[PATCH v2 net-next 0/4] replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-15 Thread Yafang Shao
n's patch is included in this series. Steven Rostedt (1): tcp: Export to userspace the TCP state names for the trace events Yafang Shao (3): net: tracepoint: replace tcp_set_state tracepoint with sock_set_state tracepoint net: tracepoint: using sock_set_state tracepoint to trace SCTP st

[PATCH v2 net-next 4/4] net: tracepoint: using sock_set_state tracepoint to trace SCTP state transition

2017-12-15 Thread Yafang Shao
With changes in inet_ files, SCTP state transitions are traced with sockt_set_state tracepoint. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- net/sctp/endpointola.c | 2 +- net/sctp/sm_sideeffect.c | 4 ++-- net/sctp/socket.c| 12 ++-- 3 files changed, 9 inse

[PATCH v2 net-next 1/4] tcp: Export to userspace the TCP state names for the trace events

2017-12-15 Thread Yafang Shao
TCP_FIN_WAIT2" }, { 6, "TCP_TIME_WAIT" }, { 7, "TCP_CLOSE" }, { 8, "TCP_CLOSE_WAIT" }, { 9, "TCP_LAST_ACK" }, { 10, "TCP_LISTEN" }, { 11, "TCP_CLOSING" }, { 12, "TCP_NEW_SYN_RECV" }) Signed-off-by: Ste

[PATCH v2 net-next 4/4] net: tracepoint: using sock_set_state tracepoint to trace SCTP state transition

2017-12-15 Thread Yafang Shao
With changes in inet_ files, SCTP state transitions are traced with sockt_set_state tracepoint. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- net/sctp/endpointola.c | 2 +- net/sctp/sm_sideeffect.c | 4 ++-- net/sctp/socket.c| 12 ++-- 3 files changed, 9 inse

[PATCH v2 net-next 0/4] replace tcp_set_state tracepoint with

2017-12-15 Thread Yafang Shao
is included in this series. Steven Rostedt: tcp: Export to userspace the TCP state names for the trace events Yafang Shao (3): net: tracepoint: using sock_set_state tracepoint to trace SCTP state transition net: tracepoint: replace tcp_set_state tracepoint with sock_set_state

[PATCH v2 net-next 3/4] net: tracepoint: using sock_set_state tracepoint to trace DCCP state transition

2017-12-15 Thread Yafang Shao
With changes in inet_ files, DCCP state transitions are traced with sock_set_state tracepoint. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- net/dccp/proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 9d43c1f..2

Re: [PATCH v2 net-next 0/4] replace tcp_set_state tracepoint with

2017-12-15 Thread Yafang Shao
2017-12-16 1:43 GMT+08:00 David Miller : > > Your Subject line here is incomplete, "replace tcp_set_state > tracepoint with" what? Oh Sorry. The subject should be "replace tcp_set_state tracepoint with sock_set_state tracepoint" Thanks Yafang

[PATCH v2 net-next 2/4] net: tracepoint: replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-15 Thread Yafang Shao
-by: Yafang Shao <laoar.s...@gmail.com> --- include/net/sock.h | 15 +- include/trace/events/sock.h | 106 include/trace/events/tcp.h | 91 -- net/core/sock.c | 13 + ne

[PATCH v3 net-next 4/5] net: tracepoint: using sock_set_state tracepoint to trace DCCP state transition

2017-12-19 Thread Yafang Shao
With changes in inet_ files, DCCP state transitions are traced with inet_sock_set_state tracepoint. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- net/dccp/proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 9

[PATCH v3 net-next 1/5] tcp: Export to userspace the TCP state names for the trace events

2017-12-19 Thread Yafang Shao
TCP_FIN_WAIT2" }, { 6, "TCP_TIME_WAIT" }, { 7, "TCP_CLOSE" }, { 8, "TCP_CLOSE_WAIT" }, { 9, "TCP_LAST_ACK" }, { 10, "TCP_LISTEN" }, { 11, "TCP_CLOSING" }, { 12, "TCP_NEW_SYN_RECV" }) Signed-off-by: Ste

[PATCH v3 net-next 0/5] replace tcp_set_state tracepoint with inet_sock_set_state

2017-12-19 Thread Yafang Shao
should be traced, I will modify the code to trace it. I just want to make the code easy and not output useless information. Steven Rostedt (VMware) (1): tcp: Export to userspace the TCP state names for the trace events Yafang Shao (4): net: tracepoint: replace tcp_set_state tracepoint

[PATCH v3 net-next 5/5] net: tracepoint: using sock_set_state tracepoint to trace SCTP state transition

2017-12-19 Thread Yafang Shao
-by: Yafang Shao <laoar.s...@gmail.com> --- net/sctp/endpointola.c | 2 +- net/sctp/sm_sideeffect.c | 4 ++-- net/sctp/socket.c| 12 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index ee1e601..8b31468

[PATCH v3 net-next 2/5] net: tracepoint: replace tcp_set_state tracepoint with inet_sock_set_state tracepoint

2017-12-19 Thread Yafang Shao
not be included in other header files, so they are defined in sock.c. The protocol such as SCTP maybe compiled as a ko, hence export inet_sk_set_state(). Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/net/inet_sock.h | 2 + include/trace/events/sock.h

[PATCH v3 net-next 3/5] net: sock: replace sk_state_load with inet_sk_state_load and remove sk_state_store

2017-12-19 Thread Yafang Shao
sk_state_load is only used by AF_INET/AF_INET6, so rename it to inet_sk_state_load and move it into inet_sock.h. sk_state_store is removed as it is not used any more. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/net/inet_sock.h | 25 - i

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Yafang Shao
2017-11-18 0:45 GMT+08:00 Roman Gushchin <g...@fb.com>: > On Sat, Nov 18, 2017 at 12:20:40AM +0800, Yafang Shao wrote: >> 2017-11-17 23:55 GMT+08:00 Roman Gushchin <g...@fb.com>: >> > On Thu, Nov 16, 2017 at 08:43:17PM -0800, Shakeel Butt wrote: >> >> On

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Yafang Shao
2017-11-17 23:55 GMT+08:00 Roman Gushchin <g...@fb.com>: > On Thu, Nov 16, 2017 at 08:43:17PM -0800, Shakeel Butt wrote: >> On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao <laoar.s...@gmail.com> wrote: >> > Currently the default tmpfs size is totalram_pages / 2 if mou

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Yafang Shao
2017-11-18 1:35 GMT+08:00 Shakeel Butt <shake...@google.com>: > On Fri, Nov 17, 2017 at 9:09 AM, Yafang Shao <laoar.s...@gmail.com> wrote: >> 2017-11-18 0:45 GMT+08:00 Roman Gushchin <g...@fb.com>: >>> On Sat, Nov 18, 2017 at 12:20:40AM +0800, Yafang Shao wr

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-17 Thread Yafang Shao
2017-11-18 1:49 GMT+08:00 Shakeel Butt <shake...@google.com>: > On Fri, Nov 17, 2017 at 9:41 AM, Yafang Shao <laoar.s...@gmail.com> wrote: >> 2017-11-18 1:35 GMT+08:00 Shakeel Butt <shake...@google.com>: >>> On Fri, Nov 17, 2017 at 9:09 AM, Yafang Shao <laoar

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 <rost...@goodmis.org>: > On Sat, 11 Nov 2017 02:06:00 + > Yafang Shao <laoar.s...@gmail.com> wrote: > >> 2017-11-10 15:07 GMT+00:00 Steven Rostedt <rost...@goodmis.org>: >> > On Fri, 10 Nov 2017 12:56:06 +0

[PATCH v2 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-11-18 Thread Yafang Shao
newstate) When do TCP/IP state transition, we should use these two helpers or use tcp_set_state() other than assigning a value to sk_state directly. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/net/tcp.h | 2 ++ net/ipv4/inet_connection_sock.c | 6 +++--- ne

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-20 Thread Yafang Shao
2017-11-20 20:39 GMT+08:00 Michal Hocko <mho...@kernel.org>: > On Mon 20-11-17 20:16:15, Yafang Shao wrote: >> 2017-11-20 20:04 GMT+08:00 Michal Hocko <mho...@kernel.org>: >> > On Fri 17-11-17 09:49:54, Shakeel Butt wrote: >> >> On Fri, Nov 17, 2017 at

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-20 Thread Yafang Shao
2017-11-20 20:04 GMT+08:00 Michal Hocko <mho...@kernel.org>: > On Fri 17-11-17 09:49:54, Shakeel Butt wrote: >> On Fri, Nov 17, 2017 at 9:41 AM, Yafang Shao <laoar.s...@gmail.com> wrote: > [...] >> > Of couse that is the best way. >> > But we can not ensu

[PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-16 Thread Yafang Shao
wap is off. So when we mount tmpfs in a memcg, the default size should be limited by the memcg memory.limit. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/linux/memcontrol.h | 1 + mm/memcontrol.c| 2 +- mm/shmem.c | 20 +++- 3 f

Re: [PATCH] mm/shmem: set default tmpfs size according to memcg limit

2017-11-16 Thread Yafang Shao
2017-11-17 12:43 GMT+08:00 Shakeel Butt <shake...@google.com>: > On Thu, Nov 16, 2017 at 7:09 PM, Yafang Shao <laoar.s...@gmail.com> wrote: >> Currently the default tmpfs size is totalram_pages / 2 if mount tmpfs >> without "-o size=XXX". >> Whe

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

2017-11-10 Thread Yafang Shao
2017-11-10 15:07 GMT+00:00 Steven Rostedt <rost...@goodmis.org>: > On Fri, 10 Nov 2017 12:56:06 +0800 > Yafang Shao <laoar.s...@gmail.com> wrote: > >> Could the macro tcp_state_name() be renamed ? >> If is included in include/net/tcp.h, it will > > Ideally,

[PATCH] net/tcp: track all ipv4/tcp state transition in tcp_set_state

2017-11-07 Thread Yafang Shao
the whole tcp lifespans with kprobe or ftrace easily. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- net/ipv4/inet_connection_sock.c | 6 +++--- net/ipv4/inet_hashtables.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/ipv4/inet_connection_sock.c b/ne

[PATCH net-next 2/2] tcp: handle TCP_TIME_WAIT/TCP_NEW_SYN_RECV in tcp_set_state tracepoint

2017-11-09 Thread Yafang Shao
When TCP connetion in TCP_TIME_WAIT or TCP_NEW_SYN_RECV state, it can't get the sport/dport/saddr/daddr from inet_sock. trace_tcp_set_state may be called when the oldstate in these two states. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/trace/events/tcp.

[PATCH net-next 1/2] net/tcp: track all TCP/IP state transition in tcp_set_state

2017-11-09 Thread Yafang Shao
newstate) When do TCP/IP state transition, we should use these two helpers or use tcp_set_state() other than assigning a value to sk_state directly. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/net/tcp.h | 16 net/ipv4/inet_connection_sock.

Re: [PATCH net-next 2/2] tcp: handle TCP_TIME_WAIT/TCP_NEW_SYN_RECV in tcp_set_state tracepoint

2017-11-09 Thread Yafang Shao
2017-11-09 22:58 GMT+08:00 Eric Dumazet : > On Thu, 2017-11-09 at 06:52 -0800, Eric Dumazet wrote: > >> Wow. >> >> >> Since all three variants of sockets (full sockets, request sockets, >> timewait sockets) are all hashed into ehash table these days, they all >> have the

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

2017-11-09 Thread Yafang Shao
2017-11-10 8:57 GMT+08:00 Steven Rostedt : > > From: "Steven Rostedt (VMware)" > > The TCP trace events (specifically tcp_set_state), maps emums to symbol > names via __print_symbolic(). But this only works for reading trace events > from the tracefs

Re: [PATCH] net/tcp: track all ipv4/tcp state transition in tcp_set_state

2017-11-08 Thread Yafang Shao
2017-11-08 14:51 GMT+08:00 David Miller <da...@davemloft.net>: > From: Yafang Shao <laoar.s...@gmail.com> > Date: Tue, 7 Nov 2017 18:36:28 +0800 > >> When I hooked the function tcp_set_state with kprobe to track the ipv4/tcp >> state transistion, I found

[PATCH] net/tcp: introduce TRACE_EVENT for TCP/IPv4 state transition

2017-11-08 Thread Yafang Shao
__sk_state_store(struct sock *sk, int newstate) When do TCP/IPv4 state transition, we should use these two helpers or use tcp_set_state() instead of assign a value to sk_state directly. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/net/tcp.h | 16 i

Re: [PATCH] net/tcp: introduce TRACE_EVENT for TCP/IPv4 state transition

2017-11-08 Thread Yafang Shao
2017-11-09 14:43 GMT+08:00 Alexei Starovoitov <alexei.starovoi...@gmail.com>: > On Thu, Nov 09, 2017 at 02:01:38PM +0800, Yafang Shao wrote: >> With this newly introduced TRACE_EVENT, it will be very easy to minotor >> TCP/IPv4 state transition. >> >> A ne

Re: [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-07 Thread Yafang Shao
2017-12-08 4:02 GMT+08:00 Marcelo Ricardo Leitner <marcelo.leit...@gmail.com>: > On Thu, Dec 07, 2017 at 02:10:42PM +0000, Yafang Shao wrote: >> The TCP/IP transition from TCP_LISTEN to TCP_SYN_RECV and some other >> transitions are not traced with tcp_set_state tracepoint. &g

Re: [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-07 Thread Yafang Shao
2017-12-08 9:41 GMT+08:00 Yafang Shao <laoar.s...@gmail.com>: > 2017-12-08 4:02 GMT+08:00 Marcelo Ricardo Leitner <marcelo.leit...@gmail.com>: >> On Thu, Dec 07, 2017 at 02:10:42PM +, Yafang Shao wrote: >>> The TCP/IP transition from TCP_LISTEN to TCP_SYN_RECV

Re: [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-08 Thread Yafang Shao
2017-12-08 23:42 GMT+08:00 David Miller <da...@davemloft.net>: > From: Yafang Shao <laoar.s...@gmail.com> > Date: Fri, 8 Dec 2017 11:40:23 +0800 > >> It will looks like these, >> >> if (sk->sk_protocol == IPPROTO_TCP) >> _

[PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-07 Thread Yafang Shao
); When do TCP/IP state transition, we should use these two helpers or use tcp_set_state() other than assigning a value to sk_state directly. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> Acked-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Marcelo Ricardo Leitner <marcelo.le

Re: [PATCH v5 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-08 Thread Yafang Shao
2017-12-09 0:28 GMT+08:00 David Miller <da...@davemloft.net>: > From: Yafang Shao <laoar.s...@gmail.com> > Date: Fri, 8 Dec 2017 23:50:44 +0800 > >> 2017-12-08 23:42 GMT+08:00 David Miller <da...@davemloft.net>: >>> From: Yafang Shao <laoar.s...@gmail.

[PATCH net-next 3/3] net:tracepoint: using sock_set_state tracepoint to trace SCTP state transition

2017-12-10 Thread Yafang Shao
With changes in inet_ files, SCTP state transitions are traced with sockt_set_state tracepoint. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- net/sctp/endpointola.c | 2 +- net/sctp/sm_sideeffect.c | 4 ++-- net/sctp/socket.c| 14 +++--- 3 files changed, 10 inse

[PATCH net-next 2/3] net:tracepoint: using sock_set_state tracepoint to trace DCCP state transition

2017-12-10 Thread Yafang Shao
With changes in inet_ files, DCCP state transitions are traced with sock_set_state tracepoint. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- net/dccp/proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dccp/proto.c b/net/dccp/proto.c index b68168f..9

[PATCH net-next 1/3] net:tracepoint: replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-10 Thread Yafang Shao
state); - void sk_set_state(struct sock *sk, int state); As trace header should not be included in other header files, so they are defined in sock.c. The protocol such as SCTP maybe compiled as a ko, hence export sk_set_state(). Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- inclu

[PATCH net-next 0/3] replace tcp_set_state tracepoint with sock_set_state tracepoint

2017-12-10 Thread Yafang Shao
Hi, According to the discussion in the mail thread https://patchwork.kernel.org/patch/10099243/, tcp_set_state tracepoint is renamed to sock_set_state tracepoint and is moved to include/trace/events/sock.h. Using this new tracepoint to trace TCP/DCCP/SCTP state transition. Yafang Shao (3

[PATCH v4 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-06 Thread Yafang Shao
); When do TCP/IP state transition, we should use these two helpers or use tcp_set_state() other than assigning a value to sk_state directly. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> Acked-by: Song Liu <songliubrav...@fb.com> Reviewed-by: Marcelo Ricardo Leitner <marcelo.le

[PATCH v3 net-next] net/tcp: trace all TCP/IP state transition with tcp_set_state tracepoint

2017-12-05 Thread Yafang Shao
); When do TCP/IP state transition, we should use these two helpers or use tcp_set_state() other than assigning a value to sk_state directly. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> Acked-by: Song Liu <songliubrav...@fb.com> --- v2->v3: Per suggestion from Marcelo

[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 <laoar.s...@gmail.com> --- include/trace/events/tcp.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

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

[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 <laoar.s...@gmail.com> --- include/trace/events/tcp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

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

[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 <eduma...@google.com> Acked-by: Song Liu <songliubrav...@fb.com> Signed-off-

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 >>> >>>> s

[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 <eduma...@google.com> Signed-off-by: Yafang Shao <laoar.s...@gm

Re: [PATCH v3 net-next 2/5] net: tracepoint: replace tcp_set_state tracepoint with inet_sock_set_state tracepoint

2017-12-30 Thread Yafang Shao
On Sun, Dec 31, 2017 at 6:33 AM, Brendan Gregg <brendan.d.gr...@gmail.com> wrote: > On Tue, Dec 19, 2017 at 7:12 PM, Yafang Shao <laoar.s...@gmail.com> wrote: >> As sk_state is a common field for struct sock, so the state >> transition tracepoint should not be a TCP spe

[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 <brendan.d.gr...@gmail.com> Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/trace/

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

2018-01-06 Thread Yafang Shao
as tracepoint arguments. Suggested-by: Brendan Gregg <brendan.d.gr...@gmail.com> Suggested-by: Song Liu <songliubrav...@fb.com> Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/trace/events/sock.h | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) di

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 <songliubrav...@fb.com> wrote: > >> On Jan 5, 2018, at 12:09 AM, Yafang Shao <laoar.s...@gmail.com> wrote: >> >> On Fri, Jan 5, 2018 at 3:21 PM, Song Liu <songliubrav...@fb.com> wrote: >>> >>>> On

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 <songliubrav...@fb.com> wrote: > >> On Jan 4, 2018, at 10:42 PM, Yafang Shao <laoar.s...@gmail.com> wrote: >> >> sk->sk_protocol and sk->sk_family are exposed as tracepoint arguments. >> Then we can convenie

[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 <laoar.s...@gmail.com> --- include/linux/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 <laoar.s...@gmail.com> --- include/linux/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 <t...@kernel.org> 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 >>

[PATCH net-next] tcp: remove the hardcode in the definition of TCPF Macro

2018-02-20 Thread Yafang Shao
TCPF_ macro depends on the definition of TCP_ macro. So it is better to define them with TCP_ marco. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- include/net/tcp_states.h | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/inclu

[PATCH bpf-next] bpf: NULL pointer check is not needed in BPF_CGROUP_RUN_PROG_INET_SOCK

2018-02-22 Thread Yafang Shao
sk is already allocated in inet_create/inet6_create, hence when BPF_CGROUP_RUN_PROG_INET_SOCK is executed sk will never be NULL. The logic is as bellow, sk = sk_alloc(); if (!sk) goto out; BPF_CGROUP_RUN_PROG_INET_SOCK(sk); Signed-off-by: Yafang Shao

Re: [PATCH v3 net-next 2/5] net: tracepoint: replace tcp_set_state tracepoint with inet_sock_set_state tracepoint

2018-01-02 Thread Yafang Shao
On Wed, Jan 3, 2018 at 3:46 AM, Brendan Gregg <brendan.d.gr...@gmail.com> wrote: > On Sat, Dec 30, 2017 at 7:06 PM, Yafang Shao <laoar.s...@gmail.com> wrote: >> On Sun, Dec 31, 2017 at 6:33 AM, Brendan Gregg >> <brendan.d.gr...@gmail.com> wrote: >>> On

[PATCH] sched: cgroup: export nr_running for each cpu cgroup

2017-12-27 Thread Yafang Shao
the status of all processes, that's a little expensive. Hence export the nr_running. Signed-off-by: Yafang Shao <laoar.s...@gmail.com> --- kernel/sched/core.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 644fa2e..926575a

  1   2   3   4   5   >