On Thu, 18 Nov 2021 13:34:54 -0800 akpm@xxxxxxxxxxxxxxxxxxxx wrote: > > The patch titled > Subject: mm/damon/schemes: add the validity judgment of thresholds > has been added to the -mm tree. Its filename is > mm-damon-schemes-add-the-validity-judgment-of-thresholds.patch > > This patch should soon appear at > https://ozlabs.org/~akpm/mmots/broken-out/mm-damon-schemes-add-the-validity-judgment-of-thresholds.patch > and later at > https://ozlabs.org/~akpm/mmotm/broken-out/mm-damon-schemes-add-the-validity-judgment-of-thresholds.patch > > Before you just go and hit "reply", please: > a) Consider who else should be cc'ed > b) Prefer to cc a suitable mailing list as well > c) Ideally: find the original patch on the mailing list and do a > reply-to-all to that, adding suitable additional cc's > > *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** > > The -mm tree is included into linux-next and is updated > there every 3-4 working days > > ------------------------------------------------------ > From: Xin Hao <xhao@xxxxxxxxxxxxxxxxx> > Subject: mm/damon/schemes: add the validity judgment of thresholds > > In dbgfs "schemes" interface, i do some test like this: > # cd /sys/kernel/debug/damon > # echo "2 1 2 1 10 1 3 10 1 1 1 1 1 1 1 1 2 3" > schemes > # cat schemes > # 2 1 2 1 10 1 3 10 1 1 1 1 1 1 1 1 2 3 0 0 > > There have some unreasonable places, i set the valules of these variables > "<min_sz, max_sz> <min_nr_a, max_nr_a>, <min_age, max_age>, <wmarks.high, > wmarks.mid, wmarks.low>" as "<2, 1>, <2, 1>, <10, 1>, <1, 2, 3>. > > So there add a validity judgment for these thresholds value. > > Link: https://lkml.kernel.org/r/d78360e52158d786fcbf20bc62c96785742e76d3.1637239568.git.xhao@xxxxxxxxxxxxxxxxx > Signed-off-by: Xin Hao <xhao@xxxxxxxxxxxxxxxxx> > Cc: SeongJae Park <sj@xxxxxxxxxx> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Reviewed-by: SeongJae Park <sj@xxxxxxxxxx> Thanks, SJ > --- > > mm/damon/dbgfs.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > --- a/mm/damon/dbgfs.c~mm-damon-schemes-add-the-validity-judgment-of-thresholds > +++ a/mm/damon/dbgfs.c > @@ -215,6 +215,13 @@ static struct damos **str_to_schemes(con > goto fail; > } > > + if (min_sz > max_sz || min_nr_a > max_nr_a || min_age > max_age) > + goto fail; > + > + if (wmarks.high < wmarks.mid || wmarks.high < wmarks.low || > + wmarks.mid < wmarks.low) > + goto fail; > + > pos += parsed; > scheme = damon_new_scheme(min_sz, max_sz, min_nr_a, max_nr_a, > min_age, max_age, action, "a, &wmarks); > _ > > Patches currently in -mm which might be from xhao@xxxxxxxxxxxxxxxxx are > > mm-damon-unified-access_check-function-naming-rules.patch > mm-damon-add-age-of-region-tracepoint-support.patch > mm-damon-core-using-function-abs-instead-of-diff_of.patch > mm-damon-remove-some-no-need-func-definitions-in-damonh-file.patch > mm-damon-schemes-add-the-validity-judgment-of-thresholds.patch