Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add case for discard memory content #5074

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

nanli1
Copy link
Contributor

@nanli1 nanli1 commented Aug 1, 2023

VIRT-298033: Discard memory content
Signed-off-by: nanli [email protected]


 [root@dell-per730-59 tp-libvirt]  avocado run --vt-type libvirt --test-runner=runner --vt-machine-type q35 memory.backing.discard

 (01/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_yes.mem_discard_yes.file: PASS (52.49 s)
 (02/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_yes.mem_discard_yes.anonymous: PASS (55.71 s)
 (03/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_yes.mem_discard_yes.memfd: PASS (55.42 s)
 (04/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_yes.mem_discard_yes.hugepaged_file: PASS (55.10 s)
 (05/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_yes.mem_discard_not_defined.file: PASS (61.37 s)
 (06/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_yes.mem_discard_not_defined.anonymous: PASS (54.37 s)
 (07/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_yes.mem_discard_not_defined.memfd: PASS (55.98 s)
 (08/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_yes.mem_discard_not_defined.hugepaged_file: PASS (54.62 s)
 (09/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_no.mem_discard_yes.file: PASS (58.69 s)
 (10/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_no.mem_discard_yes.anonymous: PASS (57.80 s)
 (11/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_no.mem_discard_yes.memfd: PASS (54.62 s)
 (12/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_no.mem_discard_yes.hugepaged_file: PASS (55.22 s)
 (13/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_no.mem_discard_not_defined.file: PASS (59.34 s)
 (14/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_no.mem_discard_not_defined.anonymous: PASS (57.71 s)
 (15/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_no.mem_discard_not_defined.memfd: PASS (55.76 s)
 (16/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_no.mem_discard_not_defined.hugepaged_file: PASS (55.56 s)
 (17/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_not_defined.mem_discard_yes.file: PASS (58.03 s)
 (18/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_not_defined.mem_discard_yes.anonymous: PASS (58.43 s)
 (19/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_not_defined.mem_discard_yes.memfd: PASS (60.47 s)
 (20/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_not_defined.mem_discard_yes.hugepaged_file: PASS (54.51 s)
 (21/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_not_defined.mem_discard_not_defined.file: PASS (57.05 s)
 (22/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_not_defined.mem_discard_not_defined.anonymous: PASS (54.72 s)
 (23/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_not_defined.mem_discard_not_defined.memfd: PASS (59.53 s)
 (24/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.numa_discard_not_defined.mem_discard_not_defined.hugepaged_file: PASS (57.80 s)
 (25/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.no_numa.mem_discard_yes.file: PASS (56.63 s)
 (26/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.no_numa.mem_discard_yes.anonymous: PASS (54.54 s)
 (27/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.no_numa.mem_discard_yes.memfd: PASS (64.33 s)
 (28/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.no_numa.mem_discard_yes.hugepaged_file: PASS (52.31 s)
 (29/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.no_numa.mem_discard_not_defined.file: PASS (55.61 s)
 (30/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.no_numa.mem_discard_not_defined.anonymous: PASS (61.47 s)
 (31/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.no_numa.mem_discard_not_defined.memfd: PASS (54.31 s)
 (32/32) type_specific.io-github-autotest-libvirt.memory.backing.discard.memory_allocation.no_numa.mem_discard_not_defined.hugepaged_file: PASS (57.63 s)

@nanli1
Copy link
Contributor Author

nanli1 commented Aug 1, 2023

modular_redesign

@nanli1 nanli1 force-pushed the add_case_for_discard_memory_content branch from c76c3f7 to 77e3a0b Compare August 1, 2023 10:04
@dzhengfy dzhengfy self-requested a review October 23, 2023 09:06
@dzhengfy
Copy link
Contributor

dzhengfy commented Oct 23, 2023

@hs0210 Would you like to test on your arm environment and give feedback? Thanks

Copy link
Contributor

@dzhengfy dzhengfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM

if numa_attrs:
vm_attrs.update(numa_attrs)
vm_attrs.update(mem_attrs)
test.log.debug("Get current vm attrs is :%s" % vm_attrs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

% -> ,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks done.

- numa_discard_not_defined:
numa_attrs = {'vcpu': 4,'cpu': {'numa_cell': [{'id': '0', 'cpus': '0-3', 'memory': '${numa_mem}', 'unit': 'KiB'}]}}
numa_path = {'element_attrs': ['./cpu/numa/cell/[@memory="${numa_mem}"]']}
- no_numa:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except this no_numa, other cases are not supported on s390x. So could you help handling this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks dzheng, done

@nanli1 nanli1 force-pushed the add_case_for_discard_memory_content branch from 77e3a0b to fca0d36 Compare October 24, 2023 03:11
@nanli1 nanli1 requested a review from dzhengfy October 24, 2023 03:23
Copy link
Contributor

@dzhengfy dzhengfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Not sure if arm guy has comment

@dzhengfy
Copy link
Contributor

@hs0210 will check it tomorrow. Let's wait for a while.


elif mem_discard in ["mem_discard_yes", "mem_discard_not_defined"] \
and numa_discard == "numa_discard_no":
expected_discard = "false"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behavior of no_discard is different on 8 and 9 for all both x86 and aarch64:
on 9.3, the discard-data is false in the qemu cmd line
on 8.9, no discard-data para in the qemu cmd line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks hshuai,Done , Please help heck

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liang-cong-red-hat Hi lcong ,Could you double confirm here? Is this suited for x86 ,Thank you !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lcong has updated the polarion case , I will update auto code

- hugepaged_file:
source_type = 'hugepage'
hugepages_attr = "'hugepages': {}"
hugepages_path = {'element_attrs': ['./memoryBacking/hugepages']}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default huge pagesize on XXXX-8 aarch64 is 512M, but above setting is for 2M pagesize. Please adjust the test to accommodate aarch64.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks hshuai,Done , Please help heck

@nanli1 nanli1 force-pushed the add_case_for_discard_memory_content branch from fca0d36 to 1d8c857 Compare October 26, 2023 09:28
@nanli1 nanli1 requested a review from hs0210 October 26, 2023 09:29
   VIRT-298033: Discard memory content
Signed-off-by: nanli <[email protected]>
@nanli1 nanli1 force-pushed the add_case_for_discard_memory_content branch from 1d8c857 to b7b54aa Compare October 27, 2023 04:43
Copy link
Contributor

@hs0210 hs0210 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chloerh chloerh merged commit 904382f into autotest:master Oct 30, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants