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

2020-12-01 Thread Yafang Shao
Gorman Signed-off-by: Yafang Shao --- kernel/sched/fair.c | 140 +++ kernel/sched/stats.c | 104 kernel/sched/stats.h | 32 ++ 3 files changed, 157 insertions(+), 119 deletions(-) diff --git a/kernel/sched/fair.c b

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

2020-12-01 Thread Yafang Shao
schedstat_enabled() has been already checked, so we can use __schedstat_set() directly. Signed-off-by: Yafang Shao --- 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 8ff1daa3d9bb..7e7c03cede94 100644 --- a

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

2020-12-01 Thread Yafang Shao
. }; After the patch it is clearly that both of se or rt_se can easily get the sched_statistics by a task_struct or a task_group. Signed-off-by: Yafang Shao --- include/linux/sched.h| 3 +- kernel/sched/core.c | 24 --- kernel/sched/deadline.c | 4 +- kernel/sched/debug.c |

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

2020-12-01 Thread Yafang Shao
time=0 [ns] stress-9748[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 2d

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

2020-12-01 Thread Yafang Shao
eep-15582 [041] dN.. 1732.814348: sched_stat_sleep: comm=sleep.sh pid=15474 delay=1001223130 [ns] sleep-15584 [041] dN.. 1733.815908: sched_stat_sleep: comm=sleep.sh pid=15474 delay=1001238954 [ns] [ In sleep.sh, it sleeps 1 sec each time. ] Signed-off-by: Yafang Shao --

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

2020-11-23 Thread Yafang Shao
trace RT tasks as well after that patchset. PATCH #1 ~ #4 are the preparation of PATCH #5. - v2: keep the schedstats functions inline, per Mel. Yafang Shao (5): sched: don't include stats.h in sched.h sched: define task_of() as a common helper sched: make schedstats helper independe

[RFC PATCH v2 2/5] sched: define task_of() as a common helper

2020-11-23 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 v2 3/5] sched: make schedstats helper independent of cfs_rq

2020-11-23 Thread Yafang Shao
sed around 824Bytes. w/o this patch, with this patch Size of vmlinux:7844383278444656 Signed-off-by: Yafang Shao --- kernel/sched/fair.c | 148 ++- kernel/sched/stats.h | 144 + 2 fil

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

2020-11-23 Thread Yafang Shao
RT tasks as well. Signed-off-by: Yafang Shao --- kernel/sched/rt.c| 90 kernel/sched/sched.h | 4 ++ 2 files changed, 94 insertions(+) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 3422dd85cfb4..f2eff92275f0 100644 --- a/kernel/sched

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

2020-11-23 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 v2 1/5] sched: don't include stats.h in sched.h

2020-11-23 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/

Re: [RFC PATCH v2 3/5] sched: make schedstats helper independent of cfs_rq

2020-11-24 Thread Yafang Shao
On Tue, Nov 24, 2020 at 7:40 PM Mel Gorman wrote: > > On Mon, Nov 23, 2020 at 08:58:06PM +0800, Yafang Shao wrote: > > The 'cfs_rq' in these helpers > > update_stats_{wait_start, wait_end, enqueue_sleeper} is only used to get > > the rq_clock, so we can pass t

Re: [PATCH 4/6] sched: make schedstats helpers independent of fair sched class

2020-12-01 Thread Yafang Shao
On Tue, Dec 1, 2020 at 8:46 PM Mel Gorman wrote: > > On Tue, Dec 01, 2020 at 07:54:14PM +0800, Yafang Shao wrote: > > The original prototype of the schedstats helpers are > > > > update_stats_wait_*(struct cfs_rq *cfs_rq, struct sched_entity *se) > > > > The cf

Re: [PATCH 3/6] sched: make struct sched_statistics independent of fair sched class

2020-12-01 Thread Yafang Shao
On Tue, Dec 1, 2020 at 8:41 PM Mel Gorman wrote: > > On Tue, Dec 01, 2020 at 07:54:13PM +0800, Yafang Shao wrote: > > If we want to use schedstats facility, we should move out of > > struct sched_statistics from the struct sched_entity or add it into other > > sctructs

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

2021-03-14 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 1/3] mm, slub: use pGp to print page flags

2021-03-14 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 v6 3/3] vsprintf: dump full information of page flags in pGp

2021-03-14 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 2/3] mm, slub: don't combine pr_err with INFO

2021-03-14 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

Re: linux-next: Tree for Mar 10 (lib/test_printf.c)

2021-03-14 Thread Yafang Shao
On Wed, Mar 10, 2021 at 5:52 PM Petr Mladek wrote: > > On Tue 2021-03-09 21:57:48, Randy Dunlap wrote: > > On 3/9/21 8:02 PM, Stephen Rothwell wrote: > > > Hi all, > > > > > > > on i386 (at least): > > > > ../lib/test_printf.c: In function 'page_flags_test': > > ../lib/test_printf.c:595:17: error:

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

2021-02-08 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 Acked-by: Christoph Lameter Signed-off-by: Yafang Shao --- mm/slub.c | 5 +++-- 1 file chang

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

2021-02-08 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

[PATCH v3 0/3] mm, vsprintf: introduce new format to dump full information of page flags

2021-02-08 Thread Yafang Shao
- the possible impact on debugfs and the fix 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

[PATCH v3 3/3] vsprintf: introduce new format to dump full information of page flags

2021-02-08 Thread Yafang Shao
hew Wilcox Signed-off-by: Yafang Shao --- Documentation/core-api/printk-formats.rst | 2 + lib/test_printf.c | 126 +++--- lib/vsprintf.c| 115 +++- 3 files changed, 226 insertions(+), 17 deletions(-) diff --git

Re: [PATCH v3 0/3] mm, vsprintf: introduce new format to dump full information of page flags

2021-02-08 Thread Yafang Shao
On Mon, Feb 8, 2021 at 8:20 PM Matthew Wilcox wrote: > > On Mon, Feb 08, 2021 at 06:14:36PM +0800, Yafang Shao wrote: > > To avoid breaking some tools which parsing pGp via debugfs or affecting > > the printf buffer, other new formats are introduced, so the user can choose >

Re: [xfs] db962cd266: Assertion_failed

2021-01-01 Thread Yafang Shao
on reservation recursion") > url: > https://github.com/0day-ci/linux/commits/Yafang-Shao/xfs-avoid-transaction-reservation-recursion/20201222-092315 > base: https://git.kernel.org/cgit/fs/xfs/xfs-linux.git for-next > > in testcase: filebench > version: filebench-x86_64-22620e6-1

Re: [xfs] db962cd266: Assertion_failed

2021-01-04 Thread Yafang Shao
On Sat, Jan 2, 2021 at 5:53 AM Dave Chinner wrote: > > On Fri, Jan 01, 2021 at 05:10:49PM +0800, Yafang Shao wrote: > > On Thu, Dec 31, 2020 at 10:46 AM kernel test robot > > wrote: > . > > > [ 552.905799] XFS: Assertion failed: !current->journal_info, file

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

2021-01-27 Thread Yafang Shao
ut is, [ 8846.517809] INFO: Slab 0xf42a2c60 objects=33 used=3 fp=0x60d32ca8 flags=0x17c0010200(slab|head) Reviewed-by: David Hildenbrand Signed-off-by: Yafang Shao --- mm/slub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 69742ab

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

2021-01-27 Thread Yafang Shao
=33 used=3 fp=0x6d0779d1 flags=0x17c0010200(Node 0x0,Zone 0x2,Lastcpupid 0x1f,slab|head) Yafang Shao (3): mm, slub: use pGp to print page flags mm, slub: don't combine pr_err with INFO printk: dump full information of page flags in pGp lib/

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

2021-01-27 Thread Yafang Shao
r the patch [ 6312.639698] ERR: Slab 0x6d1133b9 objects=33 used=3 fp=0x6d0779d1 flags=0x17c0010200(slab|head) [1]. https://lore.kernel.org/linux-mm/b9c0f2b6-e9b0-0c36-ebdd-2bc684c5a...@redhat.com/#t Cc: David Hildenbrand Signed-off-by: Yafang Shao --- mm/slub.c | 10

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

2021-01-27 Thread Yafang Shao
|head) Cc: David Hildenbrand Signed-off-by: Yafang Shao --- lib/vsprintf.c | 42 +- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 3b53c73580c5..bd809f4f1b82 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c

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

2021-01-27 Thread Yafang Shao
On Thu, Jan 28, 2021 at 10:35 AM Joe Perches wrote: > > On Thu, 2021-01-28 at 10:19 +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 3/3] printk: dump full information of page flags in pGp

2021-01-27 Thread Yafang Shao
On Thu, Jan 28, 2021 at 10:52 AM Miaohe Lin wrote: > > Hi: > On 2021/1/28 10:19, 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

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 6:42 PM Vlastimil Babka wrote: > > On 1/28/21 3:19 AM, 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: [PATCH 2/3] mm, slub: don't combine pr_err with INFO

2021-01-28 Thread Yafang Shao
On Thu, Jan 28, 2021 at 6:35 PM Vlastimil Babka wrote: > > On 1/28/21 3:19 AM, Yafang Shao wrote: > > It is strange to combine "pr_err" with "INFO", so let's clean them up. > > This patch is motivated by David's comment[1]. > >

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 8:11 PM Andy Shevchenko wrote: > > On Thu, Jan 28, 2021 at 10:19:47AM +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 0/3] mm, printk: dump full information of page flags in pGp

2021-01-28 Thread Yafang Shao
On Thu, Jan 28, 2021 at 8:12 PM Andy Shevchenko wrote: > > On Thu, Jan 28, 2021 at 10:19:44AM +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

[RFC PATCH v3 0/5] sched: support schedstats for RT sched class

2020-11-27 Thread Yafang Shao
ed_stat_runtime can also be supported in the future if it is helpful. Yafang Shao (5): sched: don't include stats.h in sched.h sched, fair: use __schedstat_set() in set_next_entity() sched: make struct sched_statistics independent of fair sched class sched: make schedstats helper

[RFC PATCH v3 1/5] sched: don't include stats.h in sched.h

2020-11-27 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/

[RFC PATCH v3 3/5] sched: make struct sched_statistics independent of fair sched class

2020-11-27 Thread Yafang Shao
. }; After the patch it is clearly that both of se or rt_se can easily get the sched_statistics by a task_struct or a task_group. Signed-off-by: Yafang Shao --- include/linux/sched.h| 3 +- kernel/sched/core.c | 24 --- kernel/sched/deadline.c | 4 +- kernel/sched/debug.c |

[RFC PATCH v3 2/5] sched, fair: use __schedstat_set() in set_next_entity()

2020-11-27 Thread Yafang Shao
schedstat_enabled() has been already checked, so we can use __schedstat_set() directly. Signed-off-by: Yafang Shao --- 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 8ff1daa3d9bb..7e7c03cede94 100644 --- a

[RFC PATCH v3 4/5] sched: make schedstats helpers independent of fair sched class

2020-11-27 Thread Yafang Shao
Gorman Signed-off-by: Yafang Shao --- kernel/sched/fair.c | 140 +++ kernel/sched/stats.c | 104 kernel/sched/stats.h | 32 ++ 3 files changed, 157 insertions(+), 119 deletions(-) diff --git a/kernel/sched/fair.c b

Re: [RFC PATCH v3 0/5] sched: support schedstats for RT sched class

2020-11-27 Thread Yafang Shao
On Sat, Nov 28, 2020 at 12:12 AM 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. This patch enable it for RT sched class > as well.

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

2020-11-20 Thread Yafang Shao
On Fri, Nov 20, 2020 at 10:39 AM jun qian wrote: > > Yafang Shao 于2020年11月19日周四 上午11:55写道: > > > > We want to measure the latency of RT tasks in our production > > environment with schedstat facility, but currently schedstat is only > > supported for fair sched clas

[bpf-next 0/2] cleanup SOCK_DEBUG() and introduce BPF_SOCK_OPS_STATS_CB

2019-02-12 Thread Yafang Shao
rnel.org/netconf2018_files/BrendanGregg_netconf2018.pdf Yafang Shao (2): tcp: replace SOCK_DEBUG() with tcp_stats() bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats() include/uapi/linux/bpf.h | 5 + include/uapi/linux/snmp.h | 3 +++ net/ipv4/proc.c | 3 +++ net/ipv4/tcp_input.c

[bpf-next 2/2] bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats()

2019-02-12 Thread Yafang Shao
igned-off-by: Yafang Shao --- include/uapi/linux/bpf.h | 5 + net/ipv4/tcp_input.c | 1 + 2 files changed, 6 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 1777fa0..0314ddd 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -2

[bpf-next 1/2] tcp: replace SOCK_DEBUG() with tcp_stats()

2019-02-12 Thread Yafang Shao
nk it is better to keep as-is, because if we return an errno to tell the application that this optname isn't supported for TCP, it may break the application. The application still can use this option but don't take any effect for TCP. Signed-off-by: Yafang Shao --- include/uapi/li

Re: [PATCH] writeback: expose cgroup info in trace_writeback_pages_written()

2019-03-19 Thread Yafang Shao
On Tue, Mar 19, 2019 at 6:40 PM Jan Kara wrote: > > On Sat 23-02-19 21:35:49, Yafang Shao wrote: > > With cgroup v2 writeback, we can know these pages are written from which > > cgroup. > > So expose the cgroup_ino for better tracking. > > > > Signed-off-by:

Re: [PATCH] Partially revert "mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones"

2019-08-16 Thread Yafang Shao
6a4c19d880 ("mm/memcontrol.c: keep local VM counters in sync with > the hierarchical ones") > Signed-off-by: Roman Gushchin > Cc: Yafang Shao > Cc: Johannes Weiner > --- > mm/memcontrol.c | 8 +++- > 1 file changed, 3 insertions(+), 5 deletions(-) > >

Re: [PATCH] Partially revert "mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones"

2019-08-17 Thread Yafang Shao
On Sun, Aug 18, 2019 at 3:14 AM Roman Gushchin wrote: > > On Sat, Aug 17, 2019 at 11:33:57AM +0800, Yafang Shao wrote: > > On Sat, Aug 17, 2019 at 8:47 AM Roman Gushchin wrote: > > > > > > Commit 766a4c19d880 ("mm/memcontrol.c: keep local VM counters in sy

Re: WARNINGs in set_task_reclaim_state with memory cgroup and full memory usage

2019-08-27 Thread Yafang Shao
l reclaim context. This context switch from global reclaim to memcg reclaim is very subtle change to the subsequent processing, that may cause some unexpected behavior. Anyway, we can send this patch as a standalong one. Feel free to add: Acked-by: Yafang Shao > > On Mon 26-08-19 12:55:21, Mic

Re: WARNINGs in set_task_reclaim_state with memory cgroup andfullmemory usage

2019-08-27 Thread Yafang Shao
On Sat, Aug 24, 2019 at 9:05 PM Hillf Danton wrote: > > > On Sat, 24 Aug 2019 16:15:38 +0800 Yafang Shao wrote: > > > > The memcg soft reclaim is called from kswapd reclam path and direct > > reclaim path, > > so why not pass the scan_control from the callsite i

Re: WARNINGs in set_task_reclaim_state with memory cgroup and full memory usage

2019-08-27 Thread Yafang Shao
On Tue, Aug 27, 2019 at 7:50 PM Michal Hocko wrote: > > On Tue 27-08-19 19:43:49, Yafang Shao wrote: > > On Tue, Aug 27, 2019 at 6:43 PM Michal Hocko wrote: > > > > > > If there are no objection to the patch I will post it as a standalong > > > one. > &

Re: WARNINGs in set_task_reclaim_state with memory cgroup and full memory usage

2019-08-27 Thread Yafang Shao
On Tue, Aug 27, 2019 at 8:03 PM Michal Hocko wrote: > > On Tue 27-08-19 19:56:16, Yafang Shao wrote: > > On Tue, Aug 27, 2019 at 7:50 PM Michal Hocko wrote: > > > > > > On Tue 27-08-19 19:43:49, Yafang Shao wrote: > > > > On Tue, A

Re: WARNINGs in set_task_reclaim_state with memory cgroup and full memory usage

2019-08-23 Thread Yafang Shao
On Sat, Aug 24, 2019 at 10:57 AM Hillf Danton wrote: > > > On Fri, 23 Aug 2019 18:00:15 -0400 Adric Blake wrote: > > Synopsis: > > A WARN_ON_ONCE is hit twice in set_task_reclaim_state under the > > following conditions: > > - a memory cgroup has been created and a task assigned it it > > - memory

Re: [PATCH] Partially revert "mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones"

2019-08-23 Thread Yafang Shao
patch. > > > > Let's keep per-memcg vmstat_local batched (they are only used for > > displaying stats to the userspace), but keep lruvec stats precise. > > This change fixes the dead memcg flooding on my setup. > > > > Fixes: 766a4c19d880 ("mm/mem

Re: WARNINGs in set_task_reclaim_state with memory cgroup and fullmemory usage

2019-08-24 Thread Yafang Shao
On Sat, Aug 24, 2019 at 12:51 PM Hillf Danton wrote: > > > On Sat, 24 Aug 2019 11:36:31 +0800 Yafang Shao wrote: > > On Sat, Aug 24, 2019 at 10:57 AM Hillf Danton wrote: > > > On Fri, 23 Aug 2019 18:00:15 -0400 Adric Blake wrote: > > > > Synopsis: &g

[PATCH v2] perf script python: integrate page reclaim analyze script

2019-09-30 Thread Yafang Shao
swapd_wake mm_vmscan_kswapd_sleep mm_vmscan_wakeup_kswapd mm_vmscan_lru_shrink_inactive mm_vmscan_writepage Signed-off-by: Yafang Shao Cc: Tony Jones Cc: Mel Gorman --- v1->v2: verified it with python2.7 and python3.6. add vmscan tracepoints comments in this script --

Re: [PATCH v2] perf script python: integrate page reclaim analyze script

2019-10-01 Thread Yafang Shao
On Tue, Oct 1, 2019 at 10:45 PM Mel Gorman wrote: > > On Mon, Sep 30, 2019 at 11:19:44PM -0400, Yafang Shao wrote: > > A new perf script page-reclaim is introduced in this patch. This new script > > is used to report the page reclaim details. The possible usage of this >

[PATCH 2/2] tracing, vmscan: add comments for perf script page-reclaim

2019-09-18 Thread Yafang Shao
well. So I add this comment for the new introduced page-reclaim script as a reminder. Signed-off-by: Yafang Shao --- include/trace/events/vmscan.h | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h ind

[PATCH 0/2] introduce new perf-script page-reclaim

2019-09-18 Thread Yafang Shao
regularly, another way is once we changes the definitions of tracepoints we must keep in mind that the perf scripts which are using these tracepoints must be changed as well. So I add some comment for the new introduced page-reclaim script as a reminder. Yafang Shao (2): perf script python: integ

[PATCH 1/2] perf script python: integrate page reclaim analyze script

2019-09-18 Thread Yafang Shao
swapd_wake mm_vmscan_kswapd_sleep mm_vmscan_wakeup_kswapd mm_vmscan_lru_shrink_inactive mm_vmscan_writepage Signed-off-by: Yafang Shao --- tools/perf/scripts/python/bin/page-reclaim-record | 2 + tools/perf/scripts/python/bin/page-reclaim-report | 4 + tools/perf/scripts/p

Re: [PATCH 1/2] perf script python: integrate page reclaim analyze script

2019-09-25 Thread Yafang Shao
On Thu, Sep 26, 2019 at 11:36 AM Tony Jones wrote: > > On 9/25/19 6:56 PM, Tony Jones wrote: > > On 9/18/19 7:38 AM, Yafang Shao wrote: > >> A new perf script page-reclaim is introduced in this patch. This new script > >> is used to report the page reclaim detai

Re: [PATCH 1/2] perf script python: integrate page reclaim analyze script

2019-09-25 Thread Yafang Shao
On Thu, Sep 26, 2019 at 9:56 AM Tony Jones wrote: > > On 9/18/19 7:38 AM, Yafang Shao wrote: > > A new perf script page-reclaim is introduced in this patch. This new script > > is used to report the page reclaim details. The possible usage of this > > script is as bellow

Re: [PATCH] Partially revert "mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones"

2019-08-19 Thread Yafang Shao
On Tue, Aug 20, 2019 at 5:20 AM Roman Gushchin wrote: > > On Sun, Aug 18, 2019 at 08:30:15AM +0800, Yafang Shao wrote: > > On Sun, Aug 18, 2019 at 3:14 AM Roman Gushchin wrote: > > > > > > On Sat, Aug 17, 2019 at 11:33:57AM +0800, Yafang Shao wrote: > > >

Re: [PATCH] memcg: oom: ignore oom warnings from memory.max

2020-05-04 Thread Yafang Shao
On Mon, May 4, 2020 at 3:03 PM Michal Hocko wrote: > > On Fri 01-05-20 09:39:24, Yafang Shao wrote: > > On Fri, May 1, 2020 at 2:27 AM Shakeel Butt wrote: > > > > > > Lowering memory.max can trigger an oom-kill if the reclaim does not > > > succeed. Howeve

Re: [PATCH] memcg: oom: ignore oom warnings from memory.max

2020-05-04 Thread Yafang Shao
On Mon, May 4, 2020 at 3:35 PM Michal Hocko wrote: > > On Mon 04-05-20 15:26:52, Yafang Shao wrote: > > On Mon, May 4, 2020 at 3:03 PM Michal Hocko wrote: > > > > > > On Fri 01-05-20 09:39:24, Yafang Shao wrote: > > > > On Fri,

Re: [PATCH] memcg: oom: ignore oom warnings from memory.max

2020-05-04 Thread Yafang Shao
On Mon, May 4, 2020 at 11:36 PM Shakeel Butt wrote: > > On Mon, May 4, 2020 at 8:00 AM Michal Hocko wrote: > > > > On Mon 04-05-20 07:53:01, Shakeel Butt wrote: > > > On Mon, May 4, 2020 at 7:11 AM Michal Hocko wrote: > > > > > > > > On Mon 04-05-20 06:54:40, Shakeel Butt wrote: > > > > > On Sun

Re: [PATCH 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection

2020-04-29 Thread Yafang Shao
On Thu, Apr 30, 2020 at 9:46 AM Chris Down wrote: > > Yafang Shao writes: > >My concern is why we add these barriers to memcg protection > >specifically but don't add these barriers to the other memebers like > >memcg->oom_group which has the same issue ? > &g

Re: [PATCH 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection

2020-04-30 Thread Yafang Shao
On Thu, Apr 30, 2020 at 10:57 PM Michal Hocko wrote: > > On Wed 29-04-20 12:56:27, Johannes Weiner wrote: > [...] > > I think to address this, we need a more comprehensive solution and > > introduce some form of serialization. I'm not sure yet how that would > > look like yet. > > Yeah, that is wh

Re: [PATCH] memcg: oom: ignore oom warnings from memory.max

2020-04-30 Thread Yafang Shao
On Fri, May 1, 2020 at 2:27 AM Shakeel Butt wrote: > > Lowering memory.max can trigger an oom-kill if the reclaim does not > succeed. However if oom-killer does not find a process for killing, it > dumps a lot of warnings. > I have been confused by this behavior for several months and I think it

Re: [PATCH] memcg: oom: ignore oom warnings from memory.max

2020-04-30 Thread Yafang Shao
On Fri, May 1, 2020 at 10:04 AM Shakeel Butt wrote: > > On Thu, Apr 30, 2020 at 6:39 PM Yafang Shao wrote: > > > > On Fri, May 1, 2020 at 2:27 AM Shakeel Butt wrote: > > > > > > Lowering memory.max can trigger an oom-kill if the reclaim does not > >

Re: [PATCH 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection

2020-04-29 Thread Yafang Shao
On Wed, Apr 29, 2020 at 6:15 PM Michal Hocko wrote: > > On Tue 28-04-20 19:26:47, Chris Down wrote: > > From: Yafang Shao > > > > A cgroup can have both memory protection and a memory limit to isolate > > it from its siblings in both directions - for example, to pr

Re: [PATCH 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection

2020-04-29 Thread Yafang Shao
On Wed, Apr 29, 2020 at 10:03 PM Johannes Weiner wrote: > > On Wed, Apr 29, 2020 at 12:15:10PM +0200, Michal Hocko wrote: > > On Tue 28-04-20 19:26:47, Chris Down wrote: > > > From: Yafang Shao > > > > > > A cgroup can have both memory protection and a me

Re: [PATCH 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection

2020-04-29 Thread Yafang Shao
On Wed, Apr 29, 2020 at 10:27 PM Johannes Weiner wrote: > > On Wed, Apr 29, 2020 at 10:17:21PM +0800, Yafang Shao wrote: > > On Wed, Apr 29, 2020 at 10:03 PM Johannes Weiner wrote: > > > > > > On Wed, Apr 29, 2020 at 12:15:10PM +0200, Michal Hocko wrote: > >

Re: [PATCH 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection

2020-04-29 Thread Yafang Shao
On Wed, Apr 29, 2020 at 2:26 AM Chris Down wrote: > > From: Yafang Shao > > A cgroup can have both memory protection and a memory limit to isolate > it from its siblings in both directions - for example, to prevent it > from being shrunk below 2G under high pressure from outsid

Re: [PATCH 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection

2020-04-29 Thread Yafang Shao
On Thu, Apr 30, 2020 at 9:16 AM Chris Down wrote: > > Hi Yafang, > > Yafang Shao writes: > >Would you pls. add some comments above these newly added WRITE_ONCE() ? > >E.g. > >What does them mean to fix ? > >Why do we must add WRITE_ONCE() and READ_ONCE

Re: [PATCH] mm: vmscan: correct nr_reclaimed for THP

2019-05-10 Thread Yafang Shao
On Sat, May 11, 2019 at 12:36 AM Matthew Wilcox wrote: > > On Fri, May 10, 2019 at 10:12:40AM +0800, Huang, Ying wrote: > > > + nr_reclaimed += (1 << compound_order(page)); > > > > How about to change this to > > > > > > nr_reclaimed += hpage_nr_pages(page); > > Please don't. Th

Re: [PATCH] mm/vmscan.c: drop all inode/dentry cache from LRU

2019-05-24 Thread Yafang Shao
On Fri, May 24, 2019 at 4:06 PM Sahitya Tummala wrote: > > This is important for the scenario where FBE (file based encryption) > is enabled. With FBE, the encryption context needed to en/decrypt a file > will be stored in inode and any inode that is left in the cache after > drop_caches is done w

Re: [bpf-next 1/2] tcp: replace SOCK_DEBUG() with tcp_stats()

2019-02-12 Thread Yafang Shao
On Tue, Feb 12, 2019 at 11:07 PM Eric Dumazet wrote: > > > > On 02/12/2019 03:31 AM, Yafang Shao wrote: > > SOCK_DEBUG is a very ancient debugging interface, and it's not very useful > > for debugging. > > So this patch removes the SOCK_DEBUG() and introduc

Re: [bpf-next 2/2] bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats()

2019-02-12 Thread Yafang Shao
On Tue, Feb 12, 2019 at 11:11 PM Eric Dumazet wrote: > > > > On 02/12/2019 03:31 AM, Yafang Shao wrote: > > Introuce this new op BPF_SOCK_OPS_STATS_CB for tcp_stats() such that it > > can be traced via BPF on a per socket basis. > > There's one argument in BP

Re: [bpf-next 1/2] tcp: replace SOCK_DEBUG() with tcp_stats()

2019-02-12 Thread Yafang Shao
On Wed, Feb 13, 2019 at 10:15 AM Eric Dumazet wrote: > > On Tue, Feb 12, 2019 at 6:07 PM Yafang Shao wrote: > > > > > Let me explain the background for you. > > I want to track some TCP abnormal behavior in TCP/IP stack. But I > > find there's no good way

Re: [bpf-next 1/2] tcp: replace SOCK_DEBUG() with tcp_stats()

2019-02-12 Thread Yafang Shao
On Wed, Feb 13, 2019 at 10:49 AM Alexei Starovoitov wrote: > > On Tue, Feb 12, 2019 at 6:15 PM Eric Dumazet wrote: > > > > Do not add more debugging stuff unless you can demonstrate > > they actually allowed you to find a real bug and that you sent a > > public fix for it. > > > > Just adding "co

[PATCH] writeback: expose cgroup info in trace_writeback_pages_written()

2019-02-23 Thread Yafang Shao
With cgroup v2 writeback, we can know these pages are written from which cgroup. So expose the cgroup_ino for better tracking. Signed-off-by: Yafang Shao --- fs/fs-writeback.c| 4 ++-- include/trace/events/writeback.h | 9 ++--- 2 files changed, 8 insertions(+), 5 deletions

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

2019-03-25 Thread Yafang Shao
ace/events/sched.h. - rcu When CONFIG_RCU_TRACE is not set, some rcu tracepoints are define as do-nothing macro without validating arguments, that is not proper. We should validate the arguments. Yafang Shao (3): tracing: introduce TRACE_EVENT_NONE() sched/fair: do not expose some tracepoints

[PATCH 1/3] tracing: introduce TRACE_EVENT_NONE()

2019-03-25 Thread Yafang Shao
Sometimes we want define a tracepoint as a do-nothing function. So I introduce this TRACE_EVENT_NONE() for this kind of usage. Signed-off-by: Yafang Shao --- include/linux/tracepoint.h | 8 include/trace/define_trace.h | 4 2 files changed, 12 insertions(+) diff --git a/include

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

2019-03-25 Thread Yafang Shao
When CONFIG_RCU_TRACE is not set, all these tracepoints are define 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 2/3] sched/fair: do not expose some tracepoints to user if CONFIG_SCHEDSTATS is not set

2019-03-25 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 | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/trace/events/sched.h b/include

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

2019-03-25 Thread Yafang Shao
On Tue, Mar 26, 2019 at 10:21 AM Steven Rostedt wrote: > > On Tue, 26 Mar 2019 09:40:06 +0800 > Yafang Shao wrote: > > > The tracepoints trace_sched_stat_{iowait, blocked, wait, sleep} should > > be not exposed to user if CONFIG_SCHEDSTATS is not set. > >

Re: [PATCH 0/3] tracing: introduce TRACE_EVENT_NONE and use it

2019-03-25 Thread Yafang Shao
On Tue, Mar 26, 2019 at 10:17 AM Steven Rostedt wrote: > > On Tue, 26 Mar 2019 09:40:04 +0800 > Yafang Shao wrote: > > > In this patchset, I introduce a new macro TRACE_EVENT_NONE(), which will > > define a tracepoint as a do-nothing inline function. > >

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

2019-03-03 Thread Yafang Shao
git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Yafang-Shao/mm-compaction-show-gfp-flag-names-in-try_to_compact_pages-tracepoint/20190302-212241 > reproduce: > # apt-get install sparse > make A

[PATCH] sched: fair: fix missed CONFIG_SCHEDSTATS

2019-03-06 Thread Yafang Shao
d the reason is that CONFIG_SCHEDSTATS is not set. To avoid such kind of confusion, we should not expose these tracepoints if CONFIG_SCHEDSTATS is not set. Signed-off-by: Yafang Shao --- include/trace/events/sched.h | 3 ++- kernel/sched/fair.c | 13 - 2 files changed, 14 i

Re: [PATCH] sched: fair: fix missed CONFIG_SCHEDSTATS

2019-03-06 Thread Yafang Shao
On Wed, Mar 6, 2019 at 6:09 PM Peter Zijlstra wrote: > > On Wed, Mar 06, 2019 at 04:43:46PM +0800, Yafang Shao wrote: > > When I'm using trace_sched_stat_{iowait, blocked, wait, sleep} to > > measure how long the processes are stalled, there's always no output from &

Re: [PATCH] sched: fair: fix missed CONFIG_SCHEDSTATS

2019-03-06 Thread Yafang Shao
On Wed, Mar 6, 2019 at 7:27 PM Peter Zijlstra wrote: > > On Wed, Mar 06, 2019 at 06:15:39PM +0800, Yafang Shao wrote: > > On Wed, Mar 6, 2019 at 6:09 PM Peter Zijlstra wrote: > > > > > > On Wed, Mar 06, 2019 at 04:43:46PM +0800, Yafang Shao wrote: > > > &g

Re: [PATCH] sched: fair: fix missed CONFIG_SCHEDSTATS

2019-03-06 Thread Yafang Shao
On Wed, Mar 6, 2019 at 8:38 PM Peter Zijlstra wrote: > > On Wed, Mar 06, 2019 at 07:49:36PM +0800, Yafang Shao wrote: > > > $ grep SCHEDSTAT defconfig-build/.config > # CONFIG_SCHEDSTATS is not set > $ obbjdump -dr defconfig-build/kernel/sched/fair.o | awk '/>:$/ { F

Re: [PATCH] sched: fair: fix missed CONFIG_SCHEDSTATS

2019-03-06 Thread Yafang Shao
On Wed, Mar 6, 2019 at 8:53 PM Yafang Shao wrote: > > On Wed, Mar 6, 2019 at 8:38 PM Peter Zijlstra wrote: > > > > On Wed, Mar 06, 2019 at 07:49:36PM +0800, Yafang Shao wrote: > > > > > > $ grep SCHEDSTAT defconfig-build/.config > > # CONFIG_SCHEDSTA

Re: [PATCH] sched: fair: fix missed CONFIG_SCHEDSTATS

2019-03-07 Thread Yafang Shao
On Thu, Mar 7, 2019 at 5:55 PM Peter Zijlstra wrote: > > On Thu, Mar 07, 2019 at 03:49:58PM +0800, Yafang Shao wrote: > > What about your opinon ? > > > > > > diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h > > index 9a4bdfa..a0291f2 1

[PATCH v2] sched: fair: fix missed CONFIG_SCHEDSTATS

2019-03-07 Thread Yafang Shao
d the reason is that CONFIG_SCHEDSTATS is not set. To avoid such kind of confusion, we should not expose these tracepoints if CONFIG_SCHEDSTATS is not set. Signed-off-by: Yafang Shao --- include/trace/events/sched.h | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-

Re: [PATCH net-next] tcp: expose sk_state in tcp_retransmit_skb tracepoint

2018-09-24 Thread Yafang Shao
On Mon, Sep 24, 2018 at 5:42 AM, Eric Dumazet wrote: > > > On 09/23/2018 12:49 PM, Yafang Shao wrote: >> With sk_state, we can know whether this connection is in SYN_SENT state >> or ESTBLISHED state. >> The reason to distinguish between these two scenario is th

Re: [PATCH net-next] net: init sk_cookie for inet socket

2018-04-23 Thread Yafang Shao
On Tue, Apr 24, 2018 at 12:09 AM, Eric Dumazet wrote: > > > On 04/23/2018 08:58 AM, David Miller wrote: >> From: Yafang Shao >> Date: Sun, 22 Apr 2018 21:50:04 +0800 >> >>> With sk_cookie we can identify a socket, that is very helpful for >>> tracein

Re: [PATCH net-next] net: init sk_cookie for inet socket

2018-04-24 Thread Yafang Shao
On Tue, Apr 24, 2018 at 7:41 PM, Eric Dumazet wrote: > > > On 04/23/2018 09:39 PM, Yafang Shao wrote: >> On Tue, Apr 24, 2018 at 12:09 AM, Eric Dumazet >> wrote: >>> >>> >>> On 04/23/2018 08:58 AM, David Miller wrote: >>>> F

<    1   2   3   4   >