Linux Test Project
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: Hongchen Zhang <zhanghongchen@loongson.cn>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] cpuset_memory_spread: change lowerlimit to 5000kb
Date: Tue, 29 Aug 2023 10:25:57 +0100	[thread overview]
Message-ID: <87zg2ai2is.fsf@suse.de> (raw)
In-Reply-To: <14c9865f-9300-b1af-1594-a95a98cd85ba@loongson.cn>

Hello,

Hongchen Zhang <zhanghongchen@loongson.cn> writes:

> Hi Chril,
> Any suggestion about this patch?
>
> On 2023/6/16 pm 6:13, Hongchen Zhang wrote:
>> Hi Martin,
>> On 2023/6/16 pm 5:31, Martin Doucha wrote:
>>> On 16. 06. 23 4:10, Hongchen Zhang wrote:
>>>> Hi Martin,
>>>>
>>>> On 2023/6/15 pm 10:27, Martin Doucha wrote:
>>>>> Hi,
>>>>>
>>>>> On 09. 06. 23 3:27, Hongchen Zhang wrote:
>>>>>> When I test the cpuset_memory_spread case,this case FAIL too often.
>>>>>> After dig into the code, I find out that the fowlloing things trigger
>>>>>> the FAIL:
>>>>>> 1) random events,the probability is very small and can be ignored
>>>>>> 2) get_meminfo which before send signal to test_pid
>>>>>> 3) account_memsinfo before result_check
>>>>>>
>>>>>> About 2) and 3), we can increase the value of lowerlimit to keep
>>>>>> the result as SUCCESS.After my testing, 5000kb is a reasonable value.
>>>>>
>>>>> we're also seeing these failures but only on architectures like
>>>>> PowerPC with pagesize higher than the usual 4KB. On which
>>>>> architectures do you see failures and what's the pagesize there?
>>>> I test on 3C5000+7A2000 machine, the architecture is LoongArch.The
>>>> pagesize we used is 16KB.
>>>
>>> So the underlying cause is the same - higher pagesize. That means
>>> the upperlimit, lowerlimit and DATAFILE size should be calculated
>>> from pagesize instead.IMO,upperlimit and DATAFILE size will not
>>> affect the result.
>> Change the lowerlimit like following?
>> lowerlimit = 2000kb*get_pagesize()/SIZE_4K;

This formula looks ok, but you need to scale the other values by the
page size as well.

Also I would recommend ensuring all values are multiples of the page
size because the kernel will round up to the nearest page
size.

So lowerlimit = 4096 * 5 = 2048Kb
or lowerlimit = 16384 * 5 = 8192Kb

Maybe the upperlimit should be 5 * lowerlimit? Because we want the
gap/spread to get bigger too. I don't know if the DATAFILE needs to
change in size it is already 500MB.

Alternatively you could just create a lookup table with values for each
page size we have tested. e.g.

switch (get_pagesize()) {
       case 4096: 2048Kb
       case 16384: 8192Kb
       default: ...
}

This may be better if the values to do not scale linearly. Which is
totally possible because the page size effects most things and there
could be feedback loops.

Please submit another patch if you are still interested.

-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-08-29 10:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09  1:27 [LTP] [PATCH] cpuset_memory_spread: change lowerlimit to 5000kb Hongchen Zhang
2023-06-15 14:27 ` Martin Doucha
2023-06-16  2:10   ` Hongchen Zhang
2023-06-16  9:31     ` Martin Doucha
2023-06-16 10:13       ` Hongchen Zhang
2023-06-27 11:39         ` Hongchen Zhang
2023-08-29  9:25           ` Richard Palethorpe [this message]
2023-08-30  3:28             ` Hongchen Zhang

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=87zg2ai2is.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=zhanghongchen@loongson.cn \
    /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