Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
On Thu, Jun 06, 2024 at 10:21:51PM +0200, David Hildenbrand wrote: > On 06.06.24 22:18, Pankaj Raghav (Samsung) wrote: > > On Thu, Jun 06, 2024 at 05:57:21PM +0200, David Hildenbrand wrote: > > > On 06.06.24 17:56, David Hildenbrand wrote: > > > > On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: >

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread David Hildenbrand
On 06.06.24 22:18, Pankaj Raghav (Samsung) wrote: On Thu, Jun 06, 2024 at 05:57:21PM +0200, David Hildenbrand wrote: On 06.06.24 17:56, David Hildenbrand wrote: On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
On Thu, Jun 06, 2024 at 05:57:21PM +0200, David Hildenbrand wrote: > On 06.06.24 17:56, David Hildenbrand wrote: > > On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: > > > From: Pankaj Raghav > > > > > > create_pagecache_thp_and_fd() in split_huge_page_test.c used the > > > variable dummy to per

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread David Hildenbrand
On 06.06.24 17:56, David Hildenbrand wrote: On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread David Hildenbrand
On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The issue was compiler (gcc 13.2.0) was optimizi

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
On Thu, Jun 06, 2024 at 03:35:31PM +0100, Matthew Wilcox wrote: > On Thu, Jun 06, 2024 at 01:58:35PM +, Pankaj Raghav (Samsung) wrote: > > +++ b/tools/testing/selftests/mm/split_huge_page_test.c > > @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, > > size_t fd_size, i

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Zi Yan
On 6 Jun 2024, at 7:35, Matthew Wilcox wrote: > On Thu, Jun 06, 2024 at 01:58:35PM +, Pankaj Raghav (Samsung) wrote: >> +++ b/tools/testing/selftests/mm/split_huge_page_test.c >> @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, >> size_t fd_size, int *fd, >>

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Matthew Wilcox
On Thu, Jun 06, 2024 at 01:58:35PM +, Pankaj Raghav (Samsung) wrote: > +++ b/tools/testing/selftests/mm/split_huge_page_test.c > @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, > size_t fd_size, int *fd, > char **addr) > { > size_t i; > - int

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Zi Yan
On 6 Jun 2024, at 6:58, Pankaj Raghav (Samsung) wrote: > From: Pankaj Raghav > > create_pagecache_thp_and_fd() in split_huge_page_test.c used the > variable dummy to perform mmap read. > > However, this test was skipped even on XFS which has large folio > support. The issue was compiler (gcc 13.2

[PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The issue was compiler (gcc 13.2.0) was optimizing out the dummy variable, therefore, not creating h