* [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32
@ 2019-09-04 6:00 shuang.qiu
2019-09-04 14:32 ` Thadeu Lima de Souza Cascardo
2019-09-05 8:29 ` Li Wang
0 siblings, 2 replies; 8+ messages in thread
From: shuang.qiu @ 2019-09-04 6:00 UTC (permalink / raw)
To: ltp
From: Shuang Qiu <shuang.qiu@oracle.com>
In upstream patch 1a61ab (mm: memcontrol: replace zone summing with lruvec_page_state()),
it modify the lruvec state in batch,equal and less than 32 MADV_FREE pages will not trigger
the account of lruvec_stat,and will not be free in memory pressure either.
So the testcase may fail with:
...
madvise09.c:219: INFO: Memory hungry child 6178 started, try 10
madvise09.c:254: INFO: Memory map: pppppppppppppppppppppppppppppppp
madvise09.c:259: FAIL: No MADV_FREE page was freed on low memory
...
Change the PAGES to the value more than 32 can fix such issue.
Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
---
testcases/kernel/syscalls/madvise/madvise09.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/madvise/madvise09.c b/testcases/kernel/syscalls/madvise/madvise09.c
index 01075f6..3759053 100644
--- a/testcases/kernel/syscalls/madvise/madvise09.c
+++ b/testcases/kernel/syscalls/madvise/madvise09.c
@@ -57,7 +57,7 @@ static int sleep_between_faults;
static int swap_accounting_enabled;
-#define PAGES 32
+#define PAGES 64
#define TOUCHED_PAGE1 0
#define TOUCHED_PAGE2 10
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32
2019-09-04 6:00 [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32 shuang.qiu
@ 2019-09-04 14:32 ` Thadeu Lima de Souza Cascardo
2019-09-05 8:29 ` Li Wang
1 sibling, 0 replies; 8+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2019-09-04 14:32 UTC (permalink / raw)
To: ltp
On Wed, Sep 04, 2019 at 02:00:23PM +0800, shuang.qiu@oracle.com wrote:
> From: Shuang Qiu <shuang.qiu@oracle.com>
>
> In upstream patch 1a61ab (mm: memcontrol: replace zone summing with lruvec_page_state()),
> it modify the lruvec state in batch,equal and less than 32 MADV_FREE pages will not trigger
> the account of lruvec_stat,and will not be free in memory pressure either.
> So the testcase may fail with:
> ...
> madvise09.c:219: INFO: Memory hungry child 6178 started, try 10
> madvise09.c:254: INFO: Memory map: pppppppppppppppppppppppppppppppp
> madvise09.c:259: FAIL: No MADV_FREE page was freed on low memory
> ...
> Change the PAGES to the value more than 32 can fix such issue.
>
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
On ppc64le, I was getting retries, as OOM was getting hit. The test would
ultimately time out. This fixes it for me.
Thanks.
Cascardo.
Tested-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
> testcases/kernel/syscalls/madvise/madvise09.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/madvise/madvise09.c b/testcases/kernel/syscalls/madvise/madvise09.c
> index 01075f6..3759053 100644
> --- a/testcases/kernel/syscalls/madvise/madvise09.c
> +++ b/testcases/kernel/syscalls/madvise/madvise09.c
> @@ -57,7 +57,7 @@ static int sleep_between_faults;
>
> static int swap_accounting_enabled;
>
> -#define PAGES 32
> +#define PAGES 64
> #define TOUCHED_PAGE1 0
> #define TOUCHED_PAGE2 10
>
> --
> 1.9.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32
2019-09-04 6:00 [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32 shuang.qiu
2019-09-04 14:32 ` Thadeu Lima de Souza Cascardo
@ 2019-09-05 8:29 ` Li Wang
2019-09-05 10:01 ` Shuang Qiu
2019-09-11 11:19 ` Cyril Hrubis
1 sibling, 2 replies; 8+ messages in thread
From: Li Wang @ 2019-09-05 8:29 UTC (permalink / raw)
To: ltp
On Wed, Sep 4, 2019 at 2:01 PM <shuang.qiu@oracle.com> wrote:
>
> From: Shuang Qiu <shuang.qiu@oracle.com>
>
> In upstream patch 1a61ab (mm: memcontrol: replace zone summing with lruvec_page_state()),
> it modify the lruvec state in batch,equal and less than 32 MADV_FREE pages will not trigger
> the account of lruvec_stat,and will not be free in memory pressure either.
> So the testcase may fail with:
> ...
> madvise09.c:219: INFO: Memory hungry child 6178 started, try 10
> madvise09.c:254: INFO: Memory map: pppppppppppppppppppppppppppppppp
> madvise09.c:259: FAIL: No MADV_FREE page was freed on low memory
> ...
> Change the PAGES to the value more than 32 can fix such issue.
>
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
> ---
> testcases/kernel/syscalls/madvise/madvise09.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/madvise/madvise09.c b/testcases/kernel/syscalls/madvise/madvise09.c
> index 01075f6..3759053 100644
> --- a/testcases/kernel/syscalls/madvise/madvise09.c
> +++ b/testcases/kernel/syscalls/madvise/madvise09.c
> @@ -57,7 +57,7 @@ static int sleep_between_faults;
>
> static int swap_accounting_enabled;
>
> -#define PAGES 32
> +#define PAGES 64
I'm not sure why 64 pages is a proper value? Can you explain more?
--
Regards,
Li Wang
^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32
2019-09-05 8:29 ` Li Wang
@ 2019-09-05 10:01 ` Shuang Qiu
2019-09-05 10:29 ` Li Wang
2019-09-11 11:19 ` Cyril Hrubis
1 sibling, 1 reply; 8+ messages in thread
From: Shuang Qiu @ 2019-09-05 10:01 UTC (permalink / raw)
To: ltp
On 09/05/2019 04:29 PM, Li Wang wrote:
> On Wed, Sep 4, 2019 at 2:01 PM <shuang.qiu@oracle.com> wrote:
>> From: Shuang Qiu <shuang.qiu@oracle.com>
>>
>> In upstream patch 1a61ab (mm: memcontrol: replace zone summing with lruvec_page_state()),
>> it modify the lruvec state in batch,equal and less than 32 MADV_FREE pages will not trigger
>> the account of lruvec_stat,and will not be free in memory pressure either.
>> So the testcase may fail with:
>> ...
>> madvise09.c:219: INFO: Memory hungry child 6178 started, try 10
>> madvise09.c:254: INFO: Memory map: pppppppppppppppppppppppppppppppp
>> madvise09.c:259: FAIL: No MADV_FREE page was freed on low memory
>> ...
>> Change the PAGES to the value more than 32 can fix such issue.
>>
>> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
>> ---
>> testcases/kernel/syscalls/madvise/madvise09.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/testcases/kernel/syscalls/madvise/madvise09.c b/testcases/kernel/syscalls/madvise/madvise09.c
>> index 01075f6..3759053 100644
>> --- a/testcases/kernel/syscalls/madvise/madvise09.c
>> +++ b/testcases/kernel/syscalls/madvise/madvise09.c
>> @@ -57,7 +57,7 @@ static int sleep_between_faults;
>>
>> static int swap_accounting_enabled;
>>
>> -#define PAGES 32
>> +#define PAGES 64
> I'm not sure why 64 pages is a proper value? Can you explain more?
I think any value which larger than 32 is ok.
So I tested 64 and works fine.
Thanks
Shuang
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32
2019-09-05 10:01 ` Shuang Qiu
@ 2019-09-05 10:29 ` Li Wang
0 siblings, 0 replies; 8+ messages in thread
From: Li Wang @ 2019-09-05 10:29 UTC (permalink / raw)
To: ltp
On Thu, Sep 5, 2019 at 6:02 PM Shuang Qiu <shuang.qiu@oracle.com> wrote:
>
> On 09/05/2019 04:29 PM, Li Wang wrote:
> > On Wed, Sep 4, 2019 at 2:01 PM <shuang.qiu@oracle.com> wrote:
> >> From: Shuang Qiu <shuang.qiu@oracle.com>
> >>
> >> In upstream patch 1a61ab (mm: memcontrol: replace zone summing with lruvec_page_state()),
> >> it modify the lruvec state in batch,equal and less than 32 MADV_FREE pages will not trigger
> >> the account of lruvec_stat,and will not be free in memory pressure either.
> >> So the testcase may fail with:
> >> ...
> >> madvise09.c:219: INFO: Memory hungry child 6178 started, try 10
> >> madvise09.c:254: INFO: Memory map: pppppppppppppppppppppppppppppppp
> >> madvise09.c:259: FAIL: No MADV_FREE page was freed on low memory
> >> ...
> >> Change the PAGES to the value more than 32 can fix such issue.
> >>
> >> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
> >> ---
> >> testcases/kernel/syscalls/madvise/madvise09.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/testcases/kernel/syscalls/madvise/madvise09.c b/testcases/kernel/syscalls/madvise/madvise09.c
> >> index 01075f6..3759053 100644
> >> --- a/testcases/kernel/syscalls/madvise/madvise09.c
> >> +++ b/testcases/kernel/syscalls/madvise/madvise09.c
> >> @@ -57,7 +57,7 @@ static int sleep_between_faults;
> >>
> >> static int swap_accounting_enabled;
> >>
> >> -#define PAGES 32
> >> +#define PAGES 64
> > I'm not sure why 64 pages is a proper value? Can you explain more?
> I think any value which larger than 32 is ok.
> So I tested 64 and works fine.
I just tried with '42' randomly, but it doesn't work. I guess that
might have a waterline to trigger this memory page reclaiming.
I looked at the code calling path, it seems the 'sc->nr_reclaimed' is
the key value to control that, but still not 100% sure, I will keep
debugging it for a while.
try_to_free_mem_cgroup_pages
do_try_to_free_pages
shrink_zone
shrink_node
shrink_node_memcg
get_scan_count
lruvec_lru_size
lruvec_page_state
--
Regards,
Li Wang
^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32
2019-09-05 8:29 ` Li Wang
2019-09-05 10:01 ` Shuang Qiu
@ 2019-09-11 11:19 ` Cyril Hrubis
2019-09-12 2:51 ` Li Wang
1 sibling, 1 reply; 8+ messages in thread
From: Cyril Hrubis @ 2019-09-11 11:19 UTC (permalink / raw)
To: ltp
Hi!
> I'm not sure why 64 pages is a proper value? Can you explain more?
I've just talked to Michal Hocko and the conclusion is that we should
allocate several megabytes to avoid depending kernel implementation
details, which would mean allocating thousands of pages.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32
2019-09-11 11:19 ` Cyril Hrubis
@ 2019-09-12 2:51 ` Li Wang
2019-09-12 3:35 ` Shuang Qiu
0 siblings, 1 reply; 8+ messages in thread
From: Li Wang @ 2019-09-12 2:51 UTC (permalink / raw)
To: ltp
On Wed, Sep 11, 2019 at 7:19 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
> > I'm not sure why 64 pages is a proper value? Can you explain more?
>
> I've just talked to Michal Hocko and the conclusion is that we should
> allocate several megabytes to avoid depending kernel implementation
> details, which would mean allocating thousands of pages.
>
Sounds reasonable. Allocating thousands of pages must trigger the MADV_FREE
page reclaiming.
@shuang.qiu, Hi Shuang, would you mind to rewrite the patch, or should I do
that?
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190912/2100c785/attachment.htm>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32
2019-09-12 2:51 ` Li Wang
@ 2019-09-12 3:35 ` Shuang Qiu
0 siblings, 0 replies; 8+ messages in thread
From: Shuang Qiu @ 2019-09-12 3:35 UTC (permalink / raw)
To: ltp
On 09/12/2019 10:51 AM, Li Wang wrote:
>
>
> On Wed, Sep 11, 2019 at 7:19 PM Cyril Hrubis <chrubis@suse.cz
> <mailto:chrubis@suse.cz>> wrote:
>
> Hi!
> > I'm not sure why 64 pages is a proper value? Can you explain more?
>
> I've just talked to Michal Hocko and the conclusion is that we should
> allocate several megabytes to avoid depending kernel implementation
> details, which would mean allocating thousands of pages.
>
>
> Sounds reasonable. Allocating thousands of pages must trigger
> the?MADV_FREE page reclaiming.
>
> @shuang.qiu, Hi Shuang, would you mind to rewrite the patch, or should
> I do that?
Thanks for helping to investigate this issue.
I will update the patch.
32 pages is really small in current system which may be held on
reclaiming small piece of memory,thousands of pages is reasonable.
Thanks
Shuang
>
> --
> Regards,
> Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190912/4465138e/attachment.htm>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-09-12 3:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-04 6:00 [LTP] [PATCH] madvise09:Change PAGES size to the value more than 32 shuang.qiu
2019-09-04 14:32 ` Thadeu Lima de Souza Cascardo
2019-09-05 8:29 ` Li Wang
2019-09-05 10:01 ` Shuang Qiu
2019-09-05 10:29 ` Li Wang
2019-09-11 11:19 ` Cyril Hrubis
2019-09-12 2:51 ` Li Wang
2019-09-12 3:35 ` Shuang Qiu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox