[PATCH v3] mm: compaction: update the cc->nr_migratepages when allocating or freeing the freepages

2024-02-19 Thread Baolin Wang
7351.11 ( 0.00%) 6950.51 * 5.45%* Amean fault-both-24 9059.30 ( 0.00%) 9159.99 * -1.11%* Amean fault-both-3010685.68 ( 0.00%)11399.02 * -6.68%* Signed-off-by: Baolin Wang Acked-by: Mel Gorman --- Hi Andrew, please use this patch to replace below 2 old patc

Re: [PATCH v2 1/2] fuse: Fix possible deadlock when writing back dirty pages

2021-04-14 Thread Baolin Wang
在 2021/4/14 17:47, Miklos Szeredi 写道: On Wed, Apr 14, 2021 at 11:22 AM Baolin Wang wrote: 在 2021/4/14 17:02, Miklos Szeredi 写道: On Wed, Apr 14, 2021 at 10:42 AM Baolin Wang wrote: Sorry I missed this patch before, and I've tested this patch, it seems can solve the deadlock issue I

Re: [PATCH v2 1/2] fuse: Fix possible deadlock when writing back dirty pages

2021-04-14 Thread Baolin Wang
在 2021/4/14 17:02, Miklos Szeredi 写道: On Wed, Apr 14, 2021 at 10:42 AM Baolin Wang wrote: Sorry I missed this patch before, and I've tested this patch, it seems can solve the deadlock issue I met before. Great, thanks for testing. But look at this patch in detail, I think this patch

Re: [PATCH v2 1/2] fuse: Fix possible deadlock when writing back dirty pages

2021-04-14 Thread Baolin Wang
Hi, 在 2021/4/13 16:57, Miklos Szeredi 写道: On Mon, Apr 12, 2021 at 3:23 PM Baolin Wang wrote: Hi Miklos, 在 2021/3/27 14:36, Baolin Wang 写道: We can meet below deadlock scenario when writing back dirty pages, and writing files at the same time. The deadlock scenario can be reproduced

Re: [PATCH v2 1/2] fuse: Fix possible deadlock when writing back dirty pages

2021-04-12 Thread Baolin Wang
Hi Miklos, 在 2021/3/27 14:36, Baolin Wang 写道: We can meet below deadlock scenario when writing back dirty pages, and writing files at the same time. The deadlock scenario can be reproduced by: - A writeback worker thread A is trying to write a bunch of dirty pages by fuse_writepages

[PATCH v2 2/2] fuse: Remove unused parameter

2021-03-27 Thread Baolin Wang
Since we move the fuse_wait_on_page_writeback() to fuse_fill_write_pages(), thus remove the unused 'inode' parameter of fuse_send_write_pages(). Signed-off-by: Baolin Wang --- Changes from v1: - New patch. --- fs/fuse/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[PATCH v2 1/2] fuse: Fix possible deadlock when writing back dirty pages

2021-03-27 Thread Baolin Wang
+0x10/0x14 Suggested-by: Peng Tao Signed-off-by: Baolin Wang --- Changes from v1: - Use fuse_wait_on_page_writeback() instead to wait for page stable. --- fs/fuse/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 8cccecb

Re: [PATCH] fuse: Fix possible deadlock when writing back dirty pages

2021-03-26 Thread Baolin Wang
/0x14 Suggested-by: Peng Tao Signed-off-by: Baolin Wang --- fs/fuse/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 8cccecb..af082b6 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1166,6 +1166,8 @@ static ssize_t fuse_fill_write_pages

[PATCH] fuse: Fix possible deadlock when writing back dirty pages

2021-03-26 Thread Baolin Wang
Suggested-by: Peng Tao Signed-off-by: Baolin Wang --- fs/fuse/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 8cccecb..af082b6 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1166,6 +1166,8 @@ static ssize_t fuse_fill_write_pages(struct

[PATCH] mm: cma: Use pr_err_ratelimited for CMA warning

2021-03-09 Thread Baolin Wang
If we did not reserve extra CMA memory, the log buffer can be easily filled up by CMA failure warning when the devices calling dmam_alloc_coherent() to alloc DMA memory. Thus we can use pr_err_ratelimited() instead to reduce the duplicate CMA warning. Signed-off-by: Baolin Wang --- mm/cma.c | 4

Re: [PATCH v2 3/3] mailbox: sprd: Add supplementary inbox support

2021-03-07 Thread Baolin Wang
not emergency messages from the remote cores, such as step counting > sensor, with an independent FIFO and interrupt which is as same as channel > 0. Meanwihle, inbox part of this channel is still kept for original remote > core to use. > > Signed-off-by: Orson Zhai Reviewed-by: Baol

Re: [PATCH v2 1/3] mailbox: sprd: Introduce refcnt when clients requests/free channels

2021-03-07 Thread Baolin Wang
n requested by client yet. > > Fixes: ca27fc26cd22 ("mailbox: sprd: Add Spreadtrum mailbox driver") > Signed-off-by: Orson Zhai Sorry for the late reply. LGTM. Reviewed-by: Baolin Wang > --- > drivers/mailbox/sprd-mailbox.c | 43 +++--- >

Re: [PATCH 2/3] mailbox: sprd: Add supplementary inbox support

2021-02-09 Thread Baolin Wang
On Tue, Feb 9, 2021 at 12:09 PM Orson Zhai wrote: > > On Mon, Feb 08, 2021 at 10:27:47PM +0800, Baolin Wang wrote: > > On Mon, Feb 8, 2021 at 7:52 PM Orson Zhai wrote: > > > > > > From: Orson Zhai > > > > > > Some sensors connected

Re: [PATCH 1/3] mailbox: sprd: Introduce refcnt when clients requests/free channels

2021-02-09 Thread Baolin Wang
On Tue, Feb 9, 2021 at 11:28 AM Orson Zhai wrote: > > On Mon, Feb 08, 2021 at 10:06:47PM +0800, Baolin Wang wrote: > > Hi Orson, > > > > On Mon, Feb 8, 2021 at 7:52 PM Orson Zhai wrote: > > > > > > From: Orson Zhai > > > > > > Uni

[PATCH] mm: backing-dev: Remove duplicated macro definition

2021-02-09 Thread Baolin Wang
Move the K() macro a little forward to remove the same macro definition. Signed-off-by: Baolin Wang --- mm/backing-dev.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 71a2bf4..576220a 100644 --- a/mm/backing-dev.c +++ b/mm

Re: [PATCH 2/3] mailbox: sprd: Add supplementary inbox support

2021-02-08 Thread Baolin Wang
dev_err(dev, "failed to request outbox IRQ: %d\n", > ret); > + return ret; > + } > + > + supp = (unsigned long) of_device_get_match_data(dev); > + if (!supp) { > + dev_err(dev, "no supplementary outbox specified\n"); > + return -ENODEV; > + } > + priv->supp_base = priv->outbox_base + (SPRD_OUTBOX_BASE_SPAN > * supp); > + } > + > /* Get the default outbox FIFO depth */ > priv->outbox_fifo_depth = > readl(priv->outbox_base + SPRD_MBOX_FIFO_DEPTH) + 1; > @@ -354,7 +410,8 @@ static int sprd_mbox_probe(struct platform_device *pdev) > } > > static const struct of_device_id sprd_mbox_of_match[] = { > - { .compatible = "sprd,sc9860-mailbox", }, > + { .compatible = "sprd,sc9860-mailbox", > + .data = (void *)SPRD_SUPP_INBOX_ID_SC9860 }, > { }, > }; > MODULE_DEVICE_TABLE(of, sprd_mbox_of_match); > -- > 2.7.4 > -- Baolin Wang

Re: [PATCH 1/3] mailbox: sprd: Introduce refcnt when clients requests/free channels

2021-02-08 Thread Baolin Wang
writel(SPRD_OUTBOX_FIFO_IRQ_MASK, priv->outbox_base + > SPRD_MBOX_IRQ_MSK); > + } > + mutex_unlock(>lock); > } > > static const struct mbox_chan_ops sprd_mbox_ops = { > @@ -266,6 +276,8 @@ static int sprd_mbox_probe(struct platform_device *pdev) > return -ENOMEM; > > priv->dev = dev; > + priv->refcnt = 0; No need to do this, the priv structure is already cleared to 0. > + mutex_init(>lock); > > /* > * The Spreadtrum mailbox uses an inbox to send messages to the target > -- > 2.7.4 > -- Baolin Wang

Re: [PATCH] mailbox: sprd: correct definition of SPRD_OUTBOX_FIFO_FULL

2021-02-04 Thread Baolin Wang
-off-by: Magnum Shan > Signed-off-by: Chunyan Zhang LGTM. Reviewed-by: Baolin Wang > --- > drivers/mailbox/sprd-mailbox.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mailbox/sprd-mailbox.c b/drivers/mailbox/sprd-mailbox.c > index f6fab24

[PATCH] blk-cgroup: Remove obsolete macro

2021-01-27 Thread Baolin Wang
Remove the obsolete 'MAX_KEY_LEN' macro. Signed-off-by: Baolin Wang --- block/blk-cgroup.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 4b4fcb5..a317c03 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -32,8 +32,6 @@ #include

[PATCH v3] blk-cgroup: Use cond_resched() when destroy blkgs

2021-01-27 Thread Baolin Wang
]  blkcg_destroy_blkgs+0x68/0x150 [ 4757.010701]  cgwb_release_workfn+0x104/0x158 [ 4757.010702]  process_one_work+0x1bc/0x3f0 [ 4757.010704]  worker_thread+0x164/0x468 [ 4757.010705]  kthread+0x108/0x138 Suggested-by: Tejun Heo Signed-off-by: Baolin Wang --- Changes from v2: - Simplify logics

Re: [PATCH v2] blk-cgroup: Use cond_resched() when destroy blkgs

2021-01-27 Thread Baolin Wang
在 2021/1/28 11:41, Jens Axboe 写道: On 1/27/21 8:22 PM, Baolin Wang wrote: On !PREEMPT kernel, we can get below softlockup when doing stress testing with creating and destroying block cgroup repeatly. The reason is it may take a long time to acquire the queue's lock in the loop

[PATCH v2] blk-cgroup: Use cond_resched() when destroy blkgs

2021-01-27 Thread Baolin Wang
]  blkcg_destroy_blkgs+0x68/0x150 [ 4757.010701]  cgwb_release_workfn+0x104/0x158 [ 4757.010702]  process_one_work+0x1bc/0x3f0 [ 4757.010704]  worker_thread+0x164/0x468 [ 4757.010705]  kthread+0x108/0x138 Suggested-by: Tejun Heo Signed-off-by: Baolin Wang --- Changes from v1: - Add might_sleep

Re: [PATCH] blk-cgroup: Use cond_resched() when destroy blkgs

2021-01-27 Thread Baolin Wang
Hi Tejun, Hello, Baolin. On Tue, Jan 26, 2021 at 09:33:25PM +0800, Baolin Wang wrote: On !PREEMPT kernel, we can get below softlockup when doing stress testing with creating and destroying block cgroup repeatly. The reason is it may take a long time to acquire the queue's lock in the loop

[PATCH] blk-cgroup: Use cond_resched() when destroy blkgs

2021-01-26 Thread Baolin Wang
+0x1bc/0x3f0 [ 4757.010704]  worker_thread+0x164/0x468 [ 4757.010705]  kthread+0x108/0x138 Signed-off-by: Baolin Wang --- block/blk-cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 3465d6e..af7c0ce 100644 --- a/block/blk

Re: [PATCH] mm/filemap: Remove redundant variable's assignment

2021-01-26 Thread Baolin Wang
在 2021/1/26 7:22, Andrew Morton 写道: On Mon, 25 Jan 2021 11:20:02 +0800 Baolin Wang wrote: We've already set the variable 'i' 's initial value before using it, thus remove redundant previous assignment of variable 'i'. ... --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2472,7 +2472,6

[PATCH] mm/filemap: Remove redundant variable's assignment

2021-01-24 Thread Baolin Wang
We've already set the variable 'i' 's initial value before using it, thus remove redundant previous assignment of variable 'i'. Signed-off-by: Baolin Wang --- mm/filemap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index e4906f5..07b02f3 100644 --- a/mm

Re: [PATCH] i2c: sprd:: depend on COMMON_CLK to fix compile tests

2021-01-19 Thread Baolin Wang
t; `sprd_i2c_probe': > i2c-sprd.c:(.text.sprd_i2c_probe+0x254): undefined reference to > `clk_set_parent' > > Fixes: 4a2d5f663dab ("i2c: Enable compile testing for more drivers") > Reported-by: kernel test robot > Signed-off-by: Krzysztof Kozlowski LGTM. Thanks. R

Re: [PATCH v2] pinctrl: sprd: Simplify bool comparison

2021-01-13 Thread Baolin Wang
ed-by or acked-by tag for the following version if no other big changes. So again Reviewed-by: Baolin Wang > --- > Changes in v2: > - make "pinctrl: sprd:" as subject prefix > > drivers/pinctrl/sprd/pinctrl-sprd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

Re: [PATCH] pinctrl: sprd: style: Simplify bool comparison

2021-01-12 Thread Baolin Wang
: Simplify xxx", otherwise Reviewed-by: Baolin Wang > --- > drivers/pinctrl/sprd/pinctrl-sprd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c > b/drivers/pinctrl/sprd/pinctrl-sprd.c > index 08dc193..dca7a5

[PATCH] mm/filemap: Remove unused parameter and change to void type for replace_page_cache_page()

2021-01-07 Thread Baolin Wang
Since commit 74d609585d8b ("page cache: Add and replace pages using the XArray") was merged, the replace_page_cache_page() can not fail and always return 0, we can remove the redundant return value and void it. Moreover remove the unused gfp_mask. Signed-off-by: Baolin Wang --- fs/

Re: [PATCH 1/2] blk-iocost: Add iocg idle state tracepoint

2020-12-16 Thread Baolin Wang
Hi Jens, It will be helpful to trace the iocg's whole state, including active and idle state. And we can easily expand the original iocost_iocg_activate trace event to support a state trace class, including active and idle state tracing. Signed-off-by: Baolin Wang Could you pick up patch 1

Re: [PATCH 2/2] blk-iocost: Use alloc_percpu_gfp() to simplify the code

2020-12-16 Thread Baolin Wang
Hi Tejun, Hello, On Fri, Dec 11, 2020 at 03:13:29PM +0800, Baolin Wang wrote: Thanks for teaching me this, at least I did not get this from the local_ops Documentation before. Just out of curiosity, these local[64]_t variables are also allocated from budy allocator ultimately, why they can

Re: [PATCH 2/2] blk-iocost: Use alloc_percpu_gfp() to simplify the code

2020-12-10 Thread Baolin Wang
Hi Tejun, Hello, On Thu, Dec 10, 2020 at 06:56:45PM +0800, Baolin Wang wrote: Use alloc_percpu_gfp() with __GFP_ZERO flag, which can remove some explicit initialization code. __GFP_ZERO is implicit for percpu allocations and local[64]_t's initial states aren't guaranteed to be all zeros

[PATCH 1/2] blk-iocost: Add iocg idle state tracepoint

2020-12-10 Thread Baolin Wang
It will be helpful to trace the iocg's whole state, including active and idle state. And we can easily expand the original iocost_iocg_activate trace event to support a state trace class, including active and idle state tracing. Signed-off-by: Baolin Wang --- block/blk-iocost.c| 3

[PATCH 2/2] blk-iocost: Use alloc_percpu_gfp() to simplify the code

2020-12-10 Thread Baolin Wang
Use alloc_percpu_gfp() with __GFP_ZERO flag, which can remove some explicit initialization code. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index ac6078a..52ce2e3

Re: [PATCH v2 0/5] Some cleanups and improvements for blk-iocost

2020-12-06 Thread Baolin Wang
with the code in patch 3. - Move the commit_weights() into ioc_check_iocgs(). - Move more related logics of adjusting base vrate into the ioc_adjust_base_vrate(). - Rename the new functions. Could you take this patch set if no objection from your side? Thanks. Baolin Wang (5): blk

Re: [RFC PATCH] blk-iocost: Optimize the ioc_refreash_vrate() function

2020-12-03 Thread Baolin Wang
在 2020/12/3 4:32, Tejun Heo 写道: On Sun, Nov 29, 2020 at 10:37:18AM +0800, Baolin Wang wrote: The ioc_refreash_vrate() will only be called in ioc_timer_fn() after starting a new period or stopping the period. So when starting a new period, the variable 'pleft' in ioc_refreash_vrate

[PATCH] mm/vmalloc: Remove unnecessary return statement

2020-12-01 Thread Baolin Wang
Remove unnecessary return statement for void function. Signed-off-by: Baolin Wang --- mm/vmalloc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 6ae491a..c290fc9 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2275,7 +2275,6 @@ static void __vunmap(const

[RFC PATCH] blk-iocost: Optimize the ioc_refreash_vrate() function

2020-11-28 Thread Baolin Wang
ime, the vcomp is 0, and we do not need compensate the vtime_rate in this case, just set it as the base vrate and return. When stopping the period, the ioc->vtime_err will be cleared to 0, and we also do not need to compensate the vtime_rate, just set it as the base vrate and return. Signed-off-by:

[PATCH v2 2/5] blk-iocost: Remove unnecessary advance declaration

2020-11-26 Thread Baolin Wang
Remove unnecessary advance declaration of struct ioc_gq. Signed-off-by: Baolin Wang Acked-by: Tejun Heo --- block/blk-iocost.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 4ffde36..103ccbd 100644 --- a/block/blk-iocost.c +++ b/block/blk

[PATCH v2 0/5] Some cleanups and improvements for blk-iocost

2020-11-26 Thread Baolin Wang
in patch 3. - Move the commit_weights() into ioc_check_iocgs(). - Move more related logics of adjusting base vrate into the ioc_adjust_base_vrate(). - Rename the new functions. Baolin Wang (5): blk-iocost: Fix some typos in comments blk-iocost: Remove unnecessary advance declaration blk

[PATCH v2 4/5] blk-iocost: Factor out the active iocgs' state check into a separate function

2020-11-26 Thread Baolin Wang
Factor out the iocgs' state check into a separate function to simplify the ioc_timer_fn(). No functional change. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 94 +++--- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/block

[PATCH v2 3/5] blk-iocost: Move the usage ratio calculation to the correct place

2020-11-26 Thread Baolin Wang
We only use the hweight based usage ratio to calculate the new hweight_inuse of the iocg to decide if this iocg can donate some surplus vtime. Thus move the usage ratio calculation to the correct place to avoid unnecessary calculation for some vtime shortage iocgs. Signed-off-by: Baolin Wang

[PATCH v2 5/5] blk-iocost: Factor out the base vrate change into a separate function

2020-11-26 Thread Baolin Wang
Factor out the base vrate change code into a separate function to fimplify the ioc_timer_fn(). No functional change. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 99 +- 1 file changed, 54 insertions(+), 45 deletions(-) diff --git

[PATCH v2 1/5] blk-iocost: Fix some typos in comments

2020-11-26 Thread Baolin Wang
Fix some typos in comments. Signed-off-by: Baolin Wang Acked-by: Tejun Heo --- block/blk-iocost.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index bbe86d1..4ffde36 100644 --- a/block/blk-iocost.c +++ b/block/blk

Re: [PATCH 4/7] blk-iocost: Add a flag to indicate if need update hwi

2020-11-25 Thread Baolin Wang
Hello, On Tue, Nov 24, 2020 at 11:33:33AM +0800, Baolin Wang wrote: @@ -1445,7 +1447,8 @@ static void iocg_kick_waitq(struct ioc_gq *iocg, bool pay_debt, * after the above debt payment. */ ctx.vbudget = vbudget; - current_hweight(iocg, NULL, _inuse

Re: [PATCH 7/7] blk-iocost: Factor out the base vrate change into a separate function

2020-11-25 Thread Baolin Wang
Hello, On Tue, Nov 24, 2020 at 11:33:36AM +0800, Baolin Wang wrote: @@ -2320,45 +2358,11 @@ static void ioc_timer_fn(struct timer_list *timer) ioc->busy_level = clamp(ioc->busy_level, -1000, 1000); if (ioc->busy_level > 0 || (ioc->busy_level <

Re: [PATCH 6/7] blk-iocost: Factor out the active iocgs' state check into a separate function

2020-11-25 Thread Baolin Wang
Hello, On Tue, Nov 24, 2020 at 11:33:35AM +0800, Baolin Wang wrote: -static void ioc_timer_fn(struct timer_list *timer) +/* + * Waiters determine the sleep durations based on the vrate they + * saw at the time of sleep. If vrate has increased, some waiters + * could be sleeping for too long

Re: [PATCH 5/7] blk-iocost: Move the usage ratio calculation to the correct place

2020-11-25 Thread Baolin Wang
在 2020/11/25 20:19, Tejun Heo 写道: Hello, @@ -2225,6 +2207,25 @@ static void ioc_timer_fn(struct timer_list *timer) time_before64(vtime, now.vnow - ioc->margins.low))) { u32 hwa, old_hwi, hwm, new_hwi; + if (vdone != vtime) { +

Re: [PATCH 3/7] blk-iocost: Just open code the q_name()

2020-11-25 Thread Baolin Wang
On Tue, Nov 24, 2020 at 11:33:32AM +0800, Baolin Wang wrote: The simple q_name() function is only called from ioc_name(), just open code it to make code more readable. Signed-off-by: Baolin Wang I'm not sure this is an improvement. Either way seems fine to me. So, why change? Yes

[PATCH 2/7] blk-iocost: Remove unnecessary advance declaration

2020-11-23 Thread Baolin Wang
Remove unnecessary advance declaration of struct ioc_gq. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 4ffde36..103ccbd 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -370,8

[PATCH 7/7] blk-iocost: Factor out the base vrate change into a separate function

2020-11-23 Thread Baolin Wang
Factor out the base vrate change code into a separate function to fimplify the ioc_timer_fn(). No functional change. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 78 -- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git

[PATCH 0/7] Some cleanups and improvements for blk-iocost

2020-11-23 Thread Baolin Wang
Hi, This patch set did some cleanups and improvements for blk-iocost, and no big functional changes. Please help to review. Thanks. Baolin Wang (7): blk-iocost: Fix some typos in comments blk-iocost: Remove unnecessary advance declaration blk-iocost: Just open code the q_name() blk

[PATCH 5/7] blk-iocost: Move the usage ratio calculation to the correct place

2020-11-23 Thread Baolin Wang
We only use the hweight based usage ratio to calculate the new hweight_inuse of the iocg to decide if this iocg can donate some surplus vtime. Thus move the usage ratio calculation to the correct place to avoid unnecessary calculation for some vtime shortage iocgs. Signed-off-by: Baolin Wang

[PATCH 3/7] blk-iocost: Just open code the q_name()

2020-11-23 Thread Baolin Wang
The simple q_name() function is only called from ioc_name(), just open code it to make code more readable. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index 103ccbd

[PATCH 6/7] blk-iocost: Factor out the active iocgs' state check into a separate function

2020-11-23 Thread Baolin Wang
Factor out the iocgs' state check into a separate function to simplify the ioc_timer_fn(). No functional change. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 91 ++ 1 file changed, 51 insertions(+), 40 deletions(-) diff --git a/block

[PATCH 4/7] blk-iocost: Add a flag to indicate if need update hwi

2020-11-23 Thread Baolin Wang
We can get the hwa and hwi at one time if no debt need to pay off, thus add a flag to indicate if the hw_inuse has been changed and need to update, which can avoid calling current_hweight() twice for no debt iocgs. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 7 +-- 1 file changed, 5

[PATCH 1/7] blk-iocost: Fix some typos in comments

2020-11-23 Thread Baolin Wang
Fix some typos in comments. Signed-off-by: Baolin Wang --- block/blk-iocost.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index bbe86d1..4ffde36 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -39,7 +39,7

Re: [PATCH] arm64: PCI: Validate the node before setting node id for root bus

2020-11-09 Thread Baolin Wang
Hi Lorenzo, On Tue, Sep 29, 2020 at 11:41:29PM +0800, Baolin Wang wrote: Hi, 锟斤拷 2020/9/28 23:23, Lorenzo Pieralisi 写锟斤拷: On Mon, Sep 28, 2020 at 10:49:57PM +0800, Baolin Wang wrote: On Mon, Sep 28, 2020 at 03:00:55PM +0100, Will Deacon wrote: [+ Lorenzo] On Tue, Sep 22, 2020 at 06:33

Re: [PATCH] nvme: Simplify the nvme_req_qid()

2020-11-02 Thread Baolin Wang
Hi, Use the request's '->mq_hctx->queue_num' directly to simplify the nvme_req_qid() function. Signed-off-by: Baolin Wang Gentle ping? --- drivers/nvme/host/nvme.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/

[PATCH] nvme: Simplify the nvme_req_qid()

2020-10-27 Thread Baolin Wang
Use the request's '->mq_hctx->queue_num' directly to simplify the nvme_req_qid() function. Signed-off-by: Baolin Wang --- drivers/nvme/host/nvme.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index cc3..0

[PATCH v2 8/8] blk-throttle: Re-use the throtl_set_slice_end()

2020-10-07 Thread Baolin Wang
Re-use throtl_set_slice_end() to remove duplicate code. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index fc5c14f..b771c42 100644 --- a/block/blk-throttle.c +++ b/block/blk

[PATCH v2 0/8] Some improvements for blk throttle

2020-10-07 Thread Baolin Wang
Hi, This patch set did some improvements for blk throttle, please help to review. Thanks. Changes from v1: - Add another 4 new patches in this patch set. Baolin Wang (8): blk-throttle: Remove a meaningless parameter for throtl_downgrade_state() blk-throttle: Avoid getting the current

[PATCH v2 7/8] blk-throttle: Open code __throtl_de/enqueue_tg()

2020-10-07 Thread Baolin Wang
The __throtl_de/enqueue_tg() functions are only be called by throtl_de/enqueue_tg(), thus we can just open code them to make code more readable. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git

[PATCH v2 3/8] blk-throttle: Avoid tracking latency if low limit is invalid

2020-10-07 Thread Baolin Wang
The IO latency tracking is only for LOW limit, so we should add a validation to avoid redundant latency tracking if the LOW limit is not valid. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block

[PATCH v2 4/8] blk-throttle: Fix IO hang for a corner case

2020-10-07 Thread Baolin Wang
It can not scale up in throtl_adjusted_limit() if we set bps or iops is 1, which will cause IO hang when enable low limit. Thus we should treat 1 as a illegal value to avoid this issue. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 8 1 file changed, 4 insertions(+), 4

[PATCH v2 2/8] blk-throttle: Avoid getting the current time if tg->last_finish_time is 0

2020-10-07 Thread Baolin Wang
We only update the tg->last_finish_time when the low limitaion is enabled, so we can move the tg->last_finish_time validation a little forward to avoid getting the unnecessary current time stamp if the the low limitation is not enabled. Signed-off-by: Baolin Wang --- block/blk-throttle

[PATCH v2 6/8] blk-throttle: Move service tree validation out of the throtl_rb_first()

2020-10-07 Thread Baolin Wang
of the throtl_rb_first() to remove the redundant validation in the fast path. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index f1bcb5c..38aed8b 100644 --- a/block/blk-throttle.c +++ b

[PATCH v2 1/8] blk-throttle: Remove a meaningless parameter for throtl_downgrade_state()

2020-10-07 Thread Baolin Wang
The throtl_downgrade_state() is always used to change to LIMIT_LOW limitation, thus remove the latter meaningless parameter which indicates the limitation index. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block

[PATCH v2 5/8] blk-throttle: Move the list operation after list validation

2020-10-07 Thread Baolin Wang
We should move the list operation after validation. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 0649bce..f1bcb5c 100644 --- a/block/blk-throttle.c +++ b/block/blk

Re: [PATCH] block: Remove redundant 'return' statement

2020-10-07 Thread Baolin Wang
Hi, On Mon, Sep 28, 2020 at 08:42:26AM +0800, Baolin Wang wrote: > Remove redundant 'return' statement for 'void' functions. > > Signed-off-by: Baolin Wang Gentle ping? > --- > block/blk-iocost.c| 2 +- > block/blk-iolatency.c | 2 +- > 2 files changed, 2 inser

Re: [PATCH] arm64: PCI: Validate the node before setting node id for root bus

2020-10-03 Thread Baolin Wang
On Tue, Sep 29, 2020 at 11:41:29PM +0800, Baolin Wang wrote: Hi, 锟斤拷 2020/9/28 23:23, Lorenzo Pieralisi 写锟斤拷: On Mon, Sep 28, 2020 at 10:49:57PM +0800, Baolin Wang wrote: On Mon, Sep 28, 2020 at 03:00:55PM +0100, Will Deacon wrote: [+ Lorenzo] On Tue, Sep 22, 2020 at 06:33:24PM +0800

Re: [PATCH] arm64: PCI: Validate the node before setting node id for root bus

2020-09-29 Thread Baolin Wang
Hi, 在 2020/9/28 23:23, Lorenzo Pieralisi 写道: On Mon, Sep 28, 2020 at 10:49:57PM +0800, Baolin Wang wrote: On Mon, Sep 28, 2020 at 03:00:55PM +0100, Will Deacon wrote: [+ Lorenzo] On Tue, Sep 22, 2020 at 06:33:24PM +0800, Baolin Wang wrote: If the BIOS disabled the NUMA configuration

Re: [PATCH 0/4] Some improvements for blk throttle

2020-09-29 Thread Baolin Wang
Hi Jens, Hi, This patch set did some improvements for blk throttle, please help to review. Thanks. Do you have any comments for this patch set? Thanks. Baolin Wang (4): blk-throttle: Remove a meaningless parameter for throtl_downgrade_state() blk-throttle: Avoid getting

Re: [PATCH] arm64: PCI: Validate the node before setting node id for root bus

2020-09-28 Thread Baolin Wang
On Mon, Sep 28, 2020 at 03:00:55PM +0100, Will Deacon wrote: > [+ Lorenzo] > > On Tue, Sep 22, 2020 at 06:33:24PM +0800, Baolin Wang wrote: > > If the BIOS disabled the NUMA configuration, but did not change the > > proximity domain description in the SRAT table, so the PC

[PATCH] block: Remove redundant 'return' statement

2020-09-27 Thread Baolin Wang
Remove redundant 'return' statement for 'void' functions. Signed-off-by: Baolin Wang --- block/blk-iocost.c| 2 +- block/blk-iolatency.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index ef9476f..e38c406 100644 --- a/block

[PATCH] arm64: PCI: Validate the node before setting node id for root bus

2020-09-22 Thread Baolin Wang
pci_acpi_root_get_node() does for X86 architecture. Signed-off-by: Baolin Wang --- arch/arm64/kernel/pci.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 1006ed2..24fe2bd 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64

[PATCH 3/4] blk-throttle: Avoid tracking latency if low limit is invalid

2020-09-20 Thread Baolin Wang
The IO latency tracking is only for LOW limit, so we should add a validation to avoid redundant latency tracking if the LOW limit is not valid. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block

[PATCH 4/4] blk-throttle: Fix IO hang for a corner case

2020-09-20 Thread Baolin Wang
It can not scale up in throtl_adjusted_limit() if we set bps or iops is 1, which will cause IO hang when enable low limit. Thus we should treat 1 as a illegal value to avoid this issue. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 8 1 file changed, 4 insertions(+), 4

[PATCH 2/4] blk-throttle: Avoid getting the current time if tg->last_finish_time is 0

2020-09-20 Thread Baolin Wang
We only update the tg->last_finish_time when the low limitaion is enabled, so we can move the tg->last_finish_time validation a little forward to avoid getting the unnecessary current time stamp if the the low limitation is not enabled. Signed-off-by: Baolin Wang --- block/blk-throttle

[PATCH 0/4] Some improvements for blk throttle

2020-09-20 Thread Baolin Wang
Hi, This patch set did some improvements for blk throttle, please help to review. Thanks. Baolin Wang (4): blk-throttle: Remove a meaningless parameter for throtl_downgrade_state() blk-throttle: Avoid getting the current time if tg->last_finish_time is 0 blk-throttle: Av

[PATCH 1/4] blk-throttle: Remove a meaningless parameter for throtl_downgrade_state()

2020-09-20 Thread Baolin Wang
The throtl_downgrade_state() is always used to change to LIMIT_LOW limitation, thus remove the latter meaningless parameter which indicates the limitation index. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block

Re: [PATCH 0/5] Some improvements for blk-throttle

2020-09-15 Thread Baolin Wang
Hi Jens, On Mon, Sep 14, 2020 at 07:37:53PM -0600, Jens Axboe wrote: > On 9/7/20 2:10 AM, Baolin Wang wrote: > > Hi All, > > > > This patch set did some clean-ups, as well as removing some unnecessary > > bps/iops limitation calculation when checking if can dispatc

Re: [PATCH 0/5] Some improvements for blk-throttle

2020-09-13 Thread Baolin Wang
Hi Tejun and Jens, On Mon, Sep 07, 2020 at 04:10:12PM +0800, Baolin Wang wrote: > Hi All, > > This patch set did some clean-ups, as well as removing some unnecessary > bps/iops limitation calculation when checking if can dispatch a bio or > not for a tg. Please help to revie

[PATCH] block: Remove unused blk_mq_sched_free_hctx_data()

2020-09-07 Thread Baolin Wang
Now we usually free the hctx->sched_data by e->type->ops.exit_hctx(), and no users will use blk_mq_sched_free_hctx_data() function. Remove it. Signed-off-by: Baolin Wang --- block/blk-mq-sched.c | 15 --- block/blk-mq-sched.h | 3 --- 2 files changed, 18 deletions(-) d

[PATCH 4/5] blk-throttle: Avoid calculating bps/iops limitation repeatedly

2020-09-07 Thread Baolin Wang
in tg_may_dispatch(). So we can calculate the bps/iops limitation only once, and pass them to tg_with_in_bps_limit() and tg_with_in_iops_limit() to avoid calculating bps/iops limitation repeatedly. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 19 ++- 1 file changed, 10

[PATCH 5/5] blk-throttle: Avoid checking bps/iops limitation if bps or iops is unlimited

2020-09-07 Thread Baolin Wang
Do not need check the bps or iops limitation if bps or iops is unlimited. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 12 1 file changed, 12 insertions(+) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 8719e37..36ba61c 100644 --- a/block/blk-throttle.c

[PATCH 3/5] blk-throttle: Define readable macros instead of static variables

2020-09-07 Thread Baolin Wang
The 'throtl_grp_quantum' and 'throtl_quantum' are both read-only variables, thus better to use readable macros instead of static variables, which can also save some spaces for .bss area. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH 1/5] blk-throttle: Fix some comments' typos

2020-09-07 Thread Baolin Wang
Fix some comments' typos. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index fee3325..2fc6c3e 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c

[PATCH 2/5] blk-throttle: Use readable READ/WRITE macros

2020-09-07 Thread Baolin Wang
Use readable READ/WRITE macros instead of magic numbers. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 2fc6c3e..06e73ed 100644 --- a/block/blk-throttle.c +++ b/block

[PATCH 0/5] Some improvements for blk-throttle

2020-09-07 Thread Baolin Wang
Hi All, This patch set did some clean-ups, as well as removing some unnecessary bps/iops limitation calculation when checking if can dispatch a bio or not for a tg. Please help to review. Thanks. Baolin Wang (5): blk-throttle: Fix some comments' typos blk-throttle: Use readable READ/WRITE

[PATCH] block: Remove a duplicative condition

2020-09-01 Thread Baolin Wang
Remove a duplicative condition to remove below cppcheck warnings: "warning: Redundant condition: sched_allow_merge. '!A || (A && B)' is equivalent to '!A || B' [redundantCondition]" Reported-by: kernel test robot Signed-off-by: Baolin Wang --- block/blk-merge.c | 6 ++

[PATCH] block: Fix building error

2020-09-01 Thread Baolin Wang
The disk argument has been removed by commit 3b843c0bda28 ("block: remove the disk argument to delete_partition"), thus fix a building error caused by an incorrect argument. Fixes: 3b843c0bda28 ("block: remove the disk argument to delete_partition") Signed-off-by: Bao

[PATCH v3 1/4] block: Move bio merge related functions into blk-merge.c

2020-08-27 Thread Baolin Wang
It's better to move bio merge related functions into blk-merge.c, which contains all merge related functions. Signed-off-by: Baolin Wang Reviewed-by: Christoph Hellwig --- block/blk-core.c | 156 - block/blk-merge.c | 157

[PATCH v3 3/4] block: Add a new helper to attempt to merge a bio

2020-08-27 Thread Baolin Wang
There are lots of duplicated code when trying to merge a bio from plug list and sw queue, we can introduce a new helper to attempt to merge a bio, which can simplify the blk_bio_list_merge() and blk_attempt_plug_merge(). Signed-off-by: Baolin Wang --- block/blk-merge.c| 104

[PATCH v3 4/4] block: Remove blk_mq_attempt_merge() function

2020-08-27 Thread Baolin Wang
The small blk_mq_attempt_merge() function is only called by __blk_mq_sched_bio_merge(), just open code it. Signed-off-by: Baolin Wang Reviewed-by: Christoph Hellwig --- block/blk-mq-sched.c | 44 1 file changed, 16 insertions(+), 28 deletions

[PATCH v3 2/4] block: Move blk_mq_bio_list_merge() into blk-merge.c

2020-08-27 Thread Baolin Wang
Move the blk_mq_bio_list_merge() into blk-merge.c and rename it as a generic name. Signed-off-by: Baolin Wang --- block/blk-merge.c | 44 block/blk-mq-sched.c | 46 +- block/blk.h| 2

[PATCH v3 0/4] Some clean-ups for bio merge

2020-08-27 Thread Baolin Wang
from Christoph. - Coding style improvement. Changes from v1: - Drop patch 2 and patch 5 in v1 patch set. - Add reviewed-by tag from Christoph. - Move blk_mq_bio_list_merge() into blk-merge.c and rename it. - Some coding style improvements. Baolin Wang (4): block: Move bio merge related

Re: [PATCH v2 2/3] block: Add a new helper to attempt to merge a bio

2020-08-27 Thread Baolin Wang
On Thu, Aug 27, 2020 at 11:44:15AM +0200, Christoph Hellwig wrote: > On Tue, Aug 18, 2020 at 01:45:29PM +0800, Baolin Wang wrote: > > Meanwhile move the blk_mq_bio_list_merge() into blk-merge.c and > > rename it as a generic name. > > That should probably a

Re: [PATCH v2 0/3] Some clean-ups for bio merge

2020-08-25 Thread Baolin Wang
Hi, On Tue, Aug 18, 2020 at 01:45:27PM +0800, Baolin Wang wrote: > Hi, > > There are some duplicated code when trying to merge bio from pluged list > and software queue, thus this patch set did some clean-ups when merging > a bio. Any comments are welcome. Thanks. > > Chang

  1   2   3   4   5   6   7   8   9   10   >