Hi Michal
>On Sun 09-06-19 17:10:28, ChenGang wrote:
>> Usually the value of min_free_kbytes is multiply of 4, and in this
>> case ,the right shift is ok.
>> But if it's not, the right-shifting operation will lose the low 2
>> bits, and this cause kernel don
Hi Wei Yang
>On Sun, Jun 09, 2019 at 05:10:28PM +0800, ChenGang wrote:
>>Usually the value of min_free_kbytes is multiply of 4, and in this case
>>,the right shift is ok.
>>But if it's not, the right-shifting operation will lose the low 2 bits,
>But PAGE_SHIFT is no
tiply of 4.
For example, if min_free_kbytes is 64, then should keep 16 pages,
but if min_free_kbytes is 65 or 66, then should keep 17 pages.
Signed-off-by: ChenGang
---
mm/page_alloc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d
From: Chen Gang
Use tab instead of 4 white spaces for indent, and remove redundant empty
line.
Put constant macro definition before structure definition, so that the
structure definition can use the constant macro, e.g. ADFS_DR_SIZE.
And still left hardcode number "52" for unused52, since the n
From: Chen Gang
In api itself, kernel does not use it -- it is divided into ac_etime_hi
and ac_etime_lo. So kernel side only need generate the correct
ac_etime_hi and ac_etime_lo, but need not know about comp2_t.
At present, kernel use normal u64 type for it, when kernel provdes it to
outside, k
From: Chen Gang
For migrate_misplaced_page and migrate_misplaced_transhuge_page, they
are pure Boolean functions and are also used as pure Boolean functions,
but the related dummy functions return -EAGAIN.
Also change their related pure Boolean function numamigrate_isolate_page.
For variable is
From: Chen Gang
Also use the same changing to asm-generic, and also use bool variable
instead of int variable for mips, mn10300, parisc and tile related
functions, and also avoid checkpatch.pl to report ERROR.
Include linux/types.h for alpha, arm, arm64, m68k, and openrisc to pass
building.
Ori
From: Chen Gang
Also use the same changing to asm-generic, and also use bool variable
instead of int variable for mips, mn10300, parisc and tile related
functions, and also avoid checkpatch.pl to report ERROR.
Originally, except powerpc and xtensa, all another architectures intend
to return 0 or
From: Chen Gang
For pure bool function's return value, bool is a little better more or
less than int.
Signed-off-by: Chen Gang
---
arch/powerpc/include/asm/mman.h | 8
include/linux/mman.h| 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/i
From: Chen Gang
For a pure output parameter:
- When callee fails, the caller should not assume the output parameter
is still valid.
- And callee should not assume the pure output parameter must be
provided by caller -- caller has right to pass NULL when caller does
not care about it.
From: Chen Gang
For pure bool function's return value, bool is a little better more or
less than int.
And return boolean result directly. Since 'if' statement is also for
boolean checking, and return boolean result, too.
Signed-off-by: Chen Gang
---
arch/powerpc/include/asm/mman.h | 8 +++
From: Chen Gang
For pure bool function's return value, bool is a little better more or
less than int.
And return boolean result directly, since 'if' statement is also for
boolean checking, and return boolean result, too.
Signed-off-by: Chen Gang
---
include/linux/migrate.h | 4 ++--
mm/compac
From: Chen Gang
When use pr_warn(), it will break building because of mod undefined, so
fix it just like another architectures have done.
Signed-off-by: Chen Gang
---
arch/blackfin/kernel/module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/blackfin/kernel/module.c
From: Chen Gang
Use one return statement instead of multiple statements, since the new
return statement is still simple enough.
Let the second line function parameter almost align with the first line
function parameter.
Signed-off-by: Chen Gang
---
include/linux/mempolicy.h | 18 ++---
From: Chen Gang
Use one line instead of two lines for pgdat_resize_init, since one line
is still within 80 columns.
Let the second line function parameter almost align with the first line
parameter.
Use pr_warn instead of printk, so also let the line within 80 columns.
Signed-off-by: Chen Gang
From: Chen Gang
Merge several statements to one return statement, since the new return
statement is still simple enough.
Try to let the second line function parameters almost align with the
first line parameter (try to be within 80 columns, and in one line).
The comments can fully use 80 column
From: Chen Gang
Correct the function parameters alignment, since original code already
use both tabs and white spaces together for the incorrect parameters
alignment functions.
If one line can hold one statement within 80 columns, let it in one line
(original code did not consider about the tabs
From: Chen Gang
Correct the function parameters alignment, since original code already
use both tabs and white spaces together for the incorrect parameters
alignment functions.
If one line can hold one statement within 80 columns, let it in one line
(original code did not consider about the tabs
From: Chen Gang
khugepaged_enabled() can be treated as khugepaged_always() or
khugepaged_req_madv(). The compiler will always treat it as "and 3".
khugepaged_enter() can return __khugepaged_enter() result directly,
since __khugepaged_enter() will return 0 or -ENOMEM.
Signed-off-by: Chen Gang
-
From: Chen Gang
According to kasan_[dis|en]able_current() comments and the kasan_depth'
s initialization, if kasan_depth is zero, it means disable.
So need use "!!kasan_depth" instead of "!kasan_depth" for checking
enable.
Signed-off-by: Chen Gang
---
mm/kasan/kasan.h | 2 +-
1 file changed,
From: Chen Gang
According to their comments and the kasan_depth's initialization, if
kasan_depth is zero, it means disable. So kasan_depth need consider
about the 0 overflow.
Also remove useless comments for dummy kasan_slab_free().
Signed-off-by: Chen Gang
---
include/linux/kasan.h | 8 -
From: Chen Gang
It is used as a pure bool function within kernel source wide.
Signed-off-by: Chen Gang
---
include/linux/hugetlb.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index e44c578..0f735ea 100644
--- a/inc
From: Chen Gang
Macro HUGETLBFS_SB is clearer enough, so one statement is clearer than
3 lines statements.
Remove redundant return statements for non-return functions, which can
save lines, at least.
Signed-off-by: Chen Gang
---
include/linux/hugetlb.h| 4 +---
include/linux/hugetlb_c
From: Chen Gang
The return value of pmd_trans_huge_lock() is a pointer, not a boolean
value, so use NULL instead of false as the return value.
Signed-off-by: Chen Gang
---
include/linux/huge_mm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/huge_mm.h b/incl
From: Chen Gang
Always notice about 80 columns, and the white space near '|'.
Let the wrapped function parameters align as the same styles.
Remove redundant statement "enum zone_type z;" in function gfp_zone.
Signed-off-by: Chen Gang
---
include/linux/gfp.h | 35 -
From: Chen Gang
hlist_bl_unhashed() and hlist_bl_empty() are all boolean functions, so
return bool instead of int.
Signed-off-by: Chen Gang
---
include/linux/list_bl.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h
inde
From: Chen Gang
Let cleancache_fs_enabled() call cleancache_fs_enabled_mapping()
directly.
Remove redundant variable ret in cleancache_get_page().
Signed-off-by: Chen Gang
---
include/linux/cleancache.h | 14 ++
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/include
From: Chen Gang
The related warning:
LD mm/built-in.o
WARNING: mm/built-in.o(.text.unlikely+0x155d): Section mismatch in reference
from the function movable_node_is_enabled() to the variable
.meminit.data:movable_node_enabled
The function movable_node_is_enabled() references
the
From: Chen Gang
The related warning from gcc 6.0:
arch/x86/kernel/ptrace.c:127:18: warning: ‘arg_offs_table’ defined but not
used [-Wunused-const-variable]
static const int arg_offs_table[] = {
^~
Signed-off-by: Chen Gang
---
arch/x86/kernel/ptrace.c | 15
From: Chen Gang
The related warning from gcc 6.0:
In file included from kernel/rcu/tree.c:4630:0:
kernel/rcu/tree_plugin.h:810:40: warning: ‘rcu_data_p’ defined but not used
[-Wunused-const-variable]
static struct rcu_data __percpu *const rcu_data_p = &rcu_sched_data;
From: Chen Gang
It is architecture specific mechanism header, not generic header, so
move it to arch/x86/include/asm.
ALso change all related contents for it.
Signed-off-by: Chen Gang
---
MAINTAINERS | 2 +-
{include/linux => arch/x86/include/asm}/amd-i
31 matches
Mail list logo