Fwd: trinity test fanotify cause hungtasks on kernel 4.13

2017-07-27 Thread Gu Zheng
hi,ALL: when we used the trinity test the fanotify interfaces, it cause many hungtasks. CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y the shell is simple: 1 #!/bin/bash 2 3 while true 4 do 5 ./trinity -c fanotify_init -l off -C 2 -X > /dev/null 2>&1 & 6 sleep 1 7 ./trinity -c fanotify_mark

Re: trinity test fanotify cause hungtasks on kernel 4.13

2017-07-27 Thread Gu Zheng
hi:all sorry , close the CONFIG_FANOTIFY_ACCESS_PERMISSIONS is ok. it effected by adding the permissive judgment in fanotify_mark. 在 2017/7/27 17:55, Gu Zheng 写道: if we disable the CONFIG_FANOTIFY_ACCESS_PERMISSIONS, the mem will be consumed quickly, because the fsnotify_mark_srcu read lock

trinity test fanotify cause hungtasks on kernel 4.13

2017-07-27 Thread Gu Zheng
hi,Eric Paris: when we used the trinity test the fanotify interfaces, it cause many hungtasks. CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y the shell is simple: 1 #!/bin/bash 2 3 while true 4 do 5 ./trinity -c fanotify_init -l off -C 2 -X > /dev/null 2>&1 & 6 sleep 1 7 ./trinity -c

[PATCH] mtd:avoid blktrans_open/release race and avoid insmod ftl.ko deadlock

2017-03-16 Thread Gu Zheng
ns mutex_lock(_table_mutex) //mtd_table_mutex locked ftl_add_mtd add_mtd_blktrans_dev device_add_disk register_disk blkdev_get __blkdev_get blktrans_open mutex_lock(_table_mutex) //dead lock this patch can prevent some mtd_table_mutex lock race undiscovered. Signed-off-by: Gu Zheng <guz

[PATCH] tmpfs: clear S_ISGID when setting posix ACLs

2017-01-08 Thread Gu Zheng
$testfile chmod 2755 $testfile _runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx $testfile Signed-off-by: Gu Zheng <guzhe...@huawei.com> --- fs/posix_acl.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 5955220

Re: [PATCH] tmpfs: clear S_ISGID when setting posix ACLs

2017-01-08 Thread Gu Zheng
thanks, I will update it. 在 2017/1/6 18:10, Jan Kara 写道: On Fri 06-01-17 16:12:55, Gu Zheng wrote: This change was missed the tmpfs modification in In CVE-2016-7097 commit 073931017b49d9458aa351605b43a7e34598caef posix_acl: Clear SGID bit when setting file permissions. It can test by xfstest

[PATCH] tmpfs: clear S_ISGID when setting posix ACLs

2017-01-06 Thread Gu Zheng
chown 100:100 $testfile chmod 2755 $testfile _runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx $testfile Signed-off-by: Gu Zheng <guzhe...@huawei.com> --- fs/posix_acl.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/posix_acl.c b/fs/posix_acl.c

[tip:x86/apic] x86/acpi: Introduce persistent storage for cpuid <-> apicid mapping

2016-09-22 Thread tip-bot for Gu Zheng
Commit-ID: 8f54969dc8d6704632b42cbb5e47730cd75cc713 Gitweb: http://git.kernel.org/tip/8f54969dc8d6704632b42cbb5e47730cd75cc713 Author: Gu Zheng <guz.f...@cn.fujitsu.com> AuthorDate: Thu, 25 Aug 2016 16:35:16 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate:

[tip:x86/apic] x86/acpi: Enable acpi to register all possible cpus at boot time

2016-09-22 Thread tip-bot for Gu Zheng
Commit-ID: f7c28833c252031bc68a29e26a18a661797cf3a3 Gitweb: http://git.kernel.org/tip/f7c28833c252031bc68a29e26a18a661797cf3a3 Author: Gu Zheng <guz.f...@cn.fujitsu.com> AuthorDate: Thu, 25 Aug 2016 16:35:15 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate:

[tip:x86/apic] x86/acpi: Enable MADT APIs to return disabled apicids

2016-09-22 Thread tip-bot for Gu Zheng
Commit-ID: 8ad893faf2eaedb710a3073afbb5d569df2c3e41 Gitweb: http://git.kernel.org/tip/8ad893faf2eaedb710a3073afbb5d569df2c3e41 Author: Gu Zheng <guz.f...@cn.fujitsu.com> AuthorDate: Thu, 25 Aug 2016 16:35:17 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate:

[tip:x86/apic] x86/acpi: Set persistent cpuid <-> nodeid mapping when booting

2016-09-22 Thread tip-bot for Gu Zheng
Commit-ID: dc6db24d2476cd09c0ecf2b8d80313539f737a89 Gitweb: http://git.kernel.org/tip/dc6db24d2476cd09c0ecf2b8d80313539f737a89 Author: Gu Zheng <guz.f...@cn.fujitsu.com> AuthorDate: Thu, 25 Aug 2016 16:35:18 +0800 Committer: Thomas Gleixner <t...@linutronix.de> CommitDate:

[PATCH V1] x86, espfix: postpone the initialization of espfix stack for AP

2015-06-04 Thread Gu Zheng
cpu after it booted to avoid the noise. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- v1: Alloc the page on the node the target CPU is on. RFC: Let the boot up routine init the espfix stack for the target cpu after it booted. --- --- arch/x86/include/asm/espfix.h |2 +- arch/x86

Re: [RFC PATCH V2] x86, espfix: postpone the initialization of espfix stack for AP

2015-06-03 Thread Gu Zheng
Hi Ingo, On 06/02/2015 07:59 PM, Ingo Molnar wrote: * Gu Zheng guz.f...@cn.fujitsu.com wrote: The following lockdep warning occurrs when running with latest kernel: [3.178000] [ cut here ] [3.183000] WARNING: CPU: 128 PID: 0 at kernel/locking/lockdep.c

Re: [RFC PATCH] x86, espfix: postpone the initialization of espfix stack for AP

2015-06-02 Thread Gu Zheng
Hi Andy, Sorry for late reply. On 05/29/2015 09:07 AM, Andy Lutomirski wrote: On Wed, May 27, 2015 at 6:20 PM, Gu Zheng guz.f...@cn.fujitsu.com wrote: ping... On 05/22/2015 06:13 PM, Gu Zheng wrote: The following lockdep warning occurs when running with 4.1.0-rc3: [3.178000

[RFC PATCH V2] x86, espfix: postpone the initialization of espfix stack for AP

2015-06-02 Thread Gu Zheng
the noise. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- v2: Let the boot up routine init the espfix stack for the target cpu after it booted. --- arch/x86/include/asm/espfix.h |2 +- arch/x86/kernel/espfix_64.c | 15 +++ arch/x86/kernel/smpboot.c | 14

Re: [RFC PATCH] x86, espfix: postpone the initialization of espfix stack for AP

2015-05-28 Thread Gu Zheng
Hi Andy, On 05/29/2015 09:07 AM, Andy Lutomirski wrote: On Wed, May 27, 2015 at 6:20 PM, Gu Zheng guz.f...@cn.fujitsu.com wrote: ping... On 05/22/2015 06:13 PM, Gu Zheng wrote: The following lockdep warning occurs when running with 4.1.0-rc3: [3.178000] [ cut here

Re: [RFC PATCH] x86, espfix: postpone the initialization of espfix stack for AP

2015-05-27 Thread Gu Zheng
ping... On 05/22/2015 06:13 PM, Gu Zheng wrote: The following lockdep warning occurs when running with 4.1.0-rc3: [3.178000] [ cut here ] [3.183000] WARNING: CPU: 128 PID: 0 at kernel/locking/lockdep.c:2755 lockdep_trace_alloc+0xdd/0xe0() [3.193000

[PATCH] mm/memory_hotplug: set zone-wait_table to null after free it

2015-05-27 Thread Gu Zheng
operation with the page is done, such as mentioned above. Reported-by: Taku Izumi izumi.t...@jp.fujitsu.com Cc: Stable sta...@vger.kernel.org Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- mm/memory_hotplug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c

Re: [RFC PATCH V2 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-05-26 Thread Gu Zheng
ping... Any comments or suggestions are welcomed. Regards, Gu On 05/14/2015 07:33 PM, Gu Zheng wrote: Yasuaki Ishimatsu found that with node online/offline, cpu-node relationship is established. Because workqueue uses a info which was established at boot time, but it may be changed by node

[RFC PATCH] x86, espfix: postpone the initialization of espfix stack for AP

2015-05-22 Thread Gu Zheng
the noise. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- arch/x86/kernel/smpboot.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 50e547e..3ce05de 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch

[RFC PATCH V2 2/2] gfp: use the best near online node if the target node is offline

2015-05-14 Thread Gu Zheng
-node only for x86 arch to avoid additional overhead. --- Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- arch/x86/include/asm/topology.h | 2 ++ arch/x86/mm/numa.c | 33 + include/linux/gfp.h | 12 +++- 3 files changed, 46

[RFC PATCH V2 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-05-14 Thread Gu Zheng
Step2: map the cpu to the phyical node via an additional acpi ns walk for processor. Please refer to: https://lkml.org/lkml/2015/2/27/145 https://lkml.org/lkml/2015/3/25/989 for the previous discussion. --- V2: rebase on latest upstream. --- Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com

[PATCH] mm/memory hotplug: init the zones' size when calculate node totalpages

2015-05-14 Thread Gu Zheng
Init the zones' size when calculate node totalpages to avoid duplicated operations in free_area_init_core. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- mm/page_alloc.c | 44 +--- 1 files changed, 21 insertions(+), 23 deletions(-) diff --git a/mm

[RFC PATCH] x86, espfix: use spin_lock rather than mutex

2015-05-14 Thread Gu Zheng
here we use GFP_NOFS rather GFP_KERNEL to avoid the warning, but you know, init_espfix_ap is called with preempt and local irq disabled, it is not a good idea to use mutex (might sleep) here. So we convert the initialization lock to spin_lock here to avoid the noise. Signed-off-by: Gu Zheng guz.f

Re: [RFC PATCH V2 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-05-14 Thread Gu Zheng
for all the possible cpus at boot, so that we can ignore the effect of cpu/node hotplug, especially for per cpu cases. Regards, Gu Thanks, Yasuaki Ishimatsu On Thu, 14 May 2015 19:33:33 +0800 Gu Zheng guz.f...@cn.fujitsu.com wrote: Yasuaki Ishimatsu found that with node online/offline, cpu

Re: [PATCH] Hotplug: fix the bug that the system is down,when memory is not in node0 and cpu is logically hotadded.

2015-05-10 Thread Gu Zheng
Hi TJ, Song, Sorry for late reply. On 05/08/2015 11:23 PM, Tejun Heo wrote: Cc'ing Lai, Gu and Kamezawa as they've been working in the area for a while now. Gu, is this related to what you've been working on? Yes, they are the same. And we are still working on it, please refer to the

Re: [PATCH 1/2 V3] memory-hotplug: fix BUG_ON in move_freepages()

2015-05-10 Thread Gu Zheng
Hi Xishi, What is the condition about this series? Thanks, Gu On 04/22/2015 02:26 PM, Xishi Qiu wrote: add CC: Tejun Heo t...@kernel.org On 2015/4/21 18:15, Xishi Qiu wrote: Hot remove nodeXX, then hot add nodeXX. If BIOS report cpu first, it will call hotadd_new_pgdat(nid, 0), this

Re: [RESEND RFC PATCH 2/2] gfp: use the best near online node if the target node is offline

2015-04-27 Thread Gu Zheng
Hi Andrew, On 04/25/2015 04:01 AM, Andrew Morton wrote: On Fri, 24 Apr 2015 17:58:33 +0800 Gu Zheng guz.f...@cn.fujitsu.com wrote: Since the change to the cpu -- mapping (map the cpu to the physical node for all possible at the boot), the node of cpu may be not present, so we use the best

Re: [RESEND RFC PATCH 2/2] gfp: use the best near online node if the target node is offline

2015-04-27 Thread Gu Zheng
Hi Kame-san, On 04/27/2015 05:44 PM, Kamezawa Hiroyuki wrote: On 2015/04/25 5:01, Andrew Morton wrote: On Fri, 24 Apr 2015 17:58:33 +0800 Gu Zheng guz.f...@cn.fujitsu.com wrote: Since the change to the cpu -- mapping (map the cpu to the physical node for all possible at the boot), the node

Re: [RESEND RFC PATCH 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-04-27 Thread Gu Zheng
Hi Hanjun, Rafael, On 04/25/2015 06:14 PM, Hanjun Guo wrote: On 2015/4/24 22:45, Rafael J. Wysocki wrote: On Friday, April 24, 2015 05:58:32 PM Gu Zheng wrote: Yasuaki Ishimatsu found that with node online/offline, cpu-node relationship is established. Because workqueue uses a info which

[RESEND RFC PATCH 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-04-24 Thread Gu Zheng
Step2: map the cpu to the phyical node via an additional acpi ns walk for processor. Please refer to: https://lkml.org/lkml/2015/2/27/145 https://lkml.org/lkml/2015/3/25/989 for the previous discussion. Reported-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com Signed-off-by: Gu Zheng guz.f

[RESEND RFC PATCH 2/2] gfp: use the best near online node if the target node is offline

2015-04-24 Thread Gu Zheng
Since the change to the cpu -- mapping (map the cpu to the physical node for all possible at the boot), the node of cpu may be not present, so we use the best near online node if the node is not present in the low level allocation APIs. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- include

Re: [RFC PATCH 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-04-22 Thread Gu Zheng
ping... On 04/17/2015 08:48 PM, Gu Zheng wrote: Yasuaki Ishimatsu found that with node online/offline, cpu-node relationship is established. Because workqueue uses a info which was established at boot time, but it may be changed by node hotpluging. Once pool-node points to a stale node

Re: [PATCH 1/2 V2] memory-hotplug: fix BUG_ON in move_freepages()

2015-04-19 Thread Gu Zheng
Hi Ishimatsu, Xishi, On 04/20/2015 10:11 AM, Yasuaki Ishimatsu wrote: When hot adding memory and creating new node, the node is offline. And after calling node_set_online(), the node becomes online. Oh, sorry. I misread your ptaches. Please ignore it... Seems also a misread to me. I

Re: [PATCH 1/2 V2] memory-hotplug: fix BUG_ON in move_freepages()

2015-04-19 Thread Gu Zheng
Hi Ishimatsu, Xishi, On 04/20/2015 10:11 AM, Yasuaki Ishimatsu wrote: When hot adding memory and creating new node, the node is offline. And after calling node_set_online(), the node becomes online. Oh, sorry. I misread your ptaches. Please ignore it... Seems also a misread to me. I

Re: [PATCH 1/2 V2] memory-hotplug: fix BUG_ON in move_freepages()

2015-04-19 Thread Gu Zheng
Hi Xishi, On 04/18/2015 04:05 AM, Yasuaki Ishimatsu wrote: Your patches will fix your issue. But, if BIOS reports memory first at node hot add, pgdat can not be initialized. Memory hot add flows are as follows: add_memory ... - hotadd_new_pgdat() ... - node_set_online(nid)

[RFC PATCH 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-04-17 Thread Gu Zheng
Step2: map the cpu to the phyical node via an additional acpi ns walk for processor. Please refer to: https://lkml.org/lkml/2015/2/27/145 https://lkml.org/lkml/2015/3/25/989 for the previous discussion. Reported-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com Signed-off-by: Gu Zheng guz.f

[RFC PATCH 2/2] gfp: use the best near online node if the target node is offline

2015-04-17 Thread Gu Zheng
Since the change to the cpu -- mapping (map the cpu to the physical node for all possible at the boot), the node of cpu may be not present, so we use the best near online node if the node is not present in the low level allocation APIs. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- include

[PATCH] md: fix md io stats accounting broken

2015-04-02 Thread Gu Zheng
the disk stats rather than the open code, but it also introduced the increase to .in_flight[rw] which is needless to md. So we re-use the open code here to fix it. Reported-by: Simon Kirby s...@hostway.ca Cc: sta...@vger.kernel.org 3.19 Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- drivers/md/md.c

Re: [PATCH 0/2] workqueue: fix a bug when numa mapping is changed

2015-04-01 Thread Gu Zheng
Hi Kame, TJ, On 04/01/2015 04:30 PM, Kamezawa Hiroyuki wrote: On 2015/04/01 12:02, Tejun Heo wrote: On Wed, Apr 01, 2015 at 11:55:11AM +0900, Kamezawa Hiroyuki wrote: Now, hot-added cpus will have the lowest free cpu id. Because of this, in most of systems which has only cpu-hot-add,

Re: [PATCH 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-03-30 Thread Gu Zheng
Hi Kame-san, On 03/27/2015 12:31 AM, Kamezawa Hiroyuki wrote: On 2015/03/26 13:55, Gu Zheng wrote: Hi Kame-san, On 03/26/2015 11:19 AM, Kamezawa Hiroyuki wrote: On 2015/03/26 11:17, Gu Zheng wrote: Previously, we build the apicid -- cpuid mapping when the cpu is present

Re: [PATCH 0/2] workqueue: fix a bug when numa mapping is changed

2015-03-30 Thread Gu Zheng
Hi Kame-san, On 03/27/2015 12:42 AM, Kamezawa Hiroyuki wrote: On 2015/03/27 0:18, Tejun Heo wrote: Hello, On Thu, Mar 26, 2015 at 01:04:00PM +0800, Gu Zheng wrote: wq generates the numa affinity (pool-node) for all the possible cpu's per cpu workqueue at init stage, that means the affinity

Re: [PATCH 0/2] workqueue: fix a bug when numa mapping is changed

2015-03-30 Thread Gu Zheng
Hi Kame-san, On 03/27/2015 12:42 AM, Kamezawa Hiroyuki wrote: On 2015/03/27 0:18, Tejun Heo wrote: Hello, On Thu, Mar 26, 2015 at 01:04:00PM +0800, Gu Zheng wrote: wq generates the numa affinity (pool-node) for all the possible cpu's per cpu workqueue at init stage, that means the affinity

Re: [PATCH 0/2] workqueue: fix a bug when numa mapping is changed

2015-03-26 Thread Gu Zheng
Hi Kame-san, On 03/26/2015 11:12 AM, Kamezawa Hiroyuki wrote: On 2015/03/26 11:17, Gu Zheng wrote: Yasuaki Ishimatsu found that with node online/offline, cpu-node relationship is established. Because workqueue uses a info which was established at boot time, but it may be changed by node

[PATCH 2/2] workqueue: update per cpu workqueue's numa affinity when cpu preparing online

2015-03-25 Thread Gu Zheng
Update the per cpu workqueue's numa affinity when cpu preparing online to create the worker on the correct node. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- kernel/workqueue.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c

[PATCH 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-03-25 Thread Gu Zheng
1: slabs: 3261, objs: 136962, free: 127656 == So here we build the persistent [lapic id] -- cpuid mapping when the cpu first present, and never change it. Suggested-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- arch/x86/kernel/apic

[PATCH 0/2] workqueue: fix a bug when numa mapping is changed

2015-03-25 Thread Gu Zheng
/lkml/2015/2/27/145 for the previous discussion. Gu Zheng (2): x86/cpu hotplug: make lapicid - cpuid mapping persistent workqueue: update per cpu workqueue's numa affinity when cpu preparing online arch/x86/kernel/apic/apic.c | 31 ++- kernel/workqueue.c

Re: [PATCH 1/2] x86/cpu hotplug: make apicid -- cpuid mapping persistent

2015-03-25 Thread Gu Zheng
Hi Kame-san, On 03/26/2015 11:19 AM, Kamezawa Hiroyuki wrote: On 2015/03/26 11:17, Gu Zheng wrote: Previously, we build the apicid -- cpuid mapping when the cpu is present, but the relationship will be changed if the cpu/node hotplug happenned, because we always choose the first free

[PATCH] mm/memory hotplog: postpone the reset of obsolete pgdat

2015-03-11 Thread Gu Zheng
-classzone_idx to be 0 rather than the memset 0 to avoid breaking pointer information in pgdat. Reported-by: Xishi Qiu qiuxi...@huawei.com Suggested-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com Cc: sta...@vger.kernel.org Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- mm/memory_hotplug.c | 13

Re: node-hotplug: is memset 0 safe in try_offline_node()?

2015-03-10 Thread Gu Zheng
Hi Xishi, What is the condition of this problem now? Regards, Gu On 03/05/2015 05:39 PM, Xishi Qiu wrote: On 2015/3/5 16:26, Gu Zheng wrote: Hi Xishi, Could you please try the following one? It postpones the reset of obsolete pgdat from try_offline_node() to hotadd_new_pgdat(), and just

Re: node-hotplug: is memset 0 safe in try_offline_node()?

2015-03-05 Thread Gu Zheng
Hi Xishi, Could you please try the following one? It postpones the reset of obsolete pgdat from try_offline_node() to hotadd_new_pgdat(), and just resetting pgdat-nr_zones and pgdat-classzone_idx to be 0 rather than the whole reset by memset() as Kame suggested. Regards, Gu ---

Re: node-hotplug: is memset 0 safe in try_offline_node()?

2015-03-05 Thread Gu Zheng
Hi Xishi, On 03/05/2015 05:39 PM, Xishi Qiu wrote: On 2015/3/5 16:26, Gu Zheng wrote: Hi Xishi, Could you please try the following one? It postpones the reset of obsolete pgdat from try_offline_node() to hotadd_new_pgdat(), and just resetting pgdat-nr_zones and pgdat-classzone_idx

Re: [PATCH] workqueue: update numa affinity when node hotplug

2015-03-04 Thread Gu Zheng
Hi Kamazawa-san, On 03/04/2015 01:45 PM, Kamezawa Hiroyuki wrote: On 2015/03/03 22:18, Tejun Heo wrote: Hello, Kame. On Tue, Mar 03, 2015 at 03:53:46PM +0900, Kamezawa Hiroyuki wrote: relationship between proximity domain and lapic id doesn't change. relationship between lapic-id and cpu-id

Re: node-hotplug: is memset 0 safe in try_offline_node()?

2015-03-04 Thread Gu Zheng
On 03/04/2015 04:53 PM, Kamezawa Hiroyuki wrote: On 2015/03/04 17:03, Xishi Qiu wrote: On 2015/3/4 11:56, Gu Zheng wrote: Hi Xishi, On 03/04/2015 10:52 AM, Xishi Qiu wrote: On 2015/3/4 10:22, Xishi Qiu wrote: On 2015/3/3 18:20, Gu Zheng wrote: Hi Xishi, On 03/03/2015 11:30 AM, Xishi

Re: node-hotplug: is memset 0 safe in try_offline_node()?

2015-03-03 Thread Gu Zheng
Hi Xishi, On 03/04/2015 10:52 AM, Xishi Qiu wrote: On 2015/3/4 10:22, Xishi Qiu wrote: On 2015/3/3 18:20, Gu Zheng wrote: Hi Xishi, On 03/03/2015 11:30 AM, Xishi Qiu wrote: When hot-remove a numa node, we will clear pgdat, but is memset 0 safe in try_offline_node()? It is not safe

Re: node-hotplug: is memset 0 safe in try_offline_node()?

2015-03-03 Thread Gu Zheng
Hi Xishi, On 03/04/2015 10:22 AM, Xishi Qiu wrote: On 2015/3/3 18:20, Gu Zheng wrote: Hi Xishi, On 03/03/2015 11:30 AM, Xishi Qiu wrote: When hot-remove a numa node, we will clear pgdat, but is memset 0 safe in try_offline_node()? It is not safe here. In fact, this is a temporary

Re: node-hotplug: is memset 0 safe in try_offline_node()?

2015-03-03 Thread Gu Zheng
Hi Xishi, On 03/03/2015 11:30 AM, Xishi Qiu wrote: When hot-remove a numa node, we will clear pgdat, but is memset 0 safe in try_offline_node()? It is not safe here. In fact, this is a temporary solution here. As you know, pgdat is accessed lock-less now, so protection mechanism (RCU?) is

[Question] cpu-node relationship changed with node online/offline

2015-03-01 Thread Gu Zheng
Hi numa guys, Yasuaki Ishimatsu found a phenomenon that the numa mapping (cpu-node relationship) changed when hot add/remove node. And this change will cause allocation failure bug to workqueue sub-system: ... SLUB: Unable to allocate memory on node 2 (gfp=0x80d0) cache: kmalloc-192, object

[PATCH] workqueue: update numa affinity when node hotplug

2015-02-27 Thread Gu Zheng
per node pool are already updated by wq_update_unbound_numa() at CPU_DOWN_PREPARE of the last cpu, by existing code. Reported-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- include/linux/memory_hotplug.h |8 +++ kernel/workqueue.c

Re: [RESEND PATCH 1/3] mtd:mtdblock: remove the needless mtdblks_lock

2015-01-07 Thread Gu Zheng
Hi Brian, On 01/08/2015 04:59 AM, Brian Norris wrote: On Wed, Dec 03, 2014 at 10:19:52AM +0800, Gu Zheng wrote: The global lock mtdblks_lock was used to protect the original mtdblks array to avoid race conditions. As the mtdblks array was already gone, but the mtdblks_lock is left

Re: [LKP] [aio] 6098b45b32e: 2200.00% xfstests.generic.239.seconds

2014-12-14 Thread Gu Zheng
Hi Huang, On 12/15/2014 09:02 AM, Huang Ying wrote: FYI, we noticed the below changes on commit 6098b45b32e6baeacc04790773ced9340601d511 (aio: block exit_aio() until all context requests are completed) This patch added a wait step (which is lacked before) for all submitted aio missions

Re: [LKP] [aio] 6098b45b32e: 2200.00% xfstests.generic.239.seconds

2014-12-14 Thread Gu Zheng
Hi Huang, On 12/15/2014 09:02 AM, Huang Ying wrote: FYI, we noticed the below changes on commit 6098b45b32e6baeacc04790773ced9340601d511 (aio: block exit_aio() until all context requests are completed) This patch added a wait step (which is lacked before) for all submitted aio missions

[PATCH v3] net: introduce helper macro for_each_cmsghdr

2014-12-10 Thread Gu Zheng
Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- v3: -drop the changes about user-land programs as David suggested. v2: -use the lower-case macro name as Joe suggested. crypto

Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr

2014-12-10 Thread Gu Zheng
Hi Joe, On 12/10/2014 02:56 PM, Joe Perches wrote: On Wed, 2014-12-10 at 13:36 +0800, Gu Zheng wrote: Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. This looks nicer. Ideally this would have used: [PATCH V3] as the subject

Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr

2014-12-10 Thread Gu Zheng
Hi David, On 12/11/2014 03:44 AM, David Miller wrote: From: David Miller da...@davemloft.net Date: Wed, 10 Dec 2014 13:48:04 -0500 (EST) From: Gu Zheng guz.f...@cn.fujitsu.com Date: Wed, 10 Dec 2014 13:36:25 +0800 Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating

Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr

2014-12-10 Thread Gu Zheng
Hi Joe, On 12/10/2014 10:51 PM, Joe Perches wrote: On Wed, 2014-12-10 at 16:15 +0800, Gu Zheng wrote: On 12/10/2014 02:56 PM, Joe Perches wrote: On Wed, 2014-12-10 at 13:36 +0800, Gu Zheng wrote: Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating cmsghdr from msghdr

Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr

2014-12-10 Thread Gu Zheng
Hi David, On 12/11/2014 09:47 AM, David Miller wrote: From: Gu Zheng guz.f...@cn.fujitsu.com Date: Thu, 11 Dec 2014 09:05:59 +0800 IMO, the user-land programs need to be build with the matched headers separately. You absolutely cannot provide this new interface to userland and expect

[PATCH v2] net: introduce helper macro for_each_cmsghdr

2014-12-09 Thread Gu Zheng
Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- v2: use the lower-case macro name as Joe suggested. --- .../networking/timestamping/timestamping.c |4 +--- .../networking

Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr

2014-12-09 Thread Gu Zheng
There's a mistake in this patch, please ignore it. Sorry for the noise. Regards, Gu On 12/10/2014 09:39 AM, Gu Zheng wrote: Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- v2

Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr

2014-12-09 Thread Gu Zheng
Hi Joe, On 12/10/2014 10:01 AM, Joe Perches wrote: On Wed, 2014-12-10 at 09:39 +0800, Gu Zheng wrote: Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. Does this even compile? So which is it? for_each_cmsghdr

[PATCH v2] net: introduce helper macro for_each_cmsghdr

2014-12-09 Thread Gu Zheng
Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- v2: use the lower-case macro name as Joe suggested. --- .../networking/timestamping/timestamping.c |4 +--- .../networking

Re: [RESEND PATCH] net: introduce helper macra CMSG_FOREACH_HDR

2014-12-05 Thread Gu Zheng
Hi Joe, Thanks for your comment. On 12/05/2014 04:02 PM, Joe Perches wrote: On Fri, 2014-12-05 at 15:14 +0800, Gu Zheng wrote: Introduce helper macra macro Ah~, it's a typo. CMSG_FOREACH_HDR as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. maybe better to use

Re: [PATCH 1/3] f2fs: fix missing kmem_cache_free

2014-12-04 Thread Gu Zheng
Hi Jaegeuk, On 12/05/2014 08:49 AM, Jaegeuk Kim wrote: This patch fixes missing kmem_cache_free when handling errors. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c

[RESEND PATCH] net: introduce helper macra CMSG_FOREACH_HDR

2014-12-04 Thread Gu Zheng
Introduce helper macra CMSG_FOREACH_HDR as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- .../networking/timestamping/timestamping.c |4 +--- .../networking/timestamping/txtimestamp.c |4 +--- crypto

[RESEND PATCH] net/socket.c : introduce helper function do_sock_sendmsg to replace reduplicate code

2014-12-04 Thread Gu Zheng
Introduce helper function do_sock_sendmsg() to simplify sock_sendmsg{_nosec}, and replace reduplicate code. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- net/socket.c | 22 ++ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/net/socket.c b/net/socket.c

[RESEND PATCH 1/3] mtd:mtdblock: remove the needless mtdblks_lock

2014-12-02 Thread Gu Zheng
The global lock mtdblks_lock was used to protect the original mtdblks array to avoid race conditions. As the mtdblks array was already gone, but the mtdblks_lock is left, and it causes latency when open/release dev. So we need to remove it here. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com

[RESEND PATCH 3/3] mtd/mtdblock: introduce helper macro blktrans_dev_to_mtdblk to wrap the conversion (mtd_blktrans_dev to mtdblk_dev)

2014-12-02 Thread Gu Zheng
Introduce helper macro blktrans_dev_to_mtdblk to wrap the conversion (mtd_blktrans_dev to mtdblk_dev), just cleanup. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- drivers/mtd/mtdblock.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/mtd

[RESEND PATCH 2/3] mtd: move the enum definition out of struct mtdblk_dev

2014-12-02 Thread Gu Zheng
Move the enum definition out of struct mtdblk_dev, just cleanup. Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com --- drivers/mtd/mtdblock.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c index bb4c14f..acc00f1 100644

Re: [PATCH 0/6] blk: introduce generic io stat accounting help function

2014-11-24 Thread Gu Zheng
On 11/24/2014 11:03 PM, Jens Axboe wrote: On 11/23/2014 08:05 PM, Gu Zheng wrote: Many block drivers accounting io stat based on bio (e.g. NVMe...), the blk_account_io_start/end() which is based on request does not make sense to them, so here we introduce the similar help function named

Re: [PATCH] net: introduce helper macra CMSG_FOREACH_HDR

2014-11-23 Thread Gu Zheng
Hi David, On 11/24/2014 01:55 PM, David Miller wrote: Your postings do not make it to the mailing list, in fact they don't even make it to the list server itself. Thanks for your reminder. Generally speaking, sites in China have this problem off and on, and in unpredictable ways. Seems

Re: [PATCH] aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer

2014-11-05 Thread Gu Zheng
ping... On 10/31/2014 06:07 PM, Gu Zheng wrote: https://bugzilla.kernel.org/show_bug.cgi?id=86831 Markus reported that when shutting down mysqld (with AIO support, on a ext3 formatted Harddrive) leads to a negative number of dirty pages (underrun to the counter). The negative number

Re: [PATCH] aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer

2014-11-05 Thread Gu Zheng
Hi Andrew, On 11/06/2014 05:00 AM, Andrew Morton wrote: On Wed, 5 Nov 2014 09:56:20 -0500 Benjamin LaHaise b...@kvack.org wrote: On Wed, Nov 05, 2014 at 05:53:11PM +0800, Gu Zheng wrote: ping... I need someone a bit more familiar with this area of code to chime in on reviewing

Re: [f2fs-dev][PATCH 4/5] f2fs: fix to clean previous mount option when remount_fs

2014-09-15 Thread Gu Zheng
Hi Yu, On 09/15/2014 06:04 PM, Chao Yu wrote: In manual of mount, we descript remount as below: mount -o remount,rw /dev/foo /dir After this call all old mount options are replaced and arbitrary stuff from fstab is ignored, except the loop= option which is internally generated and

Re: [f2fs-dev][PATCH 4/5] f2fs: fix to clean previous mount option when remount_fs

2014-09-15 Thread Gu Zheng
On 09/16/2014 11:05 AM, Chao Yu wrote: Hi Gu, -Original Message- From: Gu Zheng [mailto:guz.f...@cn.fujitsu.com] Sent: Tuesday, September 16, 2014 9:51 AM To: Chao Yu Cc: Jaegeuk Kim; Changman Lee; linux-f2fs-de...@lists.sourceforge.net; linux-kernel@vger.kernel.org Subject: Re

Re: [f2fs-dev] [PATCH] f2fs: use lock-less list(llist) to simplify the flush cmd management

2014-09-05 Thread Gu Zheng
Hi Yu, On 09/05/2014 03:07 PM, Chao Yu wrote: Hi Gu, -Original Message- From: Gu Zheng [mailto:guz.f...@cn.fujitsu.com] Sent: Wednesday, September 03, 2014 5:16 PM To: jaeg...@kernel.org Cc: Gu Zheng; linux-kernel@vger.kernel.org; linux-f2fs-de...@lists.sourceforge.net Subject

Re: [PATCH] aio: block exit_aio() until all context requests are completed

2014-09-03 Thread Gu Zheng
Hi Ben, On 09/03/2014 10:43 PM, Benjamin LaHaise wrote: Hi Gu, On Wed, Sep 03, 2014 at 05:45:44PM +0800, Gu Zheng wrote: It seems that exit_aio() also needs to wait for all iocbs to complete (like io_destroy), but we missed the wait step in current implemention, so fix it in the same way

[PATCH 5/7] aio: use the macro rather than the inline magic number

2014-08-15 Thread Gu Zheng
Replace the inline magic number with the ready-made macro(AIO_RING_MAGIC), just clean up. Reviewed-by: Jeff Moyer jmo...@redhat.com Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Benjamin LaHaise b...@kvack.org --- fs/aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 7/7] aio: use iovec array rather than the single one

2014-08-15 Thread Gu Zheng
buffer) will not need to alloc more iovec buffer when copying user vectors. Reviewed-by: Jeff Moyer jmo...@redhat.com Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Benjamin LaHaise b...@kvack.org --- fs/aio.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff

[PATCH 4/7] aio: remove the needless registration of ring file's private_data

2014-08-15 Thread Gu Zheng
Remove the registration of ring file's private_data, we do not use it. Reviewed-by: Jeff Moyer jmo...@redhat.com Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Benjamin LaHaise b...@kvack.org --- fs/aio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/aio.c b/fs/aio.c

[PATCH 6/7] aio: fix some comments

2014-08-15 Thread Gu Zheng
The function comments of aio_run_iocb and aio_read_events are out of date, so fix them here. Reviewed-by: Jeff Moyer jmo...@redhat.com Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Signed-off-by: Benjamin LaHaise b...@kvack.org --- fs/aio.c | 7 +++ 1 file changed, 3 insertions(+), 4

Re: ACPI/cpu hotplug: possible lockdep

2014-07-31 Thread Gu Zheng
/30/2014 09:12 PM, Rafael J. Wysocki wrote: On Wednesday, July 30, 2014 02:10:35 PM Gu Zheng wrote: Hi Rafael, Hi, A lockdep warning occurs when hot removing a cpu via sysfs: echo 1 /sys/bus/acpi/devices/LNXCPU\:02/eject The kernel is latest upstream, and the test box is a kvm vm, detail

ACPI/cpu hotplug: possible lockdep

2014-07-30 Thread Gu Zheng
Hi Rafael, A lockdep warning occurs when hot removing a cpu via sysfs: echo 1 /sys/bus/acpi/devices/LNXCPU\:02/eject The kernel is latest upstream, and the test box is a kvm vm, detail info as following. [ 221.755113] == [ 221.756189] [ INFO:

Re: [f2fs-dev] f2fs: Possible use-after-free when umount filesystem

2014-07-25 Thread Gu Zheng
: Andrey Tsyvarev [mailto:tsyva...@ispras.ru] Sent: Thursday, July 24, 2014 6:15 PM To: Gu Zheng; Chao Yu Cc: 'Jaegeuk Kim'; 'linux-kernel'; 'Alexey Khoroshilov'; linux-f2fs-de...@lists.sourceforge.net Subject: Re: [f2fs-dev] f2fs: Possible use-after-free when umount filesystem Hi, With patch

Re: [PATCH 2/4] aio: use the macro rather than the inline magic number

2014-07-25 Thread Gu Zheng
Hi Lei, On 07/25/2014 11:13 AM, Ming Lei wrote: On Tue, Jul 22, 2014 at 9:54 PM, Jeff Moyer jmo...@redhat.com wrote: Gu Zheng guz.f...@cn.fujitsu.com writes: Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Reviewed-by: Jeff Moyer jmo...@redhat.com --- fs/aio.c |2 +- 1 files

Re: [f2fs-dev][PATCH 2/2] f2fs: fix to put root inode in error path of fill_super

2014-07-25 Thread Gu Zheng
On 07/25/2014 12:55 PM, Chao Yu wrote: We should put root inode correctly in error path of fill_super, otherwise we may encounter a leak case of inode resource. Good catch, and it also fixed the incorrect 'goto'. Signed-off-by: Chao Yu chao2...@samsung.com Reviewed-by: Gu Zheng guz.f

Re: [RESEND PATCH 4/4] aio: use iovec array rather than the single one

2014-07-23 Thread Gu Zheng
Hi Jeff, On 07/23/2014 09:25 PM, Jeff Moyer wrote: Gu Zheng guz.f...@cn.fujitsu.com writes: Previously, we only offer a single iovec to handle all the read/write cases, so the PREADV/PWRITEV request always need to alloc more iovec buffer when copying user vectors. If we use a tmp iovec

Re: [f2fs-dev] f2fs: Possible use-after-free when umount filesystem

2014-07-22 Thread Gu Zheng
Hi, On 07/23/2014 10:12 AM, Chao Yu wrote: Hi Andrey Gu, -Original Message- From: Andrey Tsyvarev [mailto:tsyva...@ispras.ru] Sent: Tuesday, July 22, 2014 6:04 PM To: Gu Zheng Cc: Jaegeuk Kim; linux-kernel; Alexey Khoroshilov; linux-f2fs-de...@lists.sourceforge.net Subject: Re

Re: [PATCH 3/4] aio: fix some comments

2014-07-22 Thread Gu Zheng
On 07/22/2014 10:12 PM, Benjamin LaHaise wrote: On Tue, Jul 22, 2014 at 10:40:03AM +0800, Gu Zheng wrote: Signed-off-by: Gu Zheng guz.f...@cn.fujitsu.com Again, you're missing a commit message here. Please resubmit with a commit message. Got it, I'll resend it later. Thanks, Gu

Re: [PATCH 4/4] aio: use iovec array rather than the single one

2014-07-22 Thread Gu Zheng
Hi Jeff, On 07/22/2014 11:20 PM, Jeff Moyer wrote: Gu Zheng guz.f...@cn.fujitsu.com writes: use an iovec array rather than the single one, so that we can avoid to alloc more iovecs buffer in small( 8) PREADV/PWRITEV cases. I did some basic functional testing of this change and the change

Re: f2fs: Possible use-after-free when umount filesystem

2014-07-21 Thread Gu Zheng
Hi Andrey, On 07/21/2014 06:56 PM, Andrey Tsyvarev wrote: Hello, Using memory error detector reveals the following use-after-free error in 3.15.0: AddressSanitizer: heap-use-after-free in f2fs_evict_inode Read of size 8 by thread T22279: [a02d8702]

  1   2   3   4   5   >