linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: "Pankaj Raghav (Samsung)" <kernel@pankajraghav.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>,
	linux-mm@kvack.org, gost.dev@samsung.com,
	David Hildenbrand <david@redhat.com>,
	willy@infradead.org, mcgrof@kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pankaj Raghav <p.raghav@samsung.com>
Subject: Re: [PATCH v3] selftests/mm: use asm volatile to not optimize mmap read variable
Date: Thu, 06 Jun 2024 13:52:36 -0700	[thread overview]
Message-ID: <5B059AE5-AA46-465D-A91E-9142A4FFA0F2@nvidia.com> (raw)
In-Reply-To: <20240606203619.677276-1-kernel@pankajraghav.com>

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

On 6 Jun 2024, at 13:36, Pankaj Raghav (Samsung) wrote:

> From: Pankaj Raghav <p.raghav@samsung.com>
>
> 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 huge page in the page cache.
>
> Use asm volatile() trick to force the compiler not to optimize out
> the loop where we read from the mmaped addr. This is similar to what is
> being done in other tests (cow.c, etc)
>
> As the variable is now used in the asm statement, remove the unused
> attribute.
>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
> Changes since v2:
> - Use the asm volatile trick to force the compiler to not optimize the
>   read into dummy variable. (David)
>
>  tools/testing/selftests/mm/split_huge_page_test.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
LGTM. Reviewed-by: Zi Yan <ziy@nvidia.com>

Best Regards,
Yan, Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

  reply	other threads:[~2024-06-06 20:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 20:36 Pankaj Raghav (Samsung)
2024-06-06 20:52 ` Zi Yan [this message]
2024-06-06 21:09 ` David Hildenbrand
2024-06-08  4:39 ` Andrew Morton
2024-06-08 10:22   ` Pankaj Raghav (Samsung)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5B059AE5-AA46-465D-A91E-9142A4FFA0F2@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=gost.dev@samsung.com \
    --cc=kernel@pankajraghav.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=shuah@kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox