Re: [PATCH v8 3/3] selftests/mm: add new selftests for KSM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Hildenbrand <david@xxxxxxxxxx> writes:

> On 17.04.23 16:35, David Hildenbrand wrote:
>>> +/* Verify that KSM can be enabled / queried with prctl. */
>>> +static void test_prctl(void)
>>> +{
>>> +	int ret;
>>> +
>>> +	ksft_print_msg("[RUN] %s\n", __func__);
>>> +
>>> +	ret = prctl(PR_SET_MEMORY_MERGE, 1, 0, 0, 0);
>>> +	if (ret < 0 && errno == EINVAL) {
>>> +		ksft_test_result_skip("PR_SET_MEMORY_MERGE not supported\n");
>>> +		return;
>>> +	} else if (ret) {
>>> +		ksft_test_result_fail("PR_SET_MEMORY_MERGE=1 failed\n");
>>> +	}
>> Just realized we're missing a "return;" in case of the failure here.
>>
>
>
> And we should probably fix that as well:
>
> ERROR: do not initialise globals to 0
> #235: FILE: tools/testing/selftests/mm/ksm_tests.c:57:
> +int debug = 0;
>
> total: 1 errors, 0 warnings, 512 lines checked

I'll fix it in the next version.'




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux