"lib: rework bitmap_parse()" triggers invalid access errors

2019-05-30 Thread Qian Cai
The linux-next commit "lib: rework bitmap_parse" triggers errors below during boot on both arm64 and powerpc with KASAN_SW_TAGS or SLUB_DEBUG enabled. Reverted the commit and its dependency (lib: opencode in_str()) fixed the issue. [   67.056867][ T3737] BUG kmalloc-16 (Tainted: GB   

[PATCH] mm/z3fold: fix variable set but not used warnings

2019-05-30 Thread Qian Cai
: variable 'bud' set but not used [-Wunused-but-set-variable] It does not seem those variables are actually used, so just remove them. Signed-off-by: Qian Cai --- mm/z3fold.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 2bc3dbde6255..67c29101ffc5 10064

[PATCH] block: fix a crash in do_task_dead()

2019-05-29 Thread Qian Cai
add polled wakeup task helper") Signed-off-by: Qian Cai --- include/linux/blkdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 592669bcc536..290eb7528f54 100644 --- a/include/linux/blkdev.h +++ b/include/linux/

[PATCH] mm/page_io: fix a crash in do_task_dead()

2019-05-29 Thread Qian Cai
offensive commit, wake_up_process() will prevent this from happening by taking the pi_lock and bail out immediately if TASK_DEAD is set. if (!(p->state & TASK_NORMAL)) goto out; Fixes: 0619317ff8ba ("block: add polled wakeup task helper") Signed-off-by: Qian Cai --- m

Re: [PATCH] sched/fair: fix variable "done" set but not used

2019-05-26 Thread Qian Cai
> On May 26, 2019, at 7:56 PM, Valentin Schneider > wrote: > > Hi, > > On 25/05/2019 17:18, Qian Cai wrote: >> The commit f643ea220701 ("sched/nohz: Stop NOHZ stats when decayed") >> introduced a compilation warning if CONFIG_NO_HZ_COMMON=n,

[PATCH] sched/fair: fix variable "done" set but not used

2019-05-25 Thread Qian Cai
able] Fix it by adding a couple of "ifdef" macros as the variable is only needed when CONFIG_NO_HZ_COMMON=y. Signed-off-by: Qian Cai --- kernel/sched/fair.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f35930f5e528.

[tip:sched/core] sched/core: Clean up sched_init() a bit

2019-05-24 Thread tip-bot for Qian Cai
Commit-ID: 8d2bd61bd89260d5da5eaef7cf264587f19a7e0d Gitweb: https://git.kernel.org/tip/8d2bd61bd89260d5da5eaef7cf264587f19a7e0d Author: Qian Cai AuthorDate: Wed, 22 May 2019 14:20:06 -0400 Committer: Ingo Molnar CommitDate: Fri, 24 May 2019 08:57:29 +0200 sched/core: Clean up

[PATCH] powerpc/powernv: fix variable "c" set but not used

2019-05-22 Thread Qian Cai
pnv_npu2_handle_fault(), arch/powerpc/platforms/powernv/npu-dma.c: In function 'pnv_npu2_handle_fault': arch/powerpc/platforms/powernv/npu-dma.c:1122:7: warning: variable 'c' set but not used [-Wunused-but-set-variable] Fixed it by appending the __maybe_unused attribute, so compilers would ignor

[PATCH] sched: fix "runnable_avg_yN_inv" not used warnings

2019-05-22 Thread Qian Cai
, from kernel/sched/deadline.c:19: kernel/sched/sched-pelt.h:4:18: warning: 'runnable_avg_yN_inv' defined but not used [-Wunused-const-variable=] Fixed it by appending the __maybe_unused attribute for it, so all generated variables and macros can still be kept in the same file. Signed-off-by: Qian

[PATCH] sched: fix a compilation warning in sched_init()

2019-05-22 Thread Qian Cai
; ^~~ Use this opportunity to tidy up a code a bit by removing unnecssary indentations and lines. Signed-off-by: Qian Cai --- kernel/sched/core.c | 31 --- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/kernel/sched/core.c b/kernel

[PATCH] powerpc/powernv: fix a W=1 compilation warning

2019-05-22 Thread Qian Cai
the unused variable to avoid a compilation warning, arch/powerpc/platforms/powernv/npu-dma.c: In function 'pnv_npu_dma_set_32': arch/powerpc/platforms/powernv/npu-dma.c:198:10: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] Signed-off-by: Qian Cai --- arch/powerpc/platforms/p

[PATCH -next] kvm: fix compilation errors with mem[re|un]map()

2019-05-17 Thread Qian Cai
eclaration] memunmap(map->hva); Fixed it by including io.h in kvm_main.c. Signed-off-by: Qian Cai --- virt/kvm/kvm_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8d83a787fd6b..5c5102799c2c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/k

[PATCH] slab: remove /proc/slab_allocators

2019-05-16 Thread Qian Cai
Suggested-by: Vlastimil Babka Suggested-by: Linus Torvalds Signed-off-by: Qian Cai --- include/linux/slab_def.h | 3 - lib/Kconfig.debug| 4 - mm/slab.c| 226 +-- 3 files changed, 1 insertion(+), 232 deletions(-) diff --git a/inc

[PATCH] nvdimm: fix compilation warnings with W=1

2019-05-16 Thread Qian Cai
e: 'struct attribute_group nd_numa_attribute_group = ' Those are just some member assignments for the "struct attribute_group" instances and it can't be expressed in the kernel-doc. Reviewed-by: Vishal Verma Signed-off-by: Qian Cai --- drivers/nvdimm/bus.c | 4 ++-- drivers/nvdimm/label.c |

Re: [RESEND PATCH] nvdimm: fix some compilation warnings

2019-05-15 Thread Qian Cai
>>} >> >> diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c >> index 7ff684159f29..2eb6a6cfe9e4 100644 >> --- a/drivers/nvdimm/bus.c >> +++ b/drivers/nvdimm/bus.c >> @@ -642,7 +642,7 @@ static struct attribute *nd_device_attributes[] = { >>NULL, >> }; >> >> -/**

Re: [RESEND PATCH] nvdimm: fix some compilation warnings

2019-05-15 Thread Qian Cai
> On May 15, 2019, at 7:25 PM, Dan Williams wrote: > > On Tue, May 14, 2019 at 8:08 AM Qian Cai wrote: >> >> Several places (dimm_devs.c, core.c etc) include label.h but only >> label.c uses NSINDEX_SIGNATURE, so move its definition to label.c >> instead.

[RESEND PATCH] nvdimm: fix some compilation warnings

2019-05-14 Thread Qian Cai
wed-by: Vishal Verma Signed-off-by: Qian Cai --- drivers/nvdimm/btt.c | 6 ++ drivers/nvdimm/bus.c | 4 ++-- drivers/nvdimm/label.c | 2 ++ drivers/nvdimm/label.h | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index 467177

[RESEND PATCH] slab: skip kmemleak_object in leaks_show()

2019-05-14 Thread Qian Cai
much new information compared with slabinfo. Just skip it. Signed-off-by: Qian Cai --- mm/slab.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/slab.c b/mm/slab.c index 20f318f4f56e..85d1d223f879 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -4285,6 +4285,15 @@ static int leaks_show

Re: [PATCH -next v2] mm/hotplug: fix a null-ptr-deref during NUMA boot

2019-05-13 Thread Qian Cai
On Mon, 2019-05-13 at 16:04 +0200, Michal Hocko wrote: > On Mon 13-05-19 09:43:59, Qian Cai wrote: > > On Mon, 2019-05-13 at 14:41 +0200, Michal Hocko wrote: > > > On Sun 12-05-19 01:48:29, Qian Cai wrote: > > > > The linux-next commit ("x86, numa: always in

Re: [PATCH -next v2] mm/hotplug: fix a null-ptr-deref during NUMA boot

2019-05-13 Thread Qian Cai
On Mon, 2019-05-13 at 14:41 +0200, Michal Hocko wrote: > On Sun 12-05-19 01:48:29, Qian Cai wrote: > > The linux-next commit ("x86, numa: always initialize all possible > > nodes") introduced a crash below during boot for systems with a > > memory-less node. This

[PATCH -next v2] mm/hotplug: fix a null-ptr-deref during NUMA boot

2019-05-11 Thread Qian Cai
line_node+0x2b/0x50 do_cpu_up+0x46/0xf0 cpu_up+0x13/0x20 smp_init+0x6e/0xd0 kernel_init_freeable+0xe5/0x21f kernel_init+0xf/0x180 ret_from_fork+0x1f/0x30 Reported-by: Barret Rhoden Signed-off-by: Qian Cai --- v2: Set the node online as it have CPUs. Otherwise, those memory-less nodes wil

[PATCH -next] mm/hotplug: fix a null-ptr-deref during NUMA boot

2019-05-11 Thread Qian Cai
node+0x2b/0x50 do_cpu_up+0x46/0xf0 cpu_up+0x13/0x20 smp_init+0x6e/0xd0 kernel_init_freeable+0xe5/0x21f kernel_init+0xf/0x180 ret_from_fork+0x1f/0x30 Reported-by: Barret Rhoden Signed-off-by: Qian Cai --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

Re: ptrace warning due to "cgroup: get rid of cgroup_freezer_frozen_exit()"

2019-05-08 Thread Qian Cai
On Tue, 2019-05-07 at 21:37 +, Roman Gushchin wrote: > Can you, please, try if the following patch fixes the problem? It works great. > -- > > diff --git a/kernel/signal.c b/kernel/signal.c > index 16b72f4f14df..bf2f268f1386 100644 > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@

[PATCH] slab: skip kmemleak_object in leaks_show()

2019-05-07 Thread Qian Cai
much new information compared with slabinfo. Just skip it. Signed-off-by: Qian Cai --- mm/slab.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/slab.c b/mm/slab.c index 20f318f4f56e..85d1d223f879 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -4285,6 +4285,15 @@ static int leaks_show

ptrace warning due to "cgroup: get rid of cgroup_freezer_frozen_exit()"

2019-05-07 Thread Qian Cai
LTP ptrace01 test case triggers a warning below. Looks at ptrace_stop() calls cgroup_enter_frozen() there in the cgroup v2 freezer. [ 8373.336330] WARNING: CPU: 56 PID: 67026 at kernel/cgroup/cgroup.c:6008 cgroup_exit+0x2a9/0x2f0 [ 8373.345001] Modules linked in: brd ext4 crc16 mbcache jbd2

copy_fpstate_to_sigframe() use-after-free

2019-04-30 Thread Qian Cai
The commit eeec00d73be2 ("x86/fpu: Fault-in user stack if copy_fpstate_to_sigframe() fails") causes use-after-free when running the LTP signal06 test case. Reverted this commit fixed the issue. [ 6150.581746] LTP: starting signal06 [ 6151.099635]

[PATCH 1/2] arm64: fix pte_unmap() -Wunused-but-set-variable

2019-04-29 Thread Qian Cai
' set but not used [-Wunused-but-set-variable] mm/madvise.c: In function 'madvise_free_pte_range': mm/madvise.c:318:9: warning: variable 'orig_pte' set but not used [-Wunused-but-set-variable] Signed-off-by: Qian Cai --- arch/arm64/include/asm/pgtable.h | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 2/2] arm64: remove pte_unmap_nested()

2019-04-29 Thread Qian Cai
Due to the commit ece0e2b6406a ("mm: remove pte_*map_nested()"), pte_unmap_nested() is not used anymore. Signed-off-by: Qian Cai --- arch/arm64/include/asm/pgtable.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtab

Re: [PATCH] arm64: fix pte_unmap() -Wunused-but-set-variable

2019-04-29 Thread Qian Cai
On Mon, 2019-04-29 at 17:49 +0100, Will Deacon wrote: > >  arch/arm64/include/asm/pgtable.h | 4 ++-- > >  1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm64/include/asm/pgtable.h > > b/arch/arm64/include/asm/pgtable.h > > index de70c1eabf33..7543e345e078 100644 > >

[PATCH] arm64: fix pte_unmap() -Wunused-but-set-variable

2019-04-26 Thread Qian Cai
pte_*map_nested()"). Signed-off-by: Qian Cai --- arch/arm64/include/asm/pgtable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index de70c1eabf33..7543e345e078 100644 --- a/arch/arm64/include/asm

[tip:x86/urgent] x86/mm: Fix a crash with kmemleak_scan()

2019-04-24 Thread tip-bot for Qian Cai
Commit-ID: 0d02113b31b2017dd349ec9df2314e798a90fa6e Gitweb: https://git.kernel.org/tip/0d02113b31b2017dd349ec9df2314e798a90fa6e Author: Qian Cai AuthorDate: Tue, 23 Apr 2019 12:58:11 -0400 Committer: Borislav Petkov CommitDate: Wed, 24 Apr 2019 11:32:34 +0200 x86/mm: Fix a crash

[PATCH] x86/mm: fix a crash with kmemleak_scan()

2019-04-23 Thread Qian Cai
kmemleak_free_part() is tolerant to unknown objects (not tracked by kmemleak), it is fine to call it from free_init_pages() even if not all address ranges passed to this function are known to kmemleak. Signed-off-by: Qian Cai --- arch/x86/mm/init.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch

Re: [PATCH] x86/mm/mem_encrypt: fix a crash with kmemleak_scan

2019-04-23 Thread Qian Cai
On Tue, 2019-04-23 at 15:25 +0200, Borislav Petkov wrote: > So I guess free_init_pages() should be somehow telling kmemleak, "hey, > just freed that object, pls adjust your tracking lists" no? > > Because, otherwise, if we start sprinkling those kmemleak_free_part() > calls everywhere, that'll

[tip:x86/irq] mm/slab: Remove store_stackinfo()

2019-04-17 Thread tip-bot for Qian Cai
Commit-ID: 80552f0f7aebdd8deda8ea455292cbfbf462d655 Gitweb: https://git.kernel.org/tip/80552f0f7aebdd8deda8ea455292cbfbf462d655 Author: Qian Cai AuthorDate: Tue, 16 Apr 2019 10:22:57 -0400 Committer: Borislav Petkov CommitDate: Wed, 17 Apr 2019 11:46:27 +0200 mm/slab: Remove

Re: [PATCH] x86/mm/mem_encrypt: fix a crash with kmemleak_scan

2019-04-16 Thread Qian Cai
On 4/16/19 1:11 PM, Borislav Petkov wrote: >> +/* >> + * Inform kmemleak about the hole in the .bss section since the >> + * corresponding pages will be unmapped with DEBUG_PAGEALLOC=y. >> + */ >> +kmemleak_free_part((void *)vaddr, vaddr_end - vaddr); >>

[PATCH v4] mm/hotplug: treat CMA pages as unmovable

2019-04-16 Thread Qian Cai
ing thread ended Acked-by: Michal Hocko Acked-by: Vlastimil Babka Signed-off-by: Qian Cai --- v4: Use is_migrate_cma_page() and update the commit log per Vlastimil. v3: Use a string pointer instead of an array per Michal. v2: Borrow some commit log texts. Call dump_page() in the error

Re: [PATCH] slab: remove store_stackinfo()

2019-04-16 Thread Qian Cai
On 4/16/19 11:25 AM, Vlastimil Babka wrote: > On 4/16/19 4:22 PM, Qian Cai wrote: >> store_stackinfo() does not seem used in actual SLAB debugging. >> Potentially, it could be added to check_poison_obj() to provide more >> information, but this seems like an overkill

[PATCH] slab: remove store_stackinfo()

2019-04-16 Thread Qian Cai
store_stackinfo() does not seem used in actual SLAB debugging. Potentially, it could be added to check_poison_obj() to provide more information, but this seems like an overkill due to the declining popularity of the SLAB, so just remove it instead. Signed-off-by: Qian Cai --- mm/slab.c | 48

[PATCH v3] mm/hotplug: treat CMA pages as unmovable

2019-04-12 Thread Qian Cai
x2a4/0x3b0 kvm_cma_reserve+0x11c/0x134 setup_arch+0x300/0x3f8 start_kernel+0x9c/0x6e8 start_here_common+0x1c/0x4b0 kmemleak: Automatic memory scanning thread ended Acked-by: Michal Hocko Signed-off-by: Qian Cai --- v3: Use a string pointer instead of an array per Michal. v2: Borrow some

[PATCH v2] mm/hotplug: treat CMA pages as unmovable

2019-04-12 Thread Qian Cai
x2a4/0x3b0 kvm_cma_reserve+0x11c/0x134 setup_arch+0x300/0x3f8 start_kernel+0x9c/0x6e8 start_here_common+0x1c/0x4b0 kmemleak: Automatic memory scanning thread ended Signed-off-by: Qian Cai --- v2: Borrow some commit log texts from Michal. Call dump_page() in the error path per Mi

[PATCH] mm/hotplug: treat CMA pages as unmovable

2019-04-11 Thread Qian Cai
5 kmemleak: checksum = 0 kmemleak: backtrace: cma_declare_contiguous+0x2a4/0x3b0 kvm_cma_reserve+0x11c/0x134 setup_arch+0x300/0x3f8 start_kernel+0x9c/0x6e8 start_here_common+0x1c/0x4b0 kmemleak: Automatic memory scanning thread ended Signed-off-by: Qian Cai --- mm/page_al

[PATCH -next] power/domain_governor: fix a compilation error

2019-04-11 Thread Qian Cai
text+0x638): dangerous relocation: unsupported relocation drivers/base/power/domain_governor.c:263: undefined reference to 'cpuidle_devices' make: *** [Makefile:1047: vmlinux] Error 1 Signed-off-by: Qian Cai --- drivers/base/power/domain_governor.c | 12 +++- 1 file changed, 7 insertions(+), 5

Re: [PATCH] slab: fix an infinite loop in leaks_show()

2019-04-11 Thread Qian Cai
On 4/11/19 4:20 AM, Vlastimil Babka wrote: > On 4/11/19 5:26 AM, Qian Cai wrote: >> "cat /proc/slab_allocators" could hang forever on SMP machines with >> kmemleak or object debugging enabled due to other CPUs running do_drain() >> will keep making kmemleak_obje

[PATCH] slab: fix an infinite loop in leaks_show()

2019-04-10 Thread Qian Cai
hich sounds like a good compromise. For example, # cat /proc/slab_allocators 0m42.778s # 1st approach 0m0.737s # 2nd approach Fixes: d31676dfde25 ("mm/slab: alternative implementation for DEBUG_SLAB_LEAK") Signed-off-by: Qian Cai --- mm/slab.c | 6 +- 1 file changed, 5 insertio

[PATCH -next v2] acpi/hmat: fix memory leaks in hmat_init()

2019-04-09 Thread Qian Cai
694a86c1>] do_one_initcall+0x2d8/0x5f8 [<24889da9>] do_initcall_level+0x37c/0x3fc [<9be02908>] do_basic_setup+0x38/0x50 [<37b3ac0a>] kernel_init_freeable+0x194/0x258 [<f5741184>] kernel_init+0x18/0x334 [<7b30

Re: [PATCH -next] acpi/hmat: fix memory leaks in hmat_init()

2019-04-09 Thread Qian Cai
On Tue, 2019-04-09 at 16:54 +0200, Rafael J. Wysocki wrote: > Fewer jumps are easier to follow in general, so avoiding ones that can > be avoided is helpful. > > I'm not buying the argument about more code line changes needed if the > function name changes.  It's meaningless. > > And if you

Re: [PATCH -next] acpi/hmat: fix memory leaks in hmat_init()

2019-04-09 Thread Qian Cai
On Tue, 2019-04-09 at 10:25 +0200, Rafael J. Wysocki wrote: > On Sat, Apr 6, 2019 at 8:18 PM Qian Cai wrote: > > > > The commit 665ac7e92757 ("acpi/hmat: Register processor domain to its > > memory") introduced some memory leaks below due to it fails to release

[PATCH] x86/mm/mem_encrypt: fix a crash with kmemleak_scan

2019-04-08 Thread Qian Cai
Not tainted 5.1.0-rc4+ #4 RIP: 0010:scan_block+0x58/0x160 Call Trace: scan_gray_list+0x1d9/0x280 kmemleak_scan+0x485/0xad0 kmemleak_scan_thread+0x9f/0xc4 kthread+0x1d2/0x1f0 ret_from_fork+0x35/0x40 Signed-off-by: Qian Cai --- arch/x86/mm/mem_encrypt.c | 6 ++ 1 file changed, 6 insertions

Re: [PATCH] slab: fix a crash by reading /proc/slab_allocators

2019-04-08 Thread Qian Cai
On Sun, 2019-04-07 at 19:35 -1000, Linus Torvalds wrote: > On Sat, Apr 6, 2019 at 12:59 PM Qian Cai wrote: > > > > The commit 510ded33e075 ("slab: implement slab_root_caches list") > > changes the name of the list node within "struct kmem_cache&q

Re: [PATCH] slab: fix a crash by reading /proc/slab_allocators

2019-04-07 Thread Qian Cai
On 4/7/19 9:59 PM, Tobin C. Harding wrote: > On Sat, Apr 06, 2019 at 06:59:01PM -0400, Qian Cai wrote: >> The commit 510ded33e075 ("slab: implement slab_root_caches list") >> changes the name of the list node within "struct kmem_cache" from >> "

[PATCH -next] acpi/hmat: fix an uninitialized memory_target

2019-04-06 Thread Qian Cai
this warning struct memory_target *target; ^ = NULL Signed-off-by: Qian Cai --- drivers/acpi/hmat/hmat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/hmat/hmat.c b/drivers/acpi/hm

[PATCH] slab: fix a crash by reading /proc/slab_allocators

2019-04-06 Thread Qian Cai
unmap_single_vma+0x7d/0xe0 unmap_vmas+0xae/0xd0 exit_mmap+0xae/0x190 mmput+0x7a/0x150 do_exit+0x2d9/0xd40 do_group_exit+0x41/0xd0 __x64_sys_exit_group+0x18/0x20 do_syscall_64+0x68/0x381 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 510ded33e075 ("slab: implement slab_root_caches list&qu

[PATCH -next] acpi/hmat: fix memory leaks in hmat_init()

2019-04-06 Thread Qian Cai
t;] do_basic_setup+0x38/0x50 [<37b3ac0a>] kernel_init_freeable+0x194/0x258 [<f5741184>] kernel_init+0x18/0x334 [<7b30f423>] ret_from_fork+0x10/0x18 [<6c7147a8>] 0x Signed-off-by: Qian Cai --- drivers/acpi/hmat/hm

Re: [PATCH] slab: store tagged freelist for off-slab slabmgmt

2019-04-03 Thread Qian Cai
On Wed, 2019-04-03 at 13:23 +0200, Andrey Konovalov wrote: > On Wed, Apr 3, 2019 at 4:29 AM Qian Cai wrote: > > > > The commit 51dedad06b5f ("kasan, slab: make freelist stored without > > tags") calls kasan_reset_tag() for off-slab slab management object > >

[PATCH] slab: store tagged freelist for off-slab slabmgmt

2019-04-02 Thread Qian Cai
xes: 51dedad06b5f ("kasan, slab: make freelist stored without tags") Signed-off-by: Qian Cai --- mm/slab.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/slab.c b/mm/slab.c index 329bfe67f2ca..46a6e084222b 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2374,7 +2374,6 @@ static void *alloc

Re: [PATCH v4] kmemleak: survive in a low-memory situation

2019-03-28 Thread Qian Cai
On Thu, 2019-03-28 at 15:05 +, Catalin Marinas wrote: > > It takes 2 runs of LTP oom01 tests to disable kmemleak. > > What configuration are you using (number of CPUs, RAM)? I tried this on > an arm64 guest under kvm with 4 CPUs and 512MB of RAM, together with > fault injection on

Re: [PATCH v4] kmemleak: survive in a low-memory situation

2019-03-28 Thread Qian Cai
On Thu, 2019-03-28 at 14:59 +, Catalin Marinas wrote: 2 > +/* minimum memory pool sizes */ > +#define MIN_OBJECT_POOL (NR_CPUS * 4) > +#define MIN_SCAN_AREA_POOL (NR_CPUS * 1) I am thinking about making those are tunable, so people could have a big pool depends on

[PATCH -mmots] initramfs: fix a compilation error

2019-03-27 Thread Qian Cai
eclaration of function 'clean_rootfs'; did you mean 'clean_path'? [-Werror=implicit-function-declaration] clean_rootfs(); ^~~~ clean_path Signed-off-by: Qian Cai --- init/initramfs.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init/initramfs.c b/init/initram

Re: [PATCH v4] kmemleak: survive in a low-memory situation

2019-03-27 Thread Qian Cai
On 3/27/19 1:29 PM, Catalin Marinas wrote: > From dc4194539f8191bb754901cea74c86e7960886f8 Mon Sep 17 00:00:00 2001 > From: Catalin Marinas > Date: Wed, 27 Mar 2019 17:20:57 + > Subject: [PATCH] mm: kmemleak: Add an emergency allocation pool for kmemleak > objects > > This patch adds an

[PATCH v5] kmemleak: survive in a low-memory situation

2019-03-27 Thread Qian Cai
mempool_alloc+0x120/0x329 bio_alloc_bioset+0x1a8/0x510 get_swap_bio+0x107/0x470 __swap_writepage+0xab4/0x1650 swap_writepage+0x86/0xe0 Signed-off-by: Qian Cai --- v5: Move everything into gfp_kmemleak_mask(). Use PREEMPT_COUNT to catch irq unsafe spinlocks held. v4: Update the commit log. Fix

Re: [PATCH v4] kmemleak: survive in a low-memory situation

2019-03-27 Thread Qian Cai
On 3/27/19 7:44 AM, Michal Hocko wrote> What? Normal spin lock implementation doesn't disable interrupts. So > either I misunderstand what you are saying or you seem to be confused. > the thing is that in_atomic relies on preempt_count to work properly and > if you have CONFIG_PREEMPT_COUNT=n then

Re: [PATCH v4] kmemleak: survive in a low-memory situation

2019-03-27 Thread Qian Cai
On 3/27/19 4:44 AM, Michal Hocko wrote: >> diff --git a/mm/kmemleak.c b/mm/kmemleak.c >> index a2d894d3de07..7f4545ab1f84 100644 >> --- a/mm/kmemleak.c >> +++ b/mm/kmemleak.c >> @@ -580,7 +580,16 @@ static struct kmemleak_object *create_object(unsigned >> long ptr, size_t size, >> struct

[PATCH v4] kmemleak: survive in a low-memory situation

2019-03-26 Thread Qian Cai
bio_alloc_bioset+0x1a8/0x510 get_swap_bio+0x107/0x470 __swap_writepage+0xab4/0x1650 swap_writepage+0x86/0xe0 Signed-off-by: Qian Cai --- v4: Update the commit log. Fix a typo in comments per Christ. Consolidate the allocation. v3: Update the commit log. Simplify the code inspired

Re: [PATCH v3] kmemleaak: survive in a low-memory situation

2019-03-26 Thread Qian Cai
On 3/26/19 12:06 PM, Catalin Marinas wrote: > I wonder whether we'd be better off to replace the metadata allocator > with gen_pool. This way we'd also get rid of early logging/replaying of > the memory allocations since we can populate the gen_pool early with a > static buffer. I suppose this is

Re: [PATCH v3] kmemleaak: survive in a low-memory situation

2019-03-26 Thread Qian Cai
On 3/26/19 12:00 PM, Christopher Lameter wrote: >> + */ >> +gfp = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : >> + gfp_kmemleak_mask(gfp) | __GFP_DIRECT_RECLAIM; >> +object = kmem_cache_alloc(object_cache, gfp); >> +} >> + >> if

[PATCH v3] kmemleaak: survive in a low-memory situation

2019-03-26 Thread Qian Cai
the kmemleak to embed it's metadata into the tracked memory itself in a foreseeable future, this provides a good balance between enabling kmemleak in a low-memory situation and not introducing too much hackiness into the existing code for now. Signed-off-by: Qian Cai --- v3: Update the commit log

Re: [RESEND#2 PATCH] mm/compaction: fix an undefined behaviour

2019-03-20 Thread Qian Cai
On 3/20/19 5:58 PM, Andrew Morton wrote: >> --- >> mm/compaction.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/mm/compaction.c b/mm/compaction.c >> index e1a08fc92353..0d1156578114 100644 >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -1157,7 +1157,9

[RESEND PATCH] mm: fix a wrong flag in set_migratetype_isolate()

2019-03-20 Thread Qian Cai
lures when offlining memory") Cc: sta...@vger.kernel.org # 5.0.x Acked-by: Michal Hocko Reviewed-by: Oscar Salvador Signed-off-by: Qian Cai --- mm/page_isolation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index bf

[RESEND PATCH] mm/hotplug: fix notification in offline error path

2019-03-20 Thread Qian Cai
r the offlining failure") CC: sta...@vger.kernel.org # 5.0.x Reviewed-by: Oscar Salvador Acked-by: Michal Hocko Signed-off-by: Qian Cai --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0e0a16021fd5.

[RESEND#2 PATCH] mm/compaction: fix an undefined behaviour

2019-03-20 Thread Qian Cai
astimil Babka Acked-by: Mel Gorman Signed-off-by: Qian Cai --- mm/compaction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index e1a08fc92353..0d1156578114 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1157,7 +1157,9 @

[PATCH v2] mm/compaction: abort search if isolation fails

2019-03-20 Thread Qian Cai
kcompactd+0x1d8/0x6c0 kthread+0x32c/0x3f0 ret_from_fork+0x35/0x40 Fixes: dbe2d4e4f12e ("mm, compaction: round-robin the order while searching the free lists for a target") Signed-off-by: Qian Cai --- v2: abort the search by causing a wrap-around, so cc->search_order can b

[PATCH] mm/compaction: abort search if isolation fails

2019-03-20 Thread Qian Cai
kcompactd+0x1d8/0x6c0 kthread+0x32c/0x3f0 ret_from_fork+0x35/0x40 Fixes: dbe2d4e4f12e ("mm, compaction: round-robin the order while searching the free lists for a target") Signed-off-by: Qian Cai --- mm/compaction.c | 4 1 file changed, 4 insertions(+) diff --git a/mm/compact

[PATCH] arm64/mm: fix kernel-doc comments

2019-03-14 Thread Qian Cai
forms.") Signed-off-by: Qian Cai --- arch/arm64/mm/numa.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index 06a6f264f2dd..5202f63c29c9 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c @@ -12

[PATCH v4] mm/hotplug: fix offline undo_isolate_page_range()

2019-03-14 Thread Qian Cai
skip over offline pages") Cc: # v4.13+ Acked-by: Michal Hocko Reviewed-by: Oscar Salvador Signed-off-by: Qian Cai --- v4: Further consolidate comments. Turn on kernel-doc and add a stable tag per Michal. v3: Reconstruct the kernel-doc comments. Use a more meaningful variable n

[PATCH v3] mm/hotplug: fix offline undo_isolate_page_range()

2019-03-14 Thread Qian Cai
n slower that the above commit introduced. Even if alloc_contig_range() can be used to isolate 16GB-hugetlb pages on ppc64, an "int" should still be enough to represent the number of pageblocks there. Fix an incorrect comment along the way. Fixes: 2ce13640b3f4 ("mm: __first_valid_page

[PATCH] mm: fix a wrong flag in set_migratetype_isolate()

2019-03-13 Thread Qian Cai
lures when offlining memory") Signed-off-by: Qian Cai --- mm/page_isolation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index bf67b63227ca..0f5c92fdc7f1 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -59,7 +59,8

[PATCH] mm/hotplug: fix notification in offline error path

2019-03-13 Thread Qian Cai
r the offlining failure") Signed-off-by: Qian Cai --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 8ffe844766da..1559c1605072 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1703,12 +1703,12

[RESEND PATCH] mm/compaction: fix an undefined behaviour

2019-03-13 Thread Qian Cai
orman Signed-off-by: Qian Cai --- Resend because Andrew's email was bounced back at some point. mm/compaction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index f171a83707ce..6aebf1eb8d98 100644 --- a/mm/compaction.c +++ b/mm

[PATCH v2] mm/hotplug: fix offline undo_isolate_page_range()

2019-03-13 Thread Qian Cai
n slower that the above commit introduced. A memory block is usually at most 1GiB in size, so an "int" should be enough to represent the number of pageblocks in a block. Fix an incorrect comment along the way. Fixes: 2ce13640b3f4 ("mm: __first_valid_page skip over offline pages") S

[PATCH] mm/hotplug: fix offline undo_isolate_page_range()

2019-03-12 Thread Qian Cai
n slower that the above commit introduced. Fix an incorrect comment along the way. Fixes: 2ce13640b3f4 ("mm: __first_valid_page skip over offline pages") Signed-off-by: Qian Cai --- mm/memory_hotplug.c | 18 -- mm/sparse.c | 2 +- 2 files changed, 17 insert

Re: [PATCH] mm/debug: add a cast to u64 for atomic64_read()

2019-03-11 Thread Qian Cai
On Mon, 2019-03-11 at 12:21 +, Jason Gunthorpe wrote: > On Sun, Mar 10, 2019 at 08:58:15PM -0700, Davidlohr Bueso wrote: > > On Sun, 10 Mar 2019, Qian Cai wrote: > > > > > atomic64_read() on ppc64le returns "long int", so fix the same way as > > >

[RESEND PATCH] mm/hotplug: don't reset pagetype flags for offline

2019-03-10 Thread Qian Cai
undo_isolate_page_range() here, it reaches the point of no returning by notifying MEM_OFFLINE. Those pages will be marked as MIGRATE_MOVABLE again once onlining. In addition, fix an incorrect comment along the way. Signed-off-by: Qian Cai --- mm/memory_hotplug.c | 2 -- mm/sparse.c | 2 +-

[PATCH] mm/debug: add a cast to u64 for atomic64_read()

2019-03-10 Thread Qian Cai
lx stack_vm %lx\n" ~~~^ %lx Fixes: 70f8a3ca68d3 ("mm: make mm->pinned_vm an atomic64 counter") Signed-off-by: Qian Cai --- mm/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/debug.c b/mm/debug.c index c0b31b6c3877..45d9e

[tip:locking/urgent] workqueue, lockdep: Fix a memory leak in wq->lock_name

2019-03-09 Thread tip-bot for Qian Cai
Commit-ID: 69a106c00e8554a7e6b3f4bb2967332670f89337 Gitweb: https://git.kernel.org/tip/69a106c00e8554a7e6b3f4bb2967332670f89337 Author: Qian Cai AuthorDate: Wed, 6 Mar 2019 19:27:31 -0500 Committer: Ingo Molnar CommitDate: Sat, 9 Mar 2019 14:15:52 +0100 workqueue, lockdep: Fix

[PATCH] mm/compaction: fix an undefined behaviour

2019-03-08 Thread Qian Cai
8c4 compaction_alloc+0x2344/0x2484 unmap_and_move+0xdc/0x1dbc migrate_pages+0x274/0x1310 compact_zone+0x26ec/0x43bc kcompactd+0x15b8/0x1a24 kthread+0x374/0x390 ret_from_fork+0x10/0x18 Fixes: 70b44595eafe ("mm, compaction: use free lists to quickly locate a migration source") Signed-off

[PATCH] kasan: fix variable 'tag' set but not used warning

2019-03-07 Thread Qian Cai
; ^~~ Signed-off-by: Qian Cai --- mm/kasan/kasan.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index 3e0c11f7d7a1..3ce956efa0cb 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -163,7 +163,10 @@ static inline u8 random_tag(void) #endif

[PATCH v2] powerpc: silence unused-but-set-variable warnings

2019-03-07 Thread Qian Cai
'orig_pte' set but not used [-Wunused-but-set-variable] Suggested-by: Christophe Leroy Signed-off-by: Qian Cai --- v2: make it a static inline function. arch/powerpc/include/asm/book3s/64/pgtable.h | 3 ++- arch/powerpc/include/asm/nohash/64/pgtable.h | 3 ++- 2 files changed, 4 insertions(+), 2

[PATCH] powerpc: silence unused-but-set-variable warnings

2019-03-06 Thread Qian Cai
[-Wunused-but-set-variable] mm/swap_state.c: In function 'swap_ra_info': mm/swap_state.c:634:15: warning: variable 'orig_pte' set but not used [-Wunused-but-set-variable] Signed-off-by: Qian Cai --- arch/powerpc/include/asm/book3s/64/pgtable.h | 2 +- arch/powerpc/include/asm/nohash/64/pgtable.h

[PATCH] workqueue: fix a memory leak in wq->lock_name

2019-03-06 Thread Qian Cai
_mount+0x158/0x180 [<64e391fd>] sys_mount+0x20/0x30 [<ba378f12>] system_call+0x5c/0x70 Fixes: 669de8bda87b ("kernel/workqueue: Use dynamic lockdep keys for workqueues") Reviewed-by: Bart Van Assche Signed-off-by: Qian Cai --- kernel/workqueue.c | 2

[tip:x86/urgent] x86/mm: Remove unused variable 'old_pte'

2019-03-06 Thread tip-bot for Qian Cai
Commit-ID: 24c41220659ecc5576c34c6f23537f8d3949fb05 Gitweb: https://git.kernel.org/tip/24c41220659ecc5576c34c6f23537f8d3949fb05 Author: Qian Cai AuthorDate: Fri, 1 Mar 2019 10:29:24 -0500 Committer: Thomas Gleixner CommitDate: Wed, 6 Mar 2019 23:24:53 +0100 x86/mm: Remove unused

[tip:x86/urgent] x86/mm: Remove unused variable 'cpu'

2019-03-06 Thread tip-bot for Qian Cai
Commit-ID: 3609e31bc8dc03b701390f79c74fc7fe92b95039 Gitweb: https://git.kernel.org/tip/3609e31bc8dc03b701390f79c74fc7fe92b95039 Author: Qian Cai AuthorDate: Thu, 28 Feb 2019 17:01:55 -0500 Committer: Thomas Gleixner CommitDate: Wed, 6 Mar 2019 23:24:52 +0100 x86/mm: Remove unused

[tip:x86/urgent] Revert "x86_64: Increase stack size for KASAN_EXTRA"

2019-03-06 Thread tip-bot for Qian Cai
Commit-ID: a2863b53418d7d8f6332adf0cfb32611def0c4b9 Gitweb: https://git.kernel.org/tip/a2863b53418d7d8f6332adf0cfb32611def0c4b9 Author: Qian Cai AuthorDate: Wed, 6 Mar 2019 16:38:06 -0500 Committer: Thomas Gleixner CommitDate: Wed, 6 Mar 2019 23:03:27 +0100 Revert "x86_64: Inc

[PATCH] Revert "x86_64: increase stack size for KASAN_EXTRA"

2019-03-06 Thread Qian Cai
This reverts commit a8e911d13540487942d53137c156bd7707f66e5d. KASAN_EXTRA was removed via the commit 7771bdbbfd3d ("kasan: remove use after scope bugs detection."), so this is no longer needed. Acked-by: Ingo Molnar Signed-off-by: Qian Cai --- arch/x86/include/asm/page_64_types.h |

Re: [PATCH v2] mm/hugepages: fix "orig_pud" set but not used

2019-03-04 Thread Qian Cai
On 3/4/19 7:02 AM, Souptick Joarder wrote: > On Sat, Mar 2, 2019 at 3:50 AM Qian Cai wrote: >> >> The commit a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent >> hugepages") introduced pudp_huge_get_and_clear_full() but no one uses >> its retu

Re: [PATCH -next] lockdep: skip debugobjects for lock_classes[] init

2019-03-03 Thread Qian Cai
the > RCU head is used and after RCU has been initialized. > > Signed-off-by: Bart Van Assche I like your approach more. Tested-by: Qian Cai

[PATCH -next] workqueue: fix a memory leak in wq->lock_name

2019-03-03 Thread Qian Cai
0698e6898>] ksys_mount+0x158/0x180 [<64e391fd>] sys_mount+0x20/0x30 [<ba378f12>] system_call+0x5c/0x70 Signed-off-by: Qian Cai --- kernel/workqueue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 497900263dbc..e780b

[PATCH -next] lockdep: skip debugobjects for lock_classes[] init

2019-03-02 Thread Qian Cai
+0x88/0xac vprintk_emit+0x33c/0x53c vprintk_default+0x54/0x7c vprintk_func+0x320/0x40c printk+0x64/0x8c smp_setup_processor_id+0x6c/0x84 start_kernel+0x38/0x8f8 ODEBUG: Out of memory. ODEBUG disabled Signed-off-by: Qian Cai --- kernel/locking/lockdep.c | 1 - 1 file changed, 1 deletion(-) diff --gi

[PATCH] mm/hotplug: don't reset pagetype flags for offline

2019-03-02 Thread Qian Cai
necessary here, just remove it. Also, fix an incorrect comment along the way. Signed-off-by: Qian Cai --- mm/memory_hotplug.c | 2 -- mm/sparse.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 736e107e2197..e793f651

[PATCH v2] mm/hugepages: fix "orig_pud" set but not used

2019-03-01 Thread Qian Cai
value from pudp_huge_get_and_clear_full(). mm/huge_memory.c: In function 'zap_huge_pud': mm/huge_memory.c:1982:8: warning: variable 'orig_pud' set but not used [-Wunused-but-set-variable] pud_t orig_pud; ^~~~ Signed-off-by: Qian Cai --- v2: keep returning a code from pudp_huge_get_and_

[PATCH -next] mm/hotplug: fix an imbalance with DEBUG_PAGEALLOC

2019-03-01 Thread Qian Cai
8a7dd0] [c03e52f0] ksys_write+0x70/0x120 [c005bf8a7e20] [c000b000] system_call+0x5c/0x70 Instruction dump: 7fbd5278 7fbd4a78 3e42ffeb 7bbd0640 3a523ac8 7e439378 487a2881 6000 e95505f0 7e6aa0ae 6a690080 7929c9c2 <0b09> 7f4aa1ae 7e439378 487a28dd Signed-off-by: Qian Ca

<    4   5   6   7   8   9   10   11   12   13   >