[LTP] [PATCH v3 1/2] syscalls/fcntl30: clean up && add more range test
Yang Xu
xuyang2018.jy@cn.fujitsu.com
Tue Feb 25 11:20:33 CET 2020
Hi
> Hi!
>>> I was playing with the test and it seems that the kernel allocation may
>>> fail even for much smaller sizes for various reasons. I guess that
>>> memory framentation on long running systems may be the culprit here
>>> because kmalloc() allocates physically continuous memory.
>>>
>>> I guess that the safest bet here would be limiting the maximal size we
>>> try to resize the pipe and succeed to something as 8MB which would be
>>> something as 32 pages to allocate.
>>>
>> Agree.
>>> At the same time I would just define the size we expect to fail with
>>> ENOMEM to 1<<30 and that would save us from this architecture specific
>>> trickery that will probably fail on stranger architectures anyway.
>> On 64kb page size, it will over 1 <<30 for ENOMEM error .I think we can
>> test MAX_SIZE+pg_size(< 1<<31) for ENOMEM error. If beyond 1<<31,
>> expect EINVAL error.
>
> Hmm, maybe we can just double the size in a loop until we hit either
> ENOMEM or EINVAL then and fail the test if we hit them too soon.
I plan to remove this max test because of unknown kmalloc fail, test
range as below
{0, 0, 0, 1, "set a value of below page size"},
{0, 0, 0, 1, "set a normal value"}, //under
non-privileged user,maybe 128k (<1024k )
{0, 0, 1, 1, "set a value of below page size"},
{0, 0, 1, 1, "set a normal value"}, // test 8M as you suggested,
{0, 0, 1, 0, "set a value beyond max"}, //expect EINVAL or ENOMEM
};
What do you think about it?
Best Regards
Yang Xu
>
More information about the ltp
mailing list