[RFC PATCH v3] workqueue: Introduce a way to set percpu worker_pool's scheduler

2018-01-23 Thread Wen Yang
policy=0 prio=0 nice=-20 # echo "policy=1 prio=2 nice=0" > /sys/devices/virtual/workqueue/system_percpu_highpri/sched_attr # cat /sys/devices/virtual/workqueue/system_percpu_highpri/sched_attr policy=1 prio=2 nice=0 Signed-off-by: Wen Yang Signed-off-by

[RFC PATCH V4 2/5] workqueue: expose attrs for system workqueues

2018-01-24 Thread Wen Yang
Expose sched_attr for system workqueues, such as: # cat /sys/devices/virtual/workqueue/system_percpu/sched_attr policy=0 prio=0 nice=0 cat /sys/devices/virtual/workqueue/system_percpu_highpri/sched_attr policy=0 prio=0 nice=-20 Signed-off-by: Wen Yang Signed

[RFC PATCH V4 1/5] workqueue: rename system workqueues

2018-01-24 Thread Wen Yang
Rename system_wq's wq->name from "events" to "system_percpu", and similarly for the similarly named workqueues. Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu Suggested-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan Cc: linux-kernel

[RFC PATCH V4 5/5] workqueue: introduce a way to set workqueue's scheduler

2018-01-24 Thread Wen Yang
policy=0 prio=0 nice=-20 # echo "policy=1 prio=2 nice=0" > /sys/devices/virtual/workqueue/system_percpu_highpri/sched_attr # cat /sys/devices/virtual/workqueue/system_percpu_highpri/sched_attr policy=1 prio=2 ni

[RFC PATCH V4 3/5] workqueue: rename unbound_attrs to attrs

2018-01-24 Thread Wen Yang
Replace workqueue's unbound_attrs by attrs, so that both unbound or bound wq can use it. Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu Suggested-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan Cc: kernel test robot Cc: linux-kernel@vger.kernel.org --- k

[RFC PATCH V4 4/5] workqueue: convert ->nice to ->sched_attr

2018-01-24 Thread Wen Yang
ck/sched_attr policy=0 prio=0 nice=-1 Also, the possibility of specifying more than just a priority for the wq may be useful for a wide variety of applications. Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu Suggested-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangsha

[RFC PATCH V5 1/5] workqueue: rename system workqueues

2018-01-26 Thread Wen Yang
Rename system_wq's wq->name from "events" to "system_percpu", and similarly for the similarly named workqueues. Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu Suggested-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan Cc: linux-kernel

[RFC PATCH V5 4/5] workqueue: convert ->nice to ->sched_attr

2018-01-26 Thread Wen Yang
The possibility of specifying more than just a nice for the wq may be useful for a wide variety of applications. Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu Suggested-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan Cc: kernel test robot Cc: linux-kernel

[RFC PATCH V5 2/5] workqueue: expose attrs for system workqueues

2018-01-26 Thread Wen Yang
Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu Suggested-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan Cc: kernel test robot Cc: linux-kernel@vger.kernel.org --- kernel/workqueue.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel

[RFC PATCH V5 5/5] workqueue: introduce a way to set workqueue's scheduler

2018-01-26 Thread Wen Yang
1 prio=1 nice=0 # cat /sys/devices/virtual/workqueue/system_percpu_highpri/sched_attr policy=0 prio=0 nice=-20 # echo "policy=1 prio=2 nice=0" > /sys/devices/virtual/workqueue/system_percpu_highpri/sched_attr # cat /sys/devices/virtual/workqueue/system_per

[RFC PATCH V5 3/5] workqueue: rename unbound_attrs to attrs

2018-01-26 Thread Wen Yang
Replace workqueue's unbound_attrs by attrs, so that both unbound or bound wq can use it. Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu Suggested-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan Cc: kernel test robot Cc: linux-kernel@vger.kernel.org --- k

[PATCH] scsi: Replace sdev_printk with printk_deferred to avoid

2018-03-08 Thread Wen Yang
ng because of the slow serial and unstable disks in such senario. Signed-off-by: Wen Yang Signed-off-by: Jiang Biao --- drivers/scsi/scsi_lib.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a86df9c..

[PATCH] perf bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR())

2018-11-27 Thread Wen Yang
Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)). This makes it more readable and also fix this warning detected by err_cast.cocci: tools/perf/util/bpf-loader.c:1606:11-18: WARNING: ERR_CAST can be used with op Signed-off-by: Wen Yang CC: Peter Zijlstra CC: Arnaldo Carvalho de

[PATCH] Fix invalid use of sizeof in stm32_sai_add_mclk_provider()

2018-11-27 Thread Wen Yang
sizeof(mclk) is 4 or 8 as it is the size of a pointer, but we want to reserve space for the pointed data. This issue was detected by using the Coccinelle software. Signed-off-by: Wen Yang CC: Olivier Moysan CC: Arnaud Pouliquen CC: Liam Girdwood CC: Jaroslav Kysela CC: Takashi Iwai CC

[PATCH 1/4] perf intel-pt: fix potential NULL pointer dereference in intel_pt_process_auxtrace_info

2018-11-20 Thread Wen Yang
This patch fixes a possible null pointer dereference in intel_pt_process_auxtrace_info, detected by the semantic patch deref_null.cocci, with the following warning: ./tools/perf/util/intel-pt.c:2579:32-49: ERROR: session -> itrace_synth_opts is NULL but dereferenced. Signed-off-by: Wen Y

[PATCH 4/4] perf intel-pt/bts: fix potential NULL pointer dereference in intel_bts_process_auxtrace_info

2018-11-20 Thread Wen Yang
This patch fixes a possible null pointer dereference in intel_bts_process_auxtrace_info, detected by the semantic patch deref_null.cocci, with the following warning: ./tools/perf/util/intel-bts.c:921:32-49: ERROR: session -> itrace_synth_opts is NULL but dereferenced. Signed-off-by: Wen Y

[PATCH] scsi: megaraid_sas: NULL check before some freeing functions is not needed

2018-11-28 Thread Wen Yang
dma_pool_destroy(NULL) is safe, so removes NULL check before freeing the mem. This patch also fix the ifnullfree.cocci warnings. Signed-off-by: Wen Yang CC: Julia Lawall CC: Kashyap Desai CC: Sumit Saxena CC: Shivasharan S CC: linux-kernel@vger.kernel.org --- drivers/scsi/megaraid

[PATCH v2] ASoC: stm32: sai: Fix invalid use of sizeof in stm32_sai_add_mclk_provider()

2018-11-28 Thread Wen Yang
sizeof(mclk) is 4 or 8 as it is the size of a pointer, but we want to reserve space for the pointed data. This issue was detected by using the Coccinelle software. v2: use subject lines matching the style for the subsystem. Signed-off-by: Wen Yang CC: Mark Brown CC: Olivier Moysan CC: Arnaud

[PATCH] ASoC: stm32: sai: Fix unsigned comparison with less than zero

2018-11-28 Thread Wen Yang
ages < 0") Signed-off-by: Wen Yang CC: Mark Brown CC: Olivier Moysan CC: Arnaud Pouliquen CC: Liam Girdwood CC: Jaroslav Kysela CC: Takashi Iwai CC: Maxime Coquelin CC: Alexandre Torgue CC: Julia Lawall CC: Wen Yang CC: linux-st...@st-md-mailman.stormreply.com CC: linux-kernel@v

[PATCH] platform/x86: intel_ips: Remove unnecessary NULL check before debugfs_remove_recursive

2018-12-05 Thread Wen Yang
debugfs_remove_recursive() accepts a NULL parameter and returns immediately, there's no need for a NULL check in the caller. This issue was detected with the help of Coccinelle. Signed-off-by: Wen Yang CC: Darren Hart CC: Andy Shevchenko CC: platform-driver-...@vger.kernel.org CC:

[PATCH] drivers/fmc: Remove unnecessary NULL check before debugfs_remove_recursive

2018-12-05 Thread Wen Yang
debugfs_remove_recursive() accepts a NULL parameter and returns immediately, there's no need for a NULL check in the caller. This issue was detected with the help of Coccinelle. Signed-off-by: Wen Yang CC: Alessandro Rubini CC: linux-kernel@vger.kernel.org --- drivers/fmc/fmc-debug.

[PATCH] omfs: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Bob Copeland CC: linux-karma-de...@lists.sourceforge.net CC: linux-kernel

[PATCH] PCI: endpoint: functions: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Bob Copeland CC: Kishon Vijay Abraham I CC: Lorenzo Pieralisi CC: Bjorn Helgaas CC

[PATCH] PCI: endpoint: functions: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Bob Copeland CC: Kishon Vijay Abraham I CC: Lorenzo Pieralisi CC: Bjorn Helgaas CC

[PATCH v2] PCI: endpoint: functions: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Kishon Vijay Abraham I CC: Lorenzo Pieralisi CC: Bjorn Helgaas CC: Gustavo Pimentel

[PATCH v2] scsi: aic7xxx: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Hannes Reinecke CC: "James E.J. Bottomley" CC: "Martin K. Peterse

[PATCH] media: siano: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Mauro Carvalho Chehab CC: Tomoki Sekiyama CC: linux-me...@vger.kernel.org CC: linux

[PATCH] scsi: message: fusion: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Sathya Prakash CC: Chaitra P B CC: Suganath Prabu Subramani CC: mpt-fusionlinux

[PATCH] scsi: aic7xxx: Use kmemdup instead of duplicating its function

2018-12-06 Thread Wen Yang
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Hannes Reinecke CC: "James E.J. Bottomley" CC: "Martin K. Peterse

[PATCH] cpu: Bool tests don't need comparisons

2018-12-01 Thread Wen Yang
This is the patch to the file cpu.c which fixes the following coccinelle warning: WARNING: Comparison to bool Signed-off-by: Wen Yang CC: Thomas Gleixner CC: Ingo Molnar CC: Konrad Rzeszutek Wilk CC: Josh Poimboeuf CC: "Peter Zijlstra (Intel)" CC: Peter Zijlstra CC: Mukesh Ojha

[PATCH] locktorture: Fix assignment of boolean variables

2018-12-01 Thread Wen Yang
code more readable. Signed-off-by: Wen Yang CC: Davidlohr Bueso CC: "Paul E. McKenney" CC: Josh Triplett CC: linux-kernel@vger.kernel.org --- kernel/locking/locktorture.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/locking/locktorture.

[PATCH] locktorture: style fix - spaces required around

2018-12-01 Thread Wen Yang
This patch fixes the following checkpatch.pl errors: ERROR: spaces required around that ':' (ctx:VxW) +torture_type, tag, cxt.debug_lock ? " [debug]": "", ^ Signed-off-by: Wen Yang CC

[PATCH] sched/fair: Fix assignment of boolean variables

2018-12-01 Thread Wen Yang
Fix the following warnings reported by coccinelle: kernel//sched/fair.c:7958:3-12: WARNING: Assignment of bool to 0/1 This also makes the code more readable. Signed-off-by: Wen Yang CC: Ingo Molnar CC: Peter Zijlstra CC: linux-kernel@vger.kernel.org --- kernel/sched/fair.c | 2 +- 1 file

[PATCH] sched/fair: Fix typos

2018-12-01 Thread Wen Yang
Fix a few typos detected by the checkpatch script: WARNING: 'intialized' may be misspelled - perhaps 'initialized'? WARNING: 'Substract' may be misspelled - perhaps 'Subtract'? Signed-off-by: Wen Yang CC: Ingo Molnar CC: Peter Zijlstra CC: linux-kernel@

[PATCH v2] locktorture: Fix assignment of boolean variables

2018-12-02 Thread Wen Yang
code more readable. Signed-off-by: Wen Yang CC: Davidlohr Bueso CC: "Paul E. McKenney" CC: Josh Triplett CC: Peter Zijlstra CC: Ingo Molnar CC: Will Deacon CC: linux-kernel@vger.kernel.org --- kernel/locking/locktorture.c | 14 +++--- 1 file changed, 7 insertions(+), 7

[PATCH v2] locktorture: style fix - spaces required around

2018-12-02 Thread Wen Yang
This patch fixes the following checkpatch.pl errors: ERROR: spaces required around that ':' (ctx:VxW) +torture_type, tag, cxt.debug_lock ? " [debug]": "", ^ Signed-off-by: Wen Yang CC

[PATCH] udlfb: fix potential NULL pointer dereference in dlfb_usb_probe

2018-12-02 Thread Wen Yang
{ 1707 usb_put_dev(dlfb->udev); 1708 kfree(dlfb); 1709 } Signed-off-by: Wen Yang CC: Bernie Thompson CC: Bartlomiej Zolnierkiewicz CC: linux-fb...@vger.kernel.org CC: dri-de...@lists.freedesktop.org CC: linux-kernel@vger.kernel.org --- drivers/video/fbdev/ud

[PATCH] VMCI: Use memdup_user() rather than duplicating its implementation

2018-12-10 Thread Wen Yang
Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Wen Yang CC: Arnd Bergmann CC: Greg Kroah-Hartman CC: linux-kernel@vger.kernel.org --- drivers/misc/vmw_vmci/vmci_host.c | 18

[PATCH] net/ibmvnic: Remove tests of member address

2018-12-10 Thread Wen Yang
ethernet/ibm/ibmvnic.c: test of a variable/field address Since such statements always return true, they are redundant. Signed-off-by: Wen Yang CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Thomas Falcon CC: John Allen CC: "David S. Miller" CC: linux

[PATCH] hwspinlock: improve locking safety by using raw_spinlock_t

2024-08-24 Thread Wen Yang
Both __hwspin_trylock and __hwspin_unlock use hwlock->lock, and require running in atomic context, with a special annotation: function will never sleep. However, this requirement is not fulfilled on PREEMPT_RT. To address it, use raw_spinlock_t instead of spin_lock_t. Signed-off-by: Wen Yang

Re: [PATCH] hwspinlock: improve locking safety by using raw_spinlock_t

2024-09-01 Thread Wen Yang
On 2024/8/27 00:37, Bjorn Andersson wrote: On Sat, Aug 24, 2024 at 10:38:47PM GMT, Wen Yang wrote: Both __hwspin_trylock and __hwspin_unlock use hwlock->lock, and require running in atomic context, with a special annotation: function will never sleep. However, this requirement is

Re: [PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_p

2021-04-08 Thread Wen Yang
> On Apr 7, 2021, at 5:16 AM, riteshh wrote: >> >> On 21/04/07 03:01PM, Wen Yang wrote: >>> From: Wen Yang >>> >>> The kworker has occupied 100% of the CPU for several days: >>> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND >

[PATCH] scsi: Introduce sdev_printk_ratelimited to throttle frequent printk

2018-03-28 Thread Wen Yang
x27;s useless to print the same lines frequently after all. Suggested-by: Petr Mladek Suggested-by: Sergey Senozhatsky Signed-off-by: Wen Yang Signed-off-by: Jiang Biao Signed-off-by: Tan Hu CC: BartVanAssche CC: Petr Mladek CC: Sergey Senozhatsky CC: Martin K. Petersen CC: "

[PATCH 03/15] ARM: exynos: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
. ./arch/arm/mach-exynos/suspend.c:642:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 634, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-arm-ker

[PATCH 02/15] ARM: bcm: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
refcount incremented on line 35, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-l...@broadcom.com Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel

[PATCH 04/15] ARM: hisi: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
incremented on line 287, but without a corresponding object release within this function. ./arch/arm/mach-hisi/platmcpm.c:347:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 287, but without a corresponding object release within this function. Signed-off-by: Wen

[PATCH 15/15] ARM: axxia: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
-by: Wen Yang Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-axxia/platsmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c index 502e3df..c706a11 100644 --- a/arch/arm

[PATCH 05/15] ARM: imx51: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
refcount incremented on line 57, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Lucas Stach Cc: linux-arm-ker...@lists.infradead.org Cc

[PATCH 01/15] ARM: actions: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
. ./arch/arm/mach-actions/platsmp.c:137:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 128, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Cc: Russell King

[PATCH 09/15] ARM: socfpga: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
refcount incremented on line 85, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Dinh Nguyen Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-socfpga/platsmp.c | 1 + 1 file changed, 1 insertion

[PATCH 13/15] ARM: zynq: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
: Wen Yang Cc: Russell King Cc: Michal Simek Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-zynq/common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 6aba9eb..a8b1b9c 100644 --- a

[PATCH 11/15] ARM: versatile: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
function. Signed-off-by: Wen Yang Cc: Linus Walleij Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-versatile/versatile_dt.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-versatile

[PATCH 07/15] ARM: rockchip: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
. ./arch/arm/mach-rockchip/platsmp.c:263:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: Heiko Stuebner Cc: linux-arm-ker

[PATCH 06/15] arm: npcm: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
-by: Wen Yang Cc: Avi Fishman Cc: Tomer Maimon Cc: Patrick Venture Cc: Nancy Yuen Cc: Brendan Higgins Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Cc: open...@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-npcm/platsmp.c | 2 ++ 1 file changed, 2 insertions

[PATCH 08/15] ARM: shmobile: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
function. ./arch/arm/mach-shmobile/pm-rcar-gen2.c:90:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Simon Horman Cc: Magnus Damm Cc: Russell King Cc: linux

[PATCH 10/15] ARM: sunxi: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
-off-by: Wen Yang Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-sunxi/platsmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c

[PATCH 12/15] ARM: vexpress: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
. ./arch/arm/mach-vexpress/dcscb.c:171:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 145, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Russell King Cc

[PATCH 14/15] arm64: cpu_ops: fix a leaked reference by addingmissing of_node_put

2019-03-01 Thread Wen Yang
incremented on line 69, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm64/kernel/cpu_ops.c | 1 + 1 file changed, 1 insertion

[PATCH 0/2] fix leaked of_node references in drivers/power

2019-04-16 Thread Wen Yang
issues. Cc: Sebastian Reichel Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Wen Yang (2): power: supply: fix leaked of_node refs in ab8500_bm_of_probe power: supply: fix leaked of_node refs in power_supply_get_battery_info drivers/power/supply/ab8500_bmdata.c | 1

[PATCH 2/2] power: supply: fix leaked of_node refs in power_supply_get_battery_info

2019-04-16 Thread Wen Yang
:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Sebastian Reichel Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/power/supply

[PATCH 1/2] power: supply: fix leaked of_node refs in ab8500_bm_of_probe

2019-04-16 Thread Wen Yang
drivers/power/supply/ab8500_bmdata.c:511:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 502, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Sebastian Reichel Cc: linux...@vger.kernel.org Cc: linux-kerne

[PATCH 3/3] firmware: stratix10-svc: fix leaked of_node references

2019-04-16 Thread Wen Yang
count incremented on line 1014, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Greg Kroah-Hartman Cc: Alan Tull Cc: Richard Gong Cc: Nicolas Saenz Julienne Cc: linux-kernel@vger.kernel.org --- drivers/firmware/stratix10-svc.c | 14 ++ 1

[PATCH 1/3] firmware: arm_sdei: fix leaked of_node references

2019-04-16 Thread Wen Yang
dei.c:1091:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1082, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: James Morse Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- dr

[PATCH 0/3] fix leaked of_node references in drivers/firmware

2019-04-16 Thread Wen Yang
issues. Wen Yang (3): firmware: arm_sdei: fix leaked of_node references firmware: psci: fix leaked of_node references firmware: stratix10-svc: fix leaked of_node references drivers/firmware/arm_sdei.c | 1 + drivers/firmware/psci.c | 4 +++- drivers/firmware/stratix10-svc.c

[PATCH 2/3] firmware: psci: fix leaked of_node references

2019-04-16 Thread Wen Yang
680 if (!np || !of_device_is_available(np)) 682 return -ENODEV; ---> leaked here ... 686 return init_fn(np); ---> released here 687 } Detected by using coccinelle. Signed-off-by: Wen Yang Cc: Mark Rutland Cc: Lorenzo Pieralisi Cc: linux-a

[PATCH] fpga: stratix10-soc: fix use-after-free on s10_init()

2019-04-23 Thread Wen Yang
) Signed-off-by: Wen Yang Cc: Alan Tull Cc: Moritz Fischer Cc: Nicolas Saenz Julienne Cc: linux-f...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/fpga/stratix10-soc.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/fpga/stratix10-soc.c b/drivers

[PATCH v3] ARM: rockchip: fix a leaked reference by adding missing of_node_put

2019-04-26 Thread Wen Yang
/arm/mach-rockchip/platsmp.c:303:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 294, but without a corresponding object release within this function. Signed-off-by: Wen Yang Reviewed-by: Florian Fainelli Suggested-by: Heiko Stuebner Cc: Russell King

[PATCH 0/7] fix possible object reference leaks in drivers/gpu

2019-04-03 Thread Wen Yang
The call to of_get_cpu_node/of_find_compatible_node/of_parse_phandle... returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. This patch series fix those possible object reference leaks in drivers/gpu. Wen Yang (7): drm/mediatek: fix

[PATCH 1/2] net: xilinx: add a helper function for axienet_probe

2019-04-08 Thread Wen Yang
The "Find DMA Node, Map DMA Register, and Decode DMA IRQ" code snippets in Axienet_Probe are independent. Tidy up axienet_probe a little by factoring these out into a helper function. Signed-off-by: Wen Yang Reported-by: Markus Elfring Cc: Anirudha Sarangi Cc: John Linn Cc: "

[PATCH 2/2] net: ethernet: ti: eliminated some duplicate code.

2019-04-08 Thread Wen Yang
Put the code that obtains device_node and the code that uses it tightly together to remove duplicate resource cleanup statements between them. Signed-off-by: Wen Yang Reported-by: Markus Elfring Cc: Markus Elfring Cc: Wingman Kwok (maintainer:TI NETCP ETHERNET DRIVER) Cc: Murali Karicheri

[PATCH 3/3] ASoC: eukrea-tlv320: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
. Signed-off-by: Wen Yang Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-de...@alsa-project.org Cc: linux-kernel@vger.kernel.org --- sound/soc/fsl/eukrea-tlv320.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/eukrea-tlv320

[PATCH 2/3] ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
incremented on line 38, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Timur Tabi Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-de...@alsa-project.org Cc

[PATCH 1/3] ASoC: wcd9335: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
incremented on line 5183, but without a correspon ding object release within this function. Signed-off-by: Wen Yang Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Srinivas Kandagatla Cc: Vinod Koul Cc: Dan Carpenter (commit_signer:1/11=9%,authored:1/11=9%) Cc

[PATCH 2/8] PCI: uniphier: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Kunihiko Hayashi Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Masahiro Yamada Cc: linux-...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/pci/controller

[PATCH 7/8] PCI: mediatek: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
corresponding object release within this function. Signed-off-by: Wen Yang Cc: Ryder Lee Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Matthias Brugger Cc: linux-...@vger.kernel.org Cc: linux-media...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org

[PATCH 6/8] PCI: iproc: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
line 1299, but without a corresponding object release within this function. ./drivers/pci/controller/pcie-iproc.c:1330:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1299, but without a corresponding object release within this function. Signed-off-b

[PATCH 5/8] PCI: aardvark: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
following warnings: ./drivers/pci/controller/pci-aardvark.c:826:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 798, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Thomas Petazzoni Cc: Lorenzo Pieralisi Cc

[PATCH 3/8] PCI: dwc: layerscape: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
pointer with refcount incremented on line 198, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Minghuan Lian Cc: Mingkai Hu Cc: Roy Zang Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: linuxppc-...@lists.ozlabs.org Cc: linux-...@vger.kernel.org Cc: linux

[PATCH 1/8] PCI: dwc: pci-dra7xx: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Kishon Vijay Abraham I Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: linux-o...@vger.kernel.org Cc: linux-...@vger.kernel.org Cc

[PATCH 8/8] PCI: rpadlpar: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
with refcount incremented on line 42, but without a corresponding object release within this function Signed-off-by: Wen Yang Cc: Tyrel Datwyler Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org

[PATCH 4/8] PCI: rockchip: fix a leaked reference by adding missing of_node_put

2019-02-26 Thread Wen Yang
: missing of_node_put; acquired a node pointer with refcount incremented on line 718, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Shawn Lin Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Heiko Stuebner Cc: linux-...@vger.kernel.org Cc: linux-rockc

[PATCH] net: core: explicitly call linkwatch_fire_event to speed up the startup of network services

2020-08-01 Thread Wen Yang
educed from 366ms to 50ms. Signed-off-by: Wen Yang Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Andrew Lunn Cc: Eric Dumazet Cc: Jiri Pirko Cc: Leon Romanovsky Cc: Julian Wiedmann Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- net/core/link_watch.c | 3 +++ net/core/rtn

Re: [PATCH] net: core: explicitly call linkwatch_fire_event to speed up the startup of network services

2020-08-06 Thread Wen Yang
在 2020/8/5 上午6:58, David Miller 写道: From: Wen Yang Date: Sat, 1 Aug 2020 16:58:45 +0800 diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 75431ca..6b9d44b 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -98,6 +98,9 @@ static bool linkwatch_urgent_event

Re: [PATCH v2 4.9 00/10] fix a race in release_task when flushing the dentry

2021-01-07 Thread Wen Yang
在 2021/1/7 下午8:17, Greg Kroah-Hartman 写道: On Thu, Jan 07, 2021 at 03:52:12PM +0800, Wen Yang wrote: The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted when the process exits. Suppose the following race appears: release_task dput

Re: [PATCH v2 4.9 00/10] fix a race in release_task when flushing the dentry

2021-01-07 Thread Wen Yang
在 2021/1/8 上午2:28, Greg Kroah-Hartman 写道: On Fri, Jan 08, 2021 at 12:21:38AM +0800, Wen Yang wrote: 在 2021/1/7 下午8:17, Greg Kroah-Hartman 写道: On Thu, Jan 07, 2021 at 03:52:12PM +0800, Wen Yang wrote: The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted

Re: [PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_p

2021-04-15 Thread Wen Yang
在 2021/4/11 下午12:25, Theodore Ts'o 写道: On Sun, Apr 11, 2021 at 03:45:01AM +0800, Wen Yang wrote: At this time, some logs are lost. It is suspected that the hard disk itself is faulty. If you have a kernel crash dump, that means you can extract out the dmesg buffer, correct? Is there

[PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_preallocations

2021-04-07 Thread Wen Yang
From: Wen Yang The kworker has occupied 100% of the CPU for several days: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 68086 root 20 0 00 0 R 100.0 0.0 9718:18 kworker/u64:11 And the stack obtained through sysrq is as follows: [20613144.850426] task: 8800b5e08000

[PATCH] fs/ext4: prevent the CPU from being 100% occupied in ext4_mb_discard_group_preallocations

2021-04-18 Thread Wen Yang
IO has not returned here is that the process handling IO in the BM hypervisor has failed. The cpu resources of the cloud server are precious, and the server cannot be restarted after running for a long time. So it's slightly optimized here to prevent the CPU from being 100% occupied. Signed-off-b

Re: [PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_p

2021-04-10 Thread Wen Yang
在 2021/4/9 下午1:47, riteshh 写道: On 21/04/09 02:50AM, Wen Yang wrote: On Apr 7, 2021, at 5:16 AM, riteshh wrote: On 21/04/07 03:01PM, Wen Yang wrote: From: Wen Yang The kworker has occupied 100% of the CPU for several days: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 68086

[PATCH 02/10] pidfd: add polling support

2020-12-03 Thread Wen Yang
k conflicts for b53b0b9d9a61) Signed-off-by: Wen Yang --- include/linux/pid.h | 3 +++ kernel/fork.c | 26 ++ kernel/pid.c| 2 ++ kernel/signal.c | 11 +++ 4 files changed, 42 insertions(+) diff --git a/include/linux/pid.h b/include/linux/pid.

[PATCH 03/10] proc: Pass file mode to proc_pid_make_inode

2020-12-03 Thread Wen Yang
sclass right away without introducing "half-initialized" inode security structs. Signed-off-by: Andreas Gruenbacher Signed-off-by: Paul Moore Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c | 23 +-- fs/proc/fd.c | 6 ++ fs/proc/inter

[PATCH 01/10] clone: add CLONE_PIDFD

2020-12-03 Thread Wen Yang
Cc: Kees Cook Cc: Thomas Gleixner Cc: David Howells Cc: "Michael Kerrisk (man-pages)" Cc: Andy Lutomirsky Cc: Andrew Morton Cc: Aleksa Sarai Cc: Linus Torvalds Cc: Al Viro Cc: # 4.9.x (clone: fix up cherry-pick conflicts for b3e583825266) Signed-off-by: Wen Yang --- include/

[PATCH 04/10] proc: Better ownership of files for non-dumpable tasks in user namespaces

2020-12-03 Thread Wen Yang
ot to have things work as expected in a container. Signed-off-by: "Eric W. Biederman" Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c | 102 ++--- fs/proc/fd.c | 12 +-- fs/proc/internal.h | 16 ++--- 3 files ch

[PATCH 00/10] Cover letter: fix a race in release_task when flushing the dentry

2020-12-03 Thread Wen Yang
= 0644, + .proc_handler = proc_dointvec, + .extra1 = &zero, + }, + { + .procname = "dentry_debug_pid", + .data = &sysctl_dentry_debug_pid, + .maxlen = sizeof(sysctl_

[PATCH 05/10] proc: use %u for pid printing and slightly less stack

2020-12-03 Thread Wen Yang
1120203005.GA27743@avx2 Signed-off-by: Alexey Dobriyan Cc: Alexander Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c| 16 fs/proc/fd.c | 2 +- fs/proc/self.c| 6 +++--

[PATCH 06/10] proc: Rename in proc_inode rename sysctl_inodes sibling_inodes

2020-12-03 Thread Wen Yang
a generic name so it is clear that it is no longer sysctl specific. Also for good measure initialize sibling_inodes when proc_inode is initialized. Signed-off-by: Eric W. Biederman Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 1 + fs/proc/internal.h| 2 +- fs/proc/pro

[PATCH 07/10] proc: Generalize proc_sys_prune_dcache into proc_prune_siblings_dcache

2020-12-03 Thread Wen Yang
5f) Signed-off-by: Wen Yang --- fs/proc/inode.c | 38 ++ fs/proc/internal.h| 1 + fs/proc/proc_sysctl.c | 35 +-- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c ind

[PATCH 08/10] proc: Clear the pieces of proc_inode that proc_evict_inode cares about

2020-12-03 Thread Wen Yang
uot; Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 920c761..739fb9c 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -32,21 +32,27 @@ static void proc_evict_

[PATCH 09/10] proc: Use d_invalidate in proc_prune_siblings_dcache

2020-12-03 Thread Wen Yang
make this code robust to future changes in proc. Signed-off-by: "Eric W. Biederman" Cc: # 4.9.x (proc: fix up cherry-pick conflicts for f90f3cafe8d5) Signed-off-by: Wen Yang --- fs/proc/inode.c | 16 ++-- fs/proc/internal.h| 2 +- fs/proc/proc_sysctl.c |

[PATCH 10/10] proc: Use a list of inodes to flush from proc

2020-12-03 Thread Wen Yang
9.x: 7144801: proc: Clear the pieces of proc_inode that proc_evict_inode cares about Cc: # 4.9.x: f90f3ca: Use d_invalidate in proc_prune_siblings_dcache Cc: # 4.9.x (proc: fix up cherry-pick conflicts for 7bc3e6e55acf) Signed-off-by: Wen Yang --- fs/proc/base.c | 111 --

  1   2   3   >