[v2 PATCH] trace, kasan: silence Kasan warning in check_stack

2016-02-12 Thread Yang Shi
ck trace. It may touch the stack red zones to cause the warning. So, just disable the instrumentation to silence the warning. Signed-off-by: Yang Shi <yang@linaro.org> --- v2: Add comment suggested by Steven kernel/trace/trace_stack.c | 6 +- 1 file changed, 5 insertions(+), 1 d

[PATCH] kgdb: disable do_fork and sys_open tests on boot when DEBUG_RODATA is enabled

2016-01-27 Thread Yang Shi
tests on boot, but they still can be run after the system is bootup. Signed-off-by: Yang Shi <yang@linaro.org> --- drivers/misc/kgdbts.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c index 99635dd..4464489

[PATCH] PCI: layerscape: add ls2085a compatible

2016-01-27 Thread Yang Shi
The layerscape PCI host driver needs recognize ls2085a compatible when using firmware with ls2085a compatible property, otherwise the PCI bus won't be detected even though ls2085a compatible is included by the dts. Signed-off-by: Yang Shi <yang@linaro.org> --- drivers/pci/ho

Re: 4.5-rc4 kernel is failed to bootup on CN6880

2016-02-22 Thread Yang Shi
On 2/22/2016 4:43 AM, Aaro Koskinen wrote: Hi, On Fri, Feb 19, 2016 at 05:12:41PM -0800, Yang Shi wrote: I tried to boot 4.5-rc4 kernel on my CN6880 board, but it is failed at booting up secondary cores. The error is: With v4.5-rc5, EBB6800 is booting fine: [0.00] CPU0 revision

[4.4-rt PATCH] trace: use rcuidle version for preemptoff_hist trace point

2016-02-23 Thread Yang Shi
trace_preemptoff_hist to rcuidle version to avoid the error. Signed-off-by: Yang Shi <yang@windriver.com> --- I recall the rcuidle version is used by 4.1-rt, but not sure why it is dropped in 4.4-rt. It looks such fix is still needed. kernel/trace/trace_irqsoff.c | 8 1 file chan

[RFC V2 PATCH] kernfs: create raw version kernfs_path_len and kernfs_path

2016-02-26 Thread Yang Shi
to convert kernfs_rename_lock to raw lock. Call synchronize_sched() when kernfs_node is updated since tracepoints are protected by rcu_read_lock_sched. Create raw version kernfs_path, kernfs_path_len and cgroup_path, which don't acquire lock and are used by tracepoints only. Signed-off-by: Yang Shi <yang..

[PATCH] f2fs: mutex can't be used by down_write_nest_lock()

2016-02-26 Thread Yang Shi
h:22:0, from fs/f2fs/xattr.c:21: include/linux/rwsem_rt.h:138:20: note: expected 'struct rw_semaphore *' but argument is of type 'struct mutex *' static inline void down_write_nest_lock(struct rw_semaphore *sem, Signed-off-by: Yang Shi <yang@linaro.org> --- fs/f2f

[RFC V3 PATCH] kernfs: create raw version kernfs_path_len and kernfs_path

2016-02-26 Thread Yang Shi
to convert kernfs_rename_lock to raw lock. Call synchronize_sched() when kernfs_node is updated since tracepoints are protected by rcu_read_lock_sched. Create unlocked version kernfs_path, kernfs_path_len and cgroup_path, which don't acquire lock and are used by tracepoints only. Signed-off-by: Yang Shi <yang..

[RFC PATCH] writeback: move list_lock down into the for loop

2016-02-26 Thread Yang Shi
it did before. Leave tracepoints outside the critical area since tracepoints already have preempt disabled. Signed-off-by: Yang Shi <yang@linaro.org> --- Tested with ltp on 8 cores Cortex-A57 machine. fs/fs-writeback.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff

[RFC PATCH] kernfs: create raw version kernfs_path_len and kernfs_path

2016-02-26 Thread Yang Shi
to convert kernfs_rename_lock to raw lock. Create raw version kernfs_path, kernfs_path_len and cgroup_path, which don't acquire lock and are used by tracepoints only. Signed-off-by: Yang Shi <yang@linaro.org> --- It should be applicable to both mainline and -rt kernel. The change survives ftrace stress t

[PATCH] writeback: call writeback tracepoints withoud holding list_lock in wb_writeback()

2016-02-24 Thread Yang Shi
d by list_lock in wb_writeback(). Signed-off-by: Yang Shi <yang@linaro.org> --- fs/fs-writeback.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 1f76d89..9b7b5f6 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback

[PATCH] mm/Kconfig: remove redundant arch depend for memory hotplug

2016-02-12 Thread Yang Shi
MEMORY_HOTPLUG already depends on ARCH_ENABLE_MEMORY_HOTPLUG which is selected by the supported architectures, so the following arch depend is unnecessary. Signed-off-by: Yang Shi <yang@linaro.org> --- mm/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/Kconfig b/mm/K

[PATCH] mips: Kconfig: replace OPROFILE=n to !OPROFILE

2016-02-19 Thread Yang Shi
In Kconfig "=n" is not correct syntax, "!" is the preferred way for false-positive expression. Signed-off-by: Yang Shi <yang@windriver.com> --- arch/mips/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kcon

[PATCH] mips: octeon: unselect NR_CPUS_DEFAULT_16

2016-02-19 Thread Yang Shi
In the octeon defconfig, NR_CPUS is 32. And, some model of OCTEON II do have > 16 cores. Given the typical memory size equipped by Octeon boards, it sounds like not a big deal to set a bigger NR_CPUS value as default. Signed-off-by: Yang Shi <yang@windriver.com> --- arch/mips/Kc

4.5-rc4 kernel is failed to bootup on CN6880

2016-02-19 Thread Yang Shi
Hi David, I tried to boot 4.5-rc4 kernel on my CN6880 board, but it is failed at booting up secondary cores. The error is: CPU31 revision is: 000d9101 (Cavium Octeon II) SMP: Booting CPU32 (CoreId 32)... Secondary boot timeout I passed "numcores=32" in kernel commandline since there are 32

Re: 4.5-rc4 kernel is failed to bootup on CN6880

2016-02-19 Thread Yang Shi
On 2/19/2016 5:15 PM, David Daney wrote: On 02/19/2016 05:12 PM, Yang Shi wrote: Hi David, I tried to boot 4.5-rc4 kernel on my CN6880 board, but it is failed at booting up secondary cores. The error is: Have you had luck with any other kernel.org versions? Not tried yet. I will try

[PATCH] mips: octeon: mark some functions __init in smp.c

2016-02-19 Thread Yang Shi
octeon_smp_setup and octeon_prepare_cpus are just used during initialization period, so mark them as __init. And, octeon_prepare_cpus is just used in smp.c, so make it static as well. Signed-off-by: Yang Shi <yang@windriver.com> --- arch/mips/cavium-octeon/smp.c | 4 ++-- 1 file chan

[RFC V4 PATCH] trace: writeback: replace cgroup path to cgroup ino

2016-03-03 Thread Yang Shi
different filesystems, so printing out -1U to indicate an invalid cgroup ino. Signed-off-by: Yang Shi <yang@linaro.org> --- It should be applicable to both mainline and -rt kernel. The change survives ftrace stress test in ltp. v4: Acording to the discussion in v3 review, print out cg

Re: [4.4-rt PATCH] trace: use rcuidle version for preemptoff_hist trace point

2016-03-07 Thread Yang Shi
On 3/7/2016 10:00 AM, Sebastian Andrzej Siewior wrote: * Yang Shi | 2016-02-23 13:23:23 [-0800]: I recall the rcuidle version is used by 4.1-rt, but not sure why it is dropped in 4.4-rt. It looks such fix is still needed. I don't recall while I removed it. It was durring v4.1 -> v4.4 p

[v4.4-rt PATCH] rt: trace: add rcuidle version macro for preemptirqsoff_hist and hrtimer_interrupt

2016-03-07 Thread Yang Shi
Schild <henning.sch...@siemens.com> Signed-off-by: Yang Shi <yang@windriver.com> --- Forward port the 4.1 version patch [1] to 4.4. [1] http://www.spinics.net/lists/linux-rt-users/msg14037.html include/trace/events/hist.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/

Re: [v4.4-rt PATCH] rt: trace: add rcuidle version macro for preemptirqsoff_hist and hrtimer_interrupt

2016-03-09 Thread Yang Shi
On 3/8/2016 12:10 AM, Sebastian Andrzej Siewior wrote: On 03/08/2016 12:45 AM, Yang Shi wrote: diff --git a/include/trace/events/hist.h b/include/trace/events/hist.h index 6122e42..37f6eb8 100644 --- a/include/trace/events/hist.h +++ b/include/trace/events/hist.h @@ -9,6 +9,7

[linux-next PATCH] sched: cgroup: enable interrupt before calling threadgroup_change_begin

2016-04-22 Thread Yang Shi
the might_sleep in threadgroup_change_begin() may be triggered. Before calling exit_signals(), it already checked if it is in hard IRQ handler, so it sounds safe to reenable interrupt at that point. Signed-off-by: Yang Shi <yang@linaro.org> --- kernel/exit.c | 8 1 file changed, 8 inse

[PATCH] powerpc/4xx: make sam440ep_setup_rtc init

2016-04-26 Thread Yang Shi
sam440ep_setup_rtc is just called by machine_device_initcall, and it calls i2c_register_board_info which is init too, so the lack of __init may cause mismatch warning when linking kernel. Signed-off-by: Yang Shi <yang@windriver.com> --- arch/powerpc/platforms/44x/sam440ep.c | 2 +-

[PATCH] panic: lockdep: correct lock debugging state check

2016-04-25 Thread Yang Shi
debugging due to kernel taint [ end trace 2e96d09e0ba6342f ] And, fix a trivial typo in the comment of add_taint(). Signed-off-by: Yang Shi <yang@linaro.org> --- kernel/panic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/panic.c b/kernel/panic.c index 5

[PATCH] mm: move page_ext_init after all struct pages are initialized

2016-05-19 Thread Yang Shi
n, so move page_ext_init() after it. CC: Joonsoo Kim <iamjoonsoo@lge.com> Signed-off-by: Yang Shi <yang@linaro.org> --- init/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/main.c b/init/main.c index b3c6e36..2075faf 100644 --- a/init/main.c +++ b/init/m

[v2 PATCH] mm: move page_ext_init after all struct pages are initialized

2016-05-19 Thread Yang Shi
0 44 8b 4d b8 a8 02 0f 84 05 ff RIP [] free_pcppages_bulk+0x2d2/0x8d0 RSP CR2: Move page_ext_init() after page_alloc_init_late() to make sure page extension is setup for all pages. CC: Joonsoo Kim <iamjoonsoo@lge.com> Signed-off-by: Yang Shi <yang@linaro.org

[PATCH] mm: check the return value of lookup_page_ext for all call sites

2016-05-23 Thread Yang Shi
245@js1304-P5Q-DELUXE Signed-off-by: Yang Shi <yang@linaro.org> --- include/linux/page_idle.h | 43 --- mm/page_alloc.c | 6 ++ mm/page_owner.c | 27 +++ mm/page_poison.c | 8 +

[PATCH] mm: make CONFIG_DEFERRED_STRUCT_PAGE_INIT depends on !FLATMEM explicitly

2016-05-23 Thread Yang Shi
Per the suggestion from Michal Hocko [1], CONFIG_DEFERRED_STRUCT_PAGE_INIT should be incompatible with FLATMEM, make this explicitly in Kconfig. [1] http://lkml.kernel.org/r/20160523073157.gd2...@dhcp22.suse.cz Signed-off-by: Yang Shi <yang@linaro.org> --- mm/Kconfig | 1 + 1 file c

[v2 PATCH] mm: make CONFIG_DEFERRED_STRUCT_PAGE_INIT depends on !FLATMEM explicitly

2016-05-23 Thread Yang Shi
[1] http://lkml.kernel.org/r/20160523073157.gd2...@dhcp22.suse.cz CC: Michal Hocko <mho...@kernel.org> Signed-off-by: Yang Shi <yang@linaro.org> --- v2: Adopted Michal's comments for the commit log mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig b/mm/Kconfig index 266

[PATCH] xtensa: defconfig: remove ZONE_DMA_FLAG

2016-05-23 Thread Yang Shi
commit a3187e438bc6565d6e54a550a19073d1b453f041 ("mm: slab: remove ZONE_DMA_FLAG") removed ZONE_DMA_FLAG completely, so it is pointless to still keep it in defconfig. Signed-off-by: Yang Shi <yang@linaro.org> --- arch/xtensa/configs/iss_defconfig | 1 - 1 file changed, 1 d

[PATCH] mm: page_is_guard return false when page_ext arrays are not allocated yet

2016-05-18 Thread Yang Shi
eturns NULL, page_is_guard() should just return false instead of checking PAGE_EXT_DEBUG_GUARD unconditionally. Signed-off-by: Yang Shi <yang@linaro.org> --- include/linux/mm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 727f7

[PATCH net-next] bpf: arm64: remove callee-save registers use for tmp registers

2016-05-16 Thread Yang Shi
for temp registers which not need to be saved/restored during function call. So, replace R23 and R24 to R10 and R11, and remove tmp_used flag. CC: Zi Shen Lim <zlim@gmail.com> CC: Daniel Borkmann <dan...@iogearbox.net> Signed-off-by: Yang Shi <yang@linaro.org> --- Apply

[PATCH v2 net-next] bpf: arm64: remove callee-save registers use for tmp registers

2016-05-16 Thread Yang Shi
for temp registers which not need to be saved/restored during function call. So, replace R23 and R24 to R10 and R11, and remove tmp_used flag to save 2 instructions for some jited BPF program. CC: Daniel Borkmann <dan...@iogearbox.net> Acked-by: Zi Shen Lim <zlim@gmail.com> Signed-off-

[PATCH] arm64: always use STRICT_MM_TYPECHECKS

2016-04-29 Thread Yang Shi
;+100>: bl 0x0809bcc0 [1] http://www.spinics.net/lists/linux-mm/msg105951.html [2] http://www.spinics.net/lists/linux-mm/msg105969.html Signed-off-by: Yang Shi <yang@linaro.org> CC: Arnd Bergmann <a...@arndb.de> CC: Ard Biesheuvel <ard.biesheu...@linaro

[PATCH] mm: slab: remove ZONE_DMA_FLAG

2016-05-04 Thread Yang Shi
been done in kmem_getpages(). [1] https://lkml.org/lkml/2014/9/25/553 Signed-off-by: Yang Shi <yang@linaro.org> --- Found the problem when I was reading the slab code for investigating another issue, and found a similar fix has been sent to review in 2014, but it didn't get merged into up

[PATCH] arm64: mm: remove unnecessary EXPORT_SYMBOL_GPL

2016-05-04 Thread Yang Shi
arch_pick_mmap_layout is only called by fs/exec.c which is always built into kernel, it looks the EXPORT_SYMBOL_GPL is pointless and no architectures export it other than ARM64. Signed-off-by: Yang Shi <yang@linaro.org> --- arch/arm64/mm/mmap.c | 2 -- 1 file changed, 2 deletions(-)

[PATCH] mm: thp: correct split_huge_pages file permission

2016-04-15 Thread Yang Shi
split_huge_pages doesn't support get method at all, so the read permission sounds confusing, change the permission to write only. And, add "\n" to the output of set method to make it more readable. Signed-off-by: Yang Shi <yang@linaro.org> --- mm/huge_memory.c | 4 ++-- 1

[PATCH] locktorture: make verbose writable and control stats print

2016-04-15 Thread Yang Shi
. Signed-off-by: Yang Shi <yang@linaro.org> --- include/linux/torture.h | 2 ++ kernel/locking/locktorture.c | 11 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/linux/torture.h b/include/linux/torture.h index 7759fc3..86d6e54 100644 --- a/include

[PATCH] arm64: Kconfig: remove redundant HAVE_ARCH_TRANSPARENT_HUGEPAGE definition

2016-04-18 Thread Yang Shi
HAVE_ARCH_TRANSPARENT_HUGEPAGE has been defined in arch/Kconfig already, the ARM64 version is identical with it and the default value is Y. So remove the redundant definition and just select it under CONFIG_ARM64. Signed-off-by: Yang Shi <yang@linaro.org> --- arch/arm64/Kconfig | 4 +

[PATCH] mm: thp: simplify the implementation of mk_huge_pmd

2016-04-18 Thread Yang Shi
The implementation of mk_huge_pmd looks verbose, it could be just simplified to one line code. Signed-off-by: Yang Shi <yang@linaro.org> --- mm/huge_memory.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 8adf3c2..f

[PATCH] arm64: Kconfig: make SCHED_MC and SCHED_SMT depend on SMP

2016-04-13 Thread Yang Shi
SCHED_MC and SCHED_SMT are pointless when SMP is disabled. Although SMP is rarely disabled for ARM64, it looks more consistent to have such depend in Kconfig. Signed-off-by: Yang Shi <yang@linaro.org> --- arch/arm64/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch

[PATCH] lockdep: Include print_collision and helper functions in DEBUG_LOCKDEP

2016-04-13 Thread Yang Shi
not used [-Wunused-function] static void print_collision(struct task_struct *curr, Signed-off-by: Yang Shi <yang@linaro.org> --- kernel/locking/lockdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 2324ba5..ed94109 100644 ---

[PATCH] mm: move huge_pmd_set_accessed out of huge_memory.c

2016-04-20 Thread Yang Shi
huge_pmd_set_accessed is only called by __handle_mm_fault from memory.c, move the definition to memory.c and make it static like create_huge_pmd and wp_huge_pmd. Signed-off-by: Yang Shi <yang@linaro.org> --- include/linux/huge_mm.h | 4 mm/huge_memory.c

[PATCH] locktorture: Fix potential memory leak with rw lock test

2016-11-10 Thread Yang Shi
ad_module+0x1a68/0x22e0 [] SyS_finit_module+0xe0/0xf0 [] el0_svc_naked+0x24/0x28 [] 0x It is because cxt.lwsa and cxt.lrsa don't get freed in module_exit, so free them in lock_torture_cleanup() and free writer_tasks if reader_tasks is failed at memory allocation. Signed-off-by: Yang S

[PATCH] arm: kprobe: replace patch_lock to raw lock

2016-11-10 Thread Yang Shi
gt;] (smpboot_thread_fn+0x1a4/0x354) [<802563a4>] (smpboot_thread_fn) from [<80251d38>] (kthread+0x104/0x11c) [<80251d38>] (kthread) from [<80207f70>] (ret_from_fork+0x14/0x24) Since patch_text_stop_machine() is called in stop_machine() which disables IRQ, sleepable

Is it a possible memory leak in CFQ?

2016-11-22 Thread Yang Shi
Hi folks, When I create some big file (i.e. dd if=/dev/zero of=/home/test/big_file bs=1024k count=10240, then run sync, umount) with kmemleak enabled, kmemleak may report some memory leak occasionally. I would say it happens randomly. Please see the below log: unreferenced object

[PATCH] crypto: rsa - fix a potential race condition in build

2016-12-02 Thread Yang Shi
e:150: sub-make] Error 2 | make: *** [Makefile:24: __sub-make] Error 2 The header file is not generated before rsa_helper is compiled, so adding dependency to avoid such issue. Signed-off-by: Yang Shi <yang@windriver.com> --- crypto/Makefile | 1 + 1 file changed, 1 insertion(+) dif

Re: [PATCH] crypto: rsa - fix a potential race condition in build

2016-12-05 Thread Yang Shi
On 12/4/2016 10:48 PM, Herbert Xu wrote: On Fri, Dec 02, 2016 at 03:41:04PM -0800, Yang Shi wrote: When building kernel with RSA enabled with multithreaded, the below compile failure might be caught: | /buildarea/kernel-source/crypto/rsa_helper.c:18:28: fatal error: rsapubkey-asn1.h

Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when kernel panic

2017-09-15 Thread Yang Shi
On 9/15/17 5:00 AM, Tetsuo Handa wrote: On 2017/09/15 2:14, Yang Shi wrote: @@ -1274,6 +1276,29 @@ static int slab_show(struct seq_file *m, void *p) return 0; } +void show_unreclaimable_slab() +{ + struct kmem_cache *s = NULL; + struct slabinfo sinfo

[PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-18 Thread Yang Shi
xfs_efd_item 31KB xfs_buf_item 78KB xfs_log_item_desc 141KB xfs_trans 108KB xfs_ifork 744KB xfs_trans 108KB xfs_ifork 744KB xfs_da_state 126KB Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/oom_kill.c| 13 +++-- mm/slab.c| 1 + mm/slab.h| 7 +

[PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-18 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

[PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-18 Thread Yang Shi
xfs_efd_item 31KB xfs_buf_item 78KB xfs_log_item_desc 141KB xfs_trans 108KB xfs_ifork 744KB xfs_trans 108KB xfs_ifork 744KB xfs_da_state 126KB Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/oom_kill.c| 13 +++-- mm/slab.c| 1 + mm/slab.h| 7 +

[RFC v2] oom: capture unreclaimable slab info in oom message when kernel panic

2017-09-18 Thread Yang Shi
proc/slabinfo”) since Christopher suggested it might break the compatibility and /proc/slabinfo is legacy * Added Christopher’s Acked-by * Removed acquiring slab_mutex per Tetsuo’s comment Yang Shi (2): tools: slabinfo: add "-U" option to show unreclaimable slabs only mm: oom:

[PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-18 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

Re: [PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-19 Thread Yang Shi
On 9/19/17 3:41 PM, David Rientjes wrote: On Wed, 20 Sep 2017, Yang Shi wrote: --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -35,6 +35,8 @@ static DECLARE_WORK(slab_caches_to_rcu_destroy_work, slab_caches_to_rcu_destroy_workfn); +#define K(x) ((x)/1024

Re: [PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-19 Thread Yang Shi
On 9/19/17 1:57 PM, David Rientjes wrote: On Tue, 19 Sep 2017, Yang Shi wrote: --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -35,6 +35,8 @@ static DECLARE_WORK(slab_caches_to_rcu_destroy_work, slab_caches_to_rcu_destroy_workfn); +#define K(x) ((x)/1024

[PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-21 Thread Yang Shi
xfs_trans 1412KB 1412KB xfs_ifork212KB212KB Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/oom_kill.c| 3 +++ mm/slab.h| 8 mm/slab_common.c | 29 + 3 files changed, 40 insertions(+) diff --gi

[PATCH 0/2 v5] oom: capture unreclaimable slab info in oom message when kernel panic

2017-09-21 Thread Yang Shi
dded Christoph’s Acked-by * Removed acquiring slab_mutex per Tetsuo’s comment Yang Shi (2): tools: slabinfo: add "-U" option to show unreclaimable slabs only mm: oom: show unreclaimable slab info when kernel panic mm/oom_kill.c | 3 +++ mm/slab.h | 8 ++

[PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-21 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

[PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-22 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

[PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-22 Thread Yang Shi
xfs_trans 1412KB 1412KB xfs_ifork212KB212KB Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/oom_kill.c| 3 +++ mm/slab.h| 8 mm/slab_common.c | 29 + 3 files changed, 40 insertions(+) diff --gi

[PATCH 0/2 v6] oom: capture unreclaimable slab info in oom message when kernel panic

2017-09-22 Thread Yang Shi
n /proc/slabinfo”) since Christoph suggested it might break the compatibility and /proc/slabinfo is legacy * Added Christoph’s Acked-by * Removed acquiring slab_mutex per Tetsuo’s comment Yang Shi (2): tools: slabinfo: add "-U" option to show unreclaimable slabs only mm: oom: show

[PATCH] mm: madvise: add description for MADV_WIPEONFORK and MADV_KEEPONFORK

2017-09-22 Thread Yang Shi
mm/madvise.c has the brief description about all MADV_ flags, added the description for the newly added MADV_WIPEONFORK and MADV_KEEPONFORK. Although man page has the similar information, but it'd better to keep the consistency with other flags. Signed-off-by: Yang Shi <yan...@alibaba-inc.

[PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-20 Thread Yang Shi
115KB xfs_efd_item 115KB115KB xfs_buf_item 134KB134KB xfs_log_item_desc342KB342KB xfs_trans 1412KB 1412KB xfs_ifork212KB212KB Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/oom_

[RFC v3] oom: capture unreclaimable slab info in oom message when kernel panic

2017-09-20 Thread Yang Shi
e flag in /proc/slabinfo”) since Christoph suggested it might break the compatibility and /proc/slabinfo is legacy * Added Christoph’s Acked-by * Removed acquiring slab_mutex per Tetsuo’s comment Yang Shi (2): tools: slabinfo: add "-U" option to show unreclaimable slabs only m

[PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-20 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

Re: [PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-20 Thread Yang Shi
On 9/20/17 1:45 PM, David Rientjes wrote: On Thu, 21 Sep 2017, Yang Shi wrote: diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index b9d34b3..9673190 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c @@ -83,6 +83,7 @@ struct aliasinfo { int sort_loss; int extended_totals

Re: [PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-20 Thread Yang Shi
On 9/20/17 2:00 PM, David Rientjes wrote: On Thu, 21 Sep 2017, Yang Shi wrote: diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 99736e0..173c423 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -43,6 +43,7 @@ #include #include "internal.h" +#include "slab.

[PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-20 Thread Yang Shi
xfs_trans 1412KB 1412KB xfs_ifork212KB212KB Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/oom_kill.c| 3 +++ mm/slab.h| 8 mm/slab_common.c | 26 ++ 3 files changed, 37 insertions(+) diff --gi

[PATCH 0/2 v4] oom: capture unreclaimable slab info in oom message when kernel panic

2017-09-20 Thread Yang Shi
mment Changelog v1 —> v2: * Removed the original patch 1 (“mm: slab: output reclaimable flag in /proc/slabinfo”) since Christoph suggested it might break the compatibility and /proc/slabinfo is legacy * Added Christoph’s Acked-by * Removed acquiring slab_mutex per Tetsuo’s comment Yang S

[PATCH 1/2] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-20 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

[PATCH 1/3] mm: slab: output reclaimable flag in /proc/slabinfo

2017-09-14 Thread Yang Shi
"1" means reclaimable, "0" means unreclaimable. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/slab.c| 1 + mm/slab.h| 6 ++ mm/slab_common.c | 2 ++ mm/slub.c| 1 + 4 files changed, 10 insertions(+) diff --git a/mm/slab.c b/mm/slab.c in

[RFC] oom: capture unreclaimable slab info in oom message when kernel panic

2017-09-14 Thread Yang Shi
eclaimable slab only. And, oom will print all non zero (num_objs * size != 0) unreclaimable slabs in oom killer message. For details, please see the commit log for each commit. Yang Shi (3): mm: slab: output reclaimable flag in /proc/slabinfo tools: slabinfo: add "-U&

[PATCH 3/3] mm: oom: show unreclaimable slab info when kernel panic

2017-09-14 Thread Yang Shi
-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/oom_kill.c| 13 +++-- mm/slab.h| 1 + mm/slab_common.c | 25 + 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 99736e0..173c423 100644 --

[PATCH 2/3] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-14 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- tools/vm/slabinfo.c

Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when kernel panic

2017-09-14 Thread Yang Shi
On 9/14/17 10:32 AM, Christopher Lameter wrote: I am not sure that this is generally useful at OOM times unless this is not a rare occurrence. I would say it is not very rare. But, it is definitely troublesome to narrow down without certain information about slab usage when it happens.

Re: [PATCH 1/3] mm: slab: output reclaimable flag in /proc/slabinfo

2017-09-14 Thread Yang Shi
On 9/14/17 10:27 AM, Christopher Lameter wrote: Well /proc/slabinfo is a legacy interface. The infomation if a slab is reclaimable is available via the slabinfo tool. We would break a format that is relied upon by numerous tools. Thanks for pointing this out. It would be unacceptable if it

Re: [PATCH 2/2] mm: oom: show unreclaimable slab info when kernel panic

2017-09-21 Thread Yang Shi
On 9/21/17 1:23 AM, David Rientjes wrote: On Thu, 21 Sep 2017, Yang Shi wrote: Kernel may panic when oom happens without killable process sometimes it is caused by huge unreclaimable slabs used by kernel. Although kdump could help debug such problem, however, kdump is not available on all

Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory

2017-10-06 Thread Yang Shi
On 10/6/17 2:37 AM, Michal Hocko wrote: On Thu 05-10-17 05:29:10, Yang Shi wrote: Kernel may panic when oom happens without killable process sometimes it is caused by huge unreclaimable slabs used by kernel. Although kdump could help debug such problem, however, kdump is not available on all

[RFC PATCH] mm: shm: round up tmpfs size to huge page size when huge=always

2017-10-06 Thread Yang Shi
ize to THP size in order to use THP with "always" more efficiently. And, it will not wast too much memory (just allocate 511 extra pages in worst case). Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/shmem.c | 5 + 1 file changed, 5 insertions(+) diff --git a/mm/shmem.c

Re: [RFC PATCH] mm: shm: round up tmpfs size to huge page size when huge=always

2017-10-08 Thread Yang Shi
On 10/8/17 5:56 AM, Kirill A. Shutemov wrote: On Sat, Oct 07, 2017 at 04:22:10AM +0800, Yang Shi wrote: When passing "huge=always" option for mounting tmpfs, THP is supposed to be allocated all the time when it can fit, but when the available space is smaller than the size of THP (

[PATCH -mmotm] mm: slab: exclude slabinfo dump for slob

2017-10-08 Thread Yang Shi
erence to `get_slabinfo' Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- Andrew, This should be able to be fold into mm-oom-show-unreclaimable-slab-info-when-unreclaimable-slabs-user-memory.patch in -mm tree. mm/slab.h| 6 ++ mm/slab_common.c | 4 +++- 2 files changed, 9 insertions(+)

[PATCH 0/3 v8] oom: capture unreclaimable slab info in oom message

2017-10-03 Thread Yang Shi
tput reclaimable flag in /proc/slabinfo”) since Christoph suggested it might break the compatibility and /proc/slabinfo is legacy * Added Christoph’s Acked-by * Removed acquiring slab_mutex per Tetsuo’s comment Yang Shi (3): tools: slabinfo: add "-U" option to show unreclaimable s

[PATCH 2/3] mm: slabinfo: dump CONFIG_SLABINFO

2017-10-03 Thread Yang Shi
According to the discussion with Christoph [1], it sounds it is pointless to keep CONFIG_SLABINFO around. This patch just remove CONFIG_SLABINFO config option, but /proc/slabinfo is still available. [1] https://marc.info/?l=linux-kernel=150695909709711=2 Signed-off-by: Yang Shi <yan...@alib

[PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory

2017-10-03 Thread Yang Shi
Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- mm/oom_kill.c| 22 ++ mm/slab.h| 2 ++ mm/slab_common.c | 32 3 files changed, 56 insertions(+) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 99736e0..6d89397 100644 --

[PATCH 1/3] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-10-03 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

Re: [PATCH 0/3 v8] oom: capture unreclaimable slab info in oom message

2017-10-03 Thread Yang Shi
This round should be v9. Sorry for the typo. Yang On 10/3/17 11:06 AM, Yang Shi wrote: Recently we ran into a oom issue, kernel panic due to no killable process. The dmesg shows huge unreclaimable slabs used almost 100% memory, but kdump doesn't capture vmcore due to some reason. So

Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory

2017-10-04 Thread Yang Shi
On 10/4/17 7:27 AM, Michal Hocko wrote: On Wed 04-10-17 02:06:17, Yang Shi wrote: +static bool is_dump_unreclaim_slabs(void) +{ + unsigned long nr_lru; + + nr_lru = global_node_page_state(NR_ACTIVE_ANON) + +global_node_page_state(NR_INACTIVE_ANON

Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory

2017-10-09 Thread Yang Shi
On 10/8/17 11:36 PM, Michal Hocko wrote: On Mon 09-10-17 08:33:16, Michal Hocko wrote: On Sat 07-10-17 00:37:55, Yang Shi wrote: On 10/6/17 2:37 AM, Michal Hocko wrote: On Thu 05-10-17 05:29:10, Yang Shi wrote: [...] + list_for_each_entry_safe(s, s2, _caches, list

Re: [RFC PATCH] mm: shm: round up tmpfs size to huge page size when huge=always

2017-10-09 Thread Yang Shi
On 10/8/17 11:48 PM, Michal Hocko wrote: On Sun 08-10-17 15:56:51, Kirill A. Shutemov wrote: On Sat, Oct 07, 2017 at 04:22:10AM +0800, Yang Shi wrote: When passing "huge=always" option for mounting tmpfs, THP is supposed to be allocated all the time when it can fit, but when the

[PATCH 0/3 v11] oom: capture unreclaimable slab info in oom message

2017-10-10 Thread Yang Shi
size and total size of each kmem cache per David’s comment Changelog v1 —> v2: * Removed the original patch 1 (“mm: slab: output reclaimable flag in /proc/slabinfo”) since Christoph suggested it might break the compatibility and /proc/slabinfo is legacy * Added Christoph’s Acked-by * Removed acquir

[PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory

2017-10-10 Thread Yang Shi
Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Michal Hocko <mho...@suse.com> --- mm/oom_kill.c| 27 +-- mm/slab.h| 8 mm/slab_common.c | 34 ++ 3 files changed, 67 insertions(+), 2 deletions(-) dif

[PATCH 1/3] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-10-10 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

[PATCH 2/3] mm: slabinfo: dump CONFIG_SLABINFO

2017-10-10 Thread Yang Shi
According to the discussion with Christoph [1], it sounds it is pointless to keep CONFIG_SLABINFO around. This patch just remove CONFIG_SLABINFO config option, but /proc/slabinfo is still available. [1] https://marc.info/?l=linux-kernel=150695909709711=2 Signed-off-by: Yang Shi <yan...@alib

Re: [PATCH 3/3] mm: oom: show unreclaimable slab info when unreclaimable slabs > user memory

2017-10-09 Thread Yang Shi
On 10/8/17 11:36 PM, Michal Hocko wrote: On Mon 09-10-17 08:33:16, Michal Hocko wrote: On Sat 07-10-17 00:37:55, Yang Shi wrote: On 10/6/17 2:37 AM, Michal Hocko wrote: On Thu 05-10-17 05:29:10, Yang Shi wrote: [...] + list_for_each_entry_safe(s, s2, _caches, list

Re: [RFC PATCH] mm: shm: round up tmpfs size to huge page size when huge=always

2017-10-09 Thread Yang Shi
On 10/9/17 10:26 AM, Michal Hocko wrote: On Tue 10-10-17 00:43:31, Yang Shi wrote: On 10/8/17 11:48 PM, Michal Hocko wrote: On Sun 08-10-17 15:56:51, Kirill A. Shutemov wrote: On Sat, Oct 07, 2017 at 04:22:10AM +0800, Yang Shi wrote: When passing "huge=always" option for moun

Re: [PATCH 0/2 v4] oom: capture unreclaimable slab info in oom message when kernel panic

2017-09-25 Thread Yang Shi
On 9/25/17 1:32 PM, Michal Hocko wrote: On Mon 25-09-17 23:55:19, Yang Shi wrote: On 9/25/17 7:23 AM, Michal Hocko wrote: On Thu 21-09-17 06:38:50, Yang Shi wrote: Recently we ran into a oom issue, kernel panic due to no killable process. The dmesg shows huge unreclaimable slabs used

[PATCH 0/3 v7] oom: capture unreclaimable slab info in oom message when kernel panic

2017-09-26 Thread Yang Shi
each kmem cache per David’s comment Changelog v1 —> v2: * Removed the original patch 1 (“mm: slab: output reclaimable flag in /proc/slabinfo”) since Christoph suggested it might break the compatibility and /proc/slabinfo is legacy * Added Christoph’s Acked-by * Removed acquiring slab_mutex per

[PATCH 2/3] mm: oom: show unreclaimable slab info when kernel panic

2017-09-26 Thread Yang Shi
2KB xfs_ifork212KB212KB Signed-off-by: Yang Shi <yan...@alibaba-inc.com> --- include/linux/oom.h | 1 + include/uapi/linux/sysctl.h | 1 + kernel/sysctl.c | 9 + kernel/sysctl_binary.c | 1 + mm/oom_kill.c

[PATCH 1/3] tools: slabinfo: add "-U" option to show unreclaimable slabs only

2017-09-26 Thread Yang Shi
Add "-U" option to show unreclaimable slabs only. "-U" and "-S" together can tell us what unreclaimable slabs use the most memory to help debug huge unreclaimable slabs issue. Signed-off-by: Yang Shi <yan...@alibaba-inc.com> Acked-by: Christoph Lameter <c

<    1   2   3   4   5   6   7   8   9   10   >