Skip to contentSkip to conversation

mm/page-writeback: Update the comment of Dirty position control

PATCH Superseded Chi Wu 2 participants 5 messages May 11, 2021

Subsystems (2)
lore
Share & tools
lore

Chi Wu

author
#0 lore raw

PATCH 1/1 mm/page-writeback: Update the comment of Dirty position control

As the value of pos_ratio_polynom() clamp between 0 and 2LL << RATELIMIT_CALC_SHIFT, the global control line should be consistent with it.

---
 mm/page-writeback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page-writeback.c +1 -1
index 0062d5c57d41..e9a4f6cf12bb 100644
@@ -845,7 +845,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
  *     ^ pos_ratio
  *     |
  *     |            |<===== global dirty control scope ======>|
- * 2.0 .............*
+ * 2.0 * * * * * * *
  *     |            .*
  *     |            . *
  *     |            .   *
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 14 lines · Chi Wu

As the value of pos_ratio_polynom() clamp between 0 and 2LL << RATELIMIT_CALC_SHIFT, the global control line should be consistent with it.

---
 mm/page-writeback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page-writeback.c +0 -0
index 0062d5c57d41..e9a4f6cf12bb 100644

mm/page-writeback.c static long long pos_ratio_polynom(unsigned long setpoint, · line 851

Quoted 8 lines
mm/page-writeback.c +1 -1
@@ -845,7 +845,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
  *     ^ pos_ratio
  *     |
  *     |            |<===== global dirty control scope ======>|
- * 2.0 .............*
+ * 2.0 * * * * * * *
  *     |            .*
  *     |            . *
  *     |            .   *

Generally, pos_ratio is used only within [freerun, limit] range so its values outside of that range don't matter much. But you're right that pos_ratio_polynom() clamps the computed value as you describe and we can visualize that in the graph as well. Just please move the '*' line you add by one space to the right so that the curve really follows the cubic curve upto 'freerun' mark (the vertical '.' line).

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author
#2 lore raw
Quoted 11 lines · Jan Kara <[email protected]> 于2021年5月11日周二 下午5:06写道:
Quoted 9 lines · Chi Wu

As the value of pos_ratio_polynom() clamp between 0 and 2LL << RATELIMIT_CALC_SHIFT, the global control line should be consistent with it.

---
 mm/page-writeback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

mm/page-writeback.c static long long pos_ratio_polynom(unsigned long setpoint, · line 851

Quoted 13 lines
mm/page-writeback.c +1 -1
index 0062d5c57d41..e9a4f6cf12bb 100644
@@ -845,7 +845,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
  *     ^ pos_ratio
  *     |
  *     |            |<===== global dirty control scope ======>|
- * 2.0 .............*
+ * 2.0 * * * * * * *
  *     |            .*
  *     |            . *
  *     |            .   *

Generally, pos_ratio is used only within [freerun, limit] range so its values outside of that range don't matter much. But you're right that

Thanks.
Yes, most time it is. As the follow code and in the "dtc->wb_dirty < 8" rampup case, dirty pages may break the rules.

. . . .

    if (unlikely(wb->bdi->capabilities & BDI_CAP_STRICTLIMIT)) {
            long long wb_pos_ratio;

            if (dtc->wb_dirty < 8) {
                   dtc->pos_ratio = min_t(long long, pos_ratio * 2,
                                      2 << RATELIMIT_CALC_SHIFT);
                    return;
            }

            if (dtc->wb_dirty >= wb_thresh)
                    return;

. . .

Quoted 4 lines

pos_ratio_polynom() clamps the computed value as you describe and we can visualize that in the graph as well. Just please move the '*' line you add by one space to the right so that the curve really follows the cubic curve upto 'freerun' mark (the vertical '.' line).

Thanks.I'll correct it later.

Quoted 5 lines

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR

author
#3 lore raw

PATCH v2 1/1 mm/page-writeback: Update the comment of Dirty position control

In reply to Jan Kara

As the value of pos_ratio_polynom() clamp between 0 and 2LL << RATELIMIT_CALC_SHIFT, the global control line should be consistent with it.

---
 mm/page-writeback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page-writeback.c +1 -1
index 0062d5c57d41..3882405dc051 100644
@@ -845,7 +845,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
  *     ^ pos_ratio
  *     |
  *     |            |<===== global dirty control scope ======>|
- * 2.0 .............*
+ * 2.0  * * * * * * *
  *     |            .*
  *     |            . *
  *     |            .   *
Signature · 1 line
2.17.1
maintainer Reviewed-by on v2 1/1
#4 lore raw
Quoted 5 lines · Chi Wu

As the value of pos_ratio_polynom() clamp between 0 and 2LL << RATELIMIT_CALC_SHIFT, the global control line should be consistent with it.

Thanks! Feel free to add:

Honza

Quoted 20 lines
---
 mm/page-writeback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page-writeback.c +1 -1
index 0062d5c57d41..3882405dc051 100644
@@ -845,7 +845,7 @@ static long long pos_ratio_polynom(unsigned long setpoint,
  *     ^ pos_ratio
  *     |
  *     |            |<===== global dirty control scope ======>|
- * 2.0 .............*
+ * 2.0  * * * * * * *
  *     |            .*
  *     |            . *
  *     |            .   *
Signature · 1 line
2.17.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR