[PATCH v2 2/2] mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over vmas

2021-04-06 Thread yanfei . xu
From: Yanfei Xu We could check MMF_DISABLE_THP ahead of iterating over all of vma. Otherwise if some mm_struct contain a large number of vma, there will be amounts meaningless cpu cycles cost. Signed-off-by: Yanfei Xu --- mm/khugepaged.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a

[PATCH v2 1/2] mm: khugepaged: use macro to align addresses

2021-04-06 Thread yanfei . xu
From: Yanfei Xu We could use macro to deal with the addresses which need to be aligned to improve readability of codes. Signed-off-by: Yanfei Xu --- mm/khugepaged.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/mm/khugepaged.c b/mm

[PATCH v2 0/2] mm: khugepaged: cleanup and a minor tuning in THP

2021-04-06 Thread yanfei . xu
From: Yanfei Xu v1-->v2: 1.correct the wrong location where the goto jump to. 2.keep the cond_resched() dropped in v1 still there. Thanks for Yang's review. Yanfei Xu (2): mm: khugepaged: use macro to align addresses mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over v

[PATCH 2/2] mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over vmas

2021-04-04 Thread yanfei . xu
From: Yanfei Xu We could check MMF_DISABLE_THP ahead of iterating over all of vma. Otherwise if some mm_struct contain a large number of vma, there will be amounts meaningless cpu cycles cost. BTW, drop an unnecessary cond_resched(), because there is a another cond_resched() followed it and no

[PATCH 1/2] mm: khugepaged: use macro to align addresses

2021-04-04 Thread yanfei . xu
From: Yanfei Xu We could use macro to deal with the addresses which need to be aligned to improve readability of codes. Signed-off-by: Yanfei Xu --- mm/khugepaged.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mm/khugepaged.c b/mm

[PATCH 0/2] mm: khugepaged: cleanup and a minor tuning in THP

2021-04-04 Thread yanfei . xu
From: Yanfei Xu Yanfei Xu (2): mm: khugepaged: use macro to align addresses mm: khugepaged: check MMF_DISABLE_THP ahead of iterating over vmas mm/khugepaged.c | 31 --- 1 file changed, 16 insertions(+), 15 deletions(-) -- 2.27.0

[PATCH] block: export disk_part_iter_* helpers

2021-03-26 Thread yanfei . xu
From: Yanfei Xu disk_part_iter_* helpers might be used by other external modules, like lttng-modules. But it was unexport in 'commit bc359d03c7ec ("block: add a disk_uevent helper")'. Here export them again. Signed-off-by: Yanfei Xu --- block/genhd.c | 3 +++ 1 file c

[PATCH] khugepaged: Raplace barrier() with READ_ONCE() for a selective variable

2021-03-23 Thread yanfei . xu
From: Yanfei Xu READ_ONCE() is more selective and lightweight. It is more appropriate that using a READ_ONCE() for the certain variable to prevent the compiler from reordering. Signed-off-by: Yanfei Xu --- mm/khugepaged.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a

[PATCH] block: fix possible bd_size_lock deadlock

2021-03-11 Thread yanfei . xu
From: Yanfei Xu bd_size_lock spinlock could be taken in block softirq, thus we should disable the softirq before taking the lock. WARNING: inconsistent lock state 5.12.0-rc2-syzkaller #0 Not tainted inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-R} usage. kworker

[PATCH] mm/hugetlb: remove duplicate codes of setting compound_nr

2021-02-02 Thread yanfei . xu
From: Yanfei Xu set_compound_order() set both of page's compound_order and compound_nr. It's no need to assign to compound_nr again, so remove it. Signed-off-by: Yanfei Xu --- mm/hugetlb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index a3

[PATCH v2] mm/hugetlb: remove redundant check in preparing and destroying gigantic page

2021-02-02 Thread yanfei . xu
From: Yanfei Xu Gigantic page is a compound page and its order is more than 1. Thus it must be available for hpage_pincount. Let's remove the redundant check for gigantic page. Signed-off-by: Yanfei Xu --- mm/hugetlb.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --

[PATCH] mm/hugetlb: remove a meaningless if statement in gigantic page initialization

2021-02-02 Thread yanfei . xu
From: Yanfei Xu Gigantic page is a compound page and its order is more than 1. Thus it must be available for hpage_pincount. Let's remove this meaningless if statement. Signed-off-by: Yanfei Xu --- mm/hugetlb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git

[PATCH] kthread: remove comments about old _do_fork() helper

2021-01-11 Thread yanfei . xu
From: Yanfei Xu The old _do_fork() helper has been removed in favor of kernel_clone(). Here correct some comments which still contain _do_fork() Signed-off-by: Yanfei Xu --- include/trace/events/sched.h | 2 +- kernel/kthread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions

[PATCH v3] mm/compaction: Rename 'start_pfn' to 'iteration_start_pfn' in compact_zone()

2020-10-19 Thread yanfei . xu
From: Yanfei Xu There are two 'start_pfn' declared in compact_zone() which have different meaning. Rename the second one to 'iteration_start_pfn' to prevent confusion. BTW, remove an useless semicolon. Signed-off-by: Yanfei Xu Acked-by: David Hildenbrand Acked-by: Vlast

[PATCH v2] mm/compaction: Rename 'start_pfn' to 'iteration_start_pfn' in compact_zone()

2020-10-19 Thread yanfei . xu
From: Yanfei Xu There are two 'start_pfn' declared in compact_zone() which have different meaning. Rename the second one to 'iteration_start_pfn' to prevent trace_mm_compaction_end() from tracing an undesirable value. BTW, remove an useless semicolon. Acked-by: David H

[PATCH] mm/compaction: Remove some useless code in compact_zone()

2020-10-14 Thread yanfei . xu
From: Yanfei Xu start_pfn has been declared at the begin of compact_zone(), it's no need to declare it again. And remove an useless semicolon. Signed-off-by: Yanfei Xu --- mm/compaction.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/compaction.c b/mm/compact

[PATCH] Bluetooth: Use lock_sock() when acquiring lock in sco_conn_del

2020-10-14 Thread yanfei . xu
From: Yanfei Xu Locking slock-AF_BLUETOOTH-BTPROTO_SCO may happen in process context or BH context. If in process context, we should use lock_sock(). As blow warning, sco_conn_del() is called in process context, so let's use lock_sock() instead of bh_lock