linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: haoxin <xhao@linux.alibaba.com>
To: sj@kernel.org
Cc: akpm@linux-foundation.org, damon@lists.linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/damon/lru_sort: Move target memory region check to head of func
Date: Thu, 18 Aug 2022 19:06:11 +0800	[thread overview]
Message-ID: <667ced2a-2724-265e-2019-cf97fa661b6a@linux.alibaba.com> (raw)
In-Reply-To: <20220818082538.67825-1-xhao@linux.alibaba.com>

Hi all,

Please ignore this patch, i have send a  patch v2 in there:

https://lore.kernel.org/damon/20220818105732.34492-1-xhao@linux.alibaba.com/

在 2022/8/18 下午4:25, Xin Hao 写道:
> In damon_lru_sort_apply_parameters(), if "monitor_region_start"
> and "monitor_region_end" is not a valid physical address range,
> There no need to run the remainder codes in it.
>
> Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
> ---
>   mm/damon/lru_sort.c | 13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c
> index 9de6f00a71c5..ac50dca026f9 100644
> --- a/mm/damon/lru_sort.c
> +++ b/mm/damon/lru_sort.c
> @@ -378,6 +378,13 @@ static int damon_lru_sort_apply_parameters(void)
>   	unsigned int hot_thres, cold_thres;
>   	int err = 0;
>
> +	if (monitor_region_start > monitor_region_end)
> +		return -EINVAL;
> +	if (!monitor_region_start && !monitor_region_end &&
> +			!get_monitoring_region(&monitor_region_start,
> +				&monitor_region_end))
> +		return -EINVAL;
> +
>   	err = damon_set_attrs(ctx, sample_interval, aggr_interval, 0,
>   			min_nr_regions, max_nr_regions);
>   	if (err)
> @@ -401,12 +408,6 @@ static int damon_lru_sort_apply_parameters(void)
>   		return -ENOMEM;
>   	damon_add_scheme(ctx, scheme);
>
> -	if (monitor_region_start > monitor_region_end)
> -		return -EINVAL;
> -	if (!monitor_region_start && !monitor_region_end &&
> -			!get_monitoring_region(&monitor_region_start,
> -				&monitor_region_end))
> -		return -EINVAL;
>   	addr_range.start = monitor_region_start;
>   	addr_range.end = monitor_region_end;
>   	return damon_set_regions(target, &addr_range, 1);
> --
> 2.31.0


      reply	other threads:[~2022-08-18 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18  8:25 Xin Hao
2022-08-18 11:06 ` haoxin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=667ced2a-2724-265e-2019-cf97fa661b6a@linux.alibaba.com \
    --to=xhao@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox