Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-09 Thread Thomas Weißschuh
On Thu, Jan 09, 2025 at 02:05:43PM +0100, David Hildenbrand wrote: > > > > That is clear. The issue would be to figure which chunks are valid to > > unmap. If something critical like the executable file is unmapped, > > the process crashes. But see below. > > Ah, now I see what you mean. Yes, also

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-09 Thread David Hildenbrand
On 09.01.25 14:05, David Hildenbrand wrote: > That is clear. The issue would be to figure which chunks are valid to unmap. If something critical like the executable file is unmapped, the process crashes. But see below. Ah, now I see what you mean. Yes, also the stack etc. will be problematic

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-09 Thread David Hildenbrand
> That is clear. The issue would be to figure which chunks are valid to unmap. If something critical like the executable file is unmapped, the process crashes. But see below. Ah, now I see what you mean. Yes, also the stack etc. will be problematic. So IIUC, you want to limit the munmap optimi

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-08 Thread Thomas Weißschuh
On Wed, Jan 08, 2025 at 05:46:37PM +0100, David Hildenbrand wrote: > On 08.01.25 17:13, Thomas Weißschuh wrote: > > On Wed, Jan 08, 2025 at 02:36:57PM +0100, David Hildenbrand wrote: > > > On 08.01.25 09:05, Thomas Weißschuh wrote: > > > > On Wed, Jan 08, 2025 at 11:46:19AM +0530, Dev Jain wrote: >

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-08 Thread Dev Jain
On 08/01/25 9:43 pm, Thomas Weißschuh wrote: On Wed, Jan 08, 2025 at 02:36:57PM +0100, David Hildenbrand wrote: On 08.01.25 09:05, Thomas Weißschuh wrote: On Wed, Jan 08, 2025 at 11:46:19AM +0530, Dev Jain wrote: On 07/01/25 8:44 pm, Thomas Weißschuh wrote: If not enough physical memory is

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-08 Thread David Hildenbrand
On 08.01.25 17:13, Thomas Weißschuh wrote: On Wed, Jan 08, 2025 at 02:36:57PM +0100, David Hildenbrand wrote: On 08.01.25 09:05, Thomas Weißschuh wrote: On Wed, Jan 08, 2025 at 11:46:19AM +0530, Dev Jain wrote: On 07/01/25 8:44 pm, Thomas Weißschuh wrote: If not enough physical memory is ava

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-08 Thread Thomas Weißschuh
On Wed, Jan 08, 2025 at 02:36:57PM +0100, David Hildenbrand wrote: > On 08.01.25 09:05, Thomas Weißschuh wrote: > > On Wed, Jan 08, 2025 at 11:46:19AM +0530, Dev Jain wrote: > > > > > > On 07/01/25 8:44 pm, Thomas Weißschuh wrote: > > > > If not enough physical memory is available the kernel may f

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-08 Thread David Hildenbrand
On 08.01.25 09:05, Thomas Weißschuh wrote: On Wed, Jan 08, 2025 at 11:46:19AM +0530, Dev Jain wrote: On 07/01/25 8:44 pm, Thomas Weißschuh wrote: If not enough physical memory is available the kernel may fail mmap(); see __vm_enough_memory() and vm_commit_limit(). In that case the logic in val

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-08 Thread Thomas Weißschuh
On Wed, Jan 08, 2025 at 11:46:19AM +0530, Dev Jain wrote: > > On 07/01/25 8:44 pm, Thomas Weißschuh wrote: > > If not enough physical memory is available the kernel may fail mmap(); > > see __vm_enough_memory() and vm_commit_limit(). > > In that case the logic in validate_complete_va_space() does

Re: [PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-07 Thread Dev Jain
On 07/01/25 8:44 pm, Thomas Weißschuh wrote: If not enough physical memory is available the kernel may fail mmap(); see __vm_enough_memory() and vm_commit_limit(). In that case the logic in validate_complete_va_space() does not make sense and will even incorrectly fail. Instead skip the test if

[PATCH 1/3] selftests/mm: virtual_address_range: Fix error when CommitLimit < 1GiB

2025-01-07 Thread Thomas Weißschuh
If not enough physical memory is available the kernel may fail mmap(); see __vm_enough_memory() and vm_commit_limit(). In that case the logic in validate_complete_va_space() does not make sense and will even incorrectly fail. Instead skip the test if no mmap() succeeded. Fixes: 010409649885 ("self