Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v18]

2022-05-16 Thread xpbob
On Thu, 12 May 2022 15:56:51 GMT, Severin Gehwolf  wrote:

>> xpbob has updated the pull request incrementally with one additional commit 
>> since the last revision:
>> 
>>   rename method
>
> LGTM.

Thanks @jerboaa  and @iklam . :)

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v18]

2022-05-15 Thread Ioi Lam
On Thu, 12 May 2022 13:46:11 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   rename method

LGTM

-

Marked as reviewed by iklam (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness

2022-05-15 Thread xpbob
On Wed, 20 Apr 2022 06:53:39 GMT, Ioi Lam  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> I changed the [JBS issue](https://bugs.openjdk.java.net/browse/JDK-8284900) 
> summary to "CgroupV1 detection code should consider memory.swappiness"

@iklam , are you also fine with the latest change? Thanks.

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v18]

2022-05-12 Thread Severin Gehwolf
On Thu, 12 May 2022 13:46:11 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   rename method

LGTM.

-

Marked as reviewed by sgehwolf (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v17]

2022-05-12 Thread xpbob
On Thu, 12 May 2022 13:32:03 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   add test

Thanks for review.
@jerboaa
The expression is clearer after the change

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v18]

2022-05-12 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  rename method

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/93bc46a6..584488f9

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=17
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=16-17

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v17]

2022-05-12 Thread xpbob
On Thu, 12 May 2022 13:32:03 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   add test

Thanks for review.
@jerboaa
Added test in TestMemoryWithCgroupV1

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v17]

2022-05-12 Thread Severin Gehwolf
On Thu, 12 May 2022 13:32:03 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   add test

LGTM. Consider a better name for the test :)

test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java line 90:

> 88: }
> 89: 
> 90: private static void testOperatingSystemMXBeanAwareness(String 
> memoryAllocation, String swapAllocation,

Please use a more telling name for this. Perhaps this? 
`testOSBeanSwappinessMemory`.

-

Marked as reviewed by sgehwolf (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v17]

2022-05-12 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  add test

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/296a409e..93bc46a6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=16
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=15-16

  Stats: 36 lines in 1 file changed: 29 ins; 0 del; 7 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v16]

2022-05-12 Thread Severin Gehwolf
On Thu, 12 May 2022 09:50:39 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   add swap method

This looks good. I think the only thing missing is a test for the JDK side. 
Perhaps write one using the `OperatingSystemMXBean`'s `getTotalSwapSpaceSize()` 
method within a container with `--memory=200m --memory-swap=250m` and using 
`--memory-swappiness=0`. You could use 
`test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java` and 
`CheckOperatingSystemMXBean.java` as a model. Again a cgroupsv1 specific test.

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v16]

2022-05-12 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  add swap method

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/abd5a2b4..296a409e

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=15
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=14-15

  Stats: 21 lines in 2 files changed: 16 ins; 1 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v16]

2022-05-12 Thread xpbob
On Thu, 12 May 2022 09:50:39 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   add swap method

Thanks for review.
@jerboaa 
I recently had a minor operation, so I couldn't get back on time.
Read values in different places, I added a method read_mem_swappiness
Is that possible?

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v15]

2022-05-04 Thread Severin Gehwolf
On Wed, 4 May 2022 01:37:27 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   update code

src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 154:

> 152:   log_trace(os, container)("Memory and Swap Limit has been reset to 
> " JULONG_FORMAT " because swappiness is 0", memlimit);
> 153:   return memlimit;
> 154: }

It now occurs to me that we'd need the same treatment of this on line `143`. 
Perhaps extract a function and call it in both places?

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v14]

2022-05-03 Thread xpbob
On Tue, 3 May 2022 13:38:07 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   revert file

Thanks for review.
@jerboaa 
The code has been updated

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v15]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  update code

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/cd9c195d..abd5a2b4

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=14
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=13-14

  Stats: 3 lines in 1 file changed: 2 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v14]

2022-05-03 Thread Severin Gehwolf
On Tue, 3 May 2022 13:38:07 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   revert file

This looks much better. Thanks!

test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java line 52:

> 50: return;
> 51: }
> 52: if ("cgroupv1".equals(metrics.getProvider())) {

Consider adding a an `else` clause with something like:
`System.out.println("Memory swappiness not supported with cgroups v2. Test 
skipped.");`

test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java line 78:

> 76: 
> 77: OutputAnalyzer out = Common.run(opts);
> 78: System.out.println(out.getOutput());

This looks like debug output?

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v14]

2022-05-03 Thread xpbob
On Tue, 3 May 2022 13:38:07 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   revert file

Thanks for review.
@jerboaa
The code has been updated

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v14]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  revert file

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/1be10b57..cd9c195d

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=13
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=12-13

  Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v13]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  update code

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/ed2f2855..1be10b57

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=12
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=11-12

  Stats: 386 lines in 6 files changed: 118 ins; 265 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v12]

2022-05-03 Thread Severin Gehwolf
On Tue, 3 May 2022 09:21:11 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   remove no use copy

To be honest, the original test change was closer to what I was expecting to 
see. Could you clarify why we'd need to use `cgcreate` et.al. for this test? As 
far as I'm aware `--memory-swappiness` should work just as well.

src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 150:

> 148: GET_CONTAINER_INFO(julong, _memory->controller(), 
> "/memory.swappiness",
> 149:"Swappiness is: " JULONG_FORMAT, JULONG_FORMAT, 
> swappiness);
> 150: if(swappiness == 0) {

Style: Space before `(`

src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp line 152:

> 150: if(swappiness == 0) {
> 151:   jlong memlimit = read_memory_limit_in_bytes();
> 152:   log_trace(os, container)("Memory and Swap Limit has been reset to 
> " JULONG_FORMAT " because of Swappiness is 0", memlimit);

`s/because of Swappiness is 0/because swappiness is 0/g`

test/hotspot/jtreg/containers/docker/TestCgroupV1Memory.java line 58:

> 56: try {
> 57: testMemoryLimit();
> 58: testMemoryLimitWithSwappiness();

Only `testMemoryLimitWithSwappiness()` should be `cgroupv1` conditional.

test/lib/jdk/test/lib/containers/cgroup/CgroupV1TestUtils.java line 34:

> 32: 
> 33: 
> 34: public class CgroupV1TestUtils {

I'm not sure what the point of this class is. Wouldn't we be able to test the 
same thing with the existing docker infrastructure using 
`--memory-swappiness=0` as docker option? As far as I can see this utility adds 
a dependency in `libcgroup` and related tools, which isn't necessarily 
installed on test systems. Docker dep, on the other hand, is enforced via 
`@require` tag.

-

Changes requested by sgehwolf (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v12]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  remove no use copy

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/97a547f4..ed2f2855

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=11
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=10-11

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v11]

2022-05-03 Thread xpbob
On Tue, 3 May 2022 08:34:50 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   format code

Thanks for review.
@jerboaa 
I added new test cases to run only in cgroupv1 environment

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v11]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  format code

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/77676edf..97a547f4

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=10
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=09-10

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v10]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  remove debug info

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/f7998d79..77676edf

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=09
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=08-09

  Stats: 4 lines in 1 file changed: 0 ins; 1 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v9]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  remove whitespace

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/13688f1c..f7998d79

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=08
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=07-08

  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v8]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  revert TestMisc

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/8c46be1c..13688f1c

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=07
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=06-07

  Stats: 16 lines in 1 file changed: 0 ins; 16 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v7]

2022-05-03 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with three additional commits 
since the last revision:

 - add test
 - add test
 - add cgroup v1 test

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/9dd1bbf3..8c46be1c

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=06
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=05-06

  Stats: 305 lines in 4 files changed: 268 ins; 36 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v6]

2022-04-27 Thread Severin Gehwolf
On Wed, 27 Apr 2022 10:34:33 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   revert file

Changes requested by sgehwolf (Reviewer).

test/hotspot/jtreg/containers/docker/TestMisc.java line 60:

> 58: testPrintContainerInfo();
> 59: testPrintContainerInfoActiveProcessorCount();
> 60: testPrintContainerMemoryInfo("100M", "150M");

Again. This test runs unconditionally. `--memory-swappiness` is not supported 
in cgroups v2. Thus, the test will fail on a cgroups v2 system. You need to 
only run this test on a cgroups v1 system. Have a look at 
`test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java` how could could 
detect this and only run on `cgroupv1` providers.

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v6]

2022-04-27 Thread Severin Gehwolf
On Wed, 27 Apr 2022 14:24:50 GMT, Severin Gehwolf  wrote:

>> xpbob has updated the pull request incrementally with one additional commit 
>> since the last revision:
>> 
>>   revert file
>
> test/hotspot/jtreg/containers/docker/TestMisc.java line 60:
> 
>> 58: testPrintContainerInfo();
>> 59: testPrintContainerInfoActiveProcessorCount();
>> 60: testPrintContainerMemoryInfo("100M", "150M");
> 
> Again. This test runs unconditionally. `--memory-swappiness` is not supported 
> in cgroups v2. Thus, the test will fail on a cgroups v2 system. You need to 
> only run this test on a cgroups v1 system. Have a look at 
> `test/lib/jdk/test/lib/containers/cgroup/MetricsTester.java` how could could 
> detect this and only run on `cgroupv1` providers.

On my cgroups v2 system (i.e. it's using 200m memory + 200m swap):

$ sudo docker run --rm -ti --memory-swappiness=0 --memory=200m fedora:35
WARNING: Your kernel does not support memory swappiness capabilities or the 
cgroup is not mounted. Memory swappiness discarded.
[root@fb3182c8e23c /]# cat /sys/fs/cgroup/memory.max 
209715200
[root@fb3182c8e23c /]# cat /sys/fs/cgroup/memory.swap.max 
209715200

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v6]

2022-04-27 Thread xpbob
On Wed, 27 Apr 2022 10:34:33 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   revert file

I refer to the content of this test
https://github.com/openjdk/jdk/blob/0f81d8fcc3fb703760b1cddb01861ea5031023fb/test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java#L119

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v6]

2022-04-27 Thread xpbob
On Wed, 27 Apr 2022 10:34:33 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   revert file

Thanks for review.
@iklam @jerboaa 
I added test to TestMisc with print_container_info and -XshowSettings:system

-

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v6]

2022-04-27 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  revert file

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/f88ad50e..9dd1bbf3

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=05
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=04-05

  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v5]

2022-04-27 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  revert file

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/9bf30945..f88ad50e

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=03-04

  Stats: 18 lines in 1 file changed: 0 ins; 14 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v4]

2022-04-27 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  revert test file

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/2defbf93..9bf30945

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=02-03

  Stats: 19 lines in 1 file changed: 14 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v3]

2022-04-27 Thread xpbob
> set memory.swappiness to 0,swap space will not be used 
> determine the value of memory.swappiness
> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
> 
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 100.00M
> Maximum Processes Limit: 4194305 
> 
> =>
> 
> Memory Limit: 50.00M
> Memory Soft Limit: Unlimited
> Memory & Swap Limit: 50.00M
> Maximum Processes Limit: 4194305

xpbob has updated the pull request incrementally with one additional commit 
since the last revision:

  add test in hotspot

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8285/files
  - new: https://git.openjdk.java.net/jdk/pull/8285/files/cda7f85b..2defbf93

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=8285=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=8285=01-02

  Stats: 38 lines in 3 files changed: 18 ins; 14 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8285.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8285/head:pull/8285

PR: https://git.openjdk.java.net/jdk/pull/8285


Re: RFR: 8284950: CgroupV1 detection code should consider memory.swappiness [v2]

2022-04-20 Thread Severin Gehwolf
On Wed, 20 Apr 2022 18:18:25 GMT, xpbob  wrote:

>> set memory.swappiness to 0,swap space will not be used 
>> determine the value of memory.swappiness
>> https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
>> 
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 100.00M
>> Maximum Processes Limit: 4194305 
>> 
>> =>
>> 
>> Memory Limit: 50.00M
>> Memory Soft Limit: Unlimited
>> Memory & Swap Limit: 50.00M
>> Maximum Processes Limit: 4194305
>
> xpbob has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   add test and hotspot data

Changes requested by sgehwolf (Reviewer).

test/hotspot/jtreg/containers/docker/TestMemoryAwareness.java line 164:

> 162: opts.addDockerOpts("--memory-swappiness", "0");
> 163: } else {
> 164: opts.addDockerOpts("--memory-swappiness", "60");

Unfortunately this breaks on a cgroups v2 system as `--memory-swappiness` is 
not supported there. I'd prefer if this wouldn't piggy back on the existing 
test, but actually assert that swap is properly reported as the same as the 
memory limit if `--memory-swappiness=0`. Also, this test only verifies the Java 
(core-libs) change, not the hotspot change. That would have to be done via some 
`TestMisc` variant which uses `print_container_info()`.

-

PR: https://git.openjdk.java.net/jdk/pull/8285