linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: David Hildenbrand <david@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>
Cc: kernel@collabora.com, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/mm: pagemap_scan ioctl: add PFN ZERO test cases
Date: Wed, 2 Jul 2025 18:52:28 +0500	[thread overview]
Message-ID: <063b278a-ab6b-4c10-9ecf-f4ad7dbc8c14@collabora.com> (raw)
In-Reply-To: <f474ef7b-71f3-4169-ba30-74f4afbaeee6@redhat.com>

...
>>>
>>>> +
>>>> +    free(mem);
>>>
>>>
>>> Shouldn't this be an munmap() ?
>> free() is being used to free memory allocated by memalign().
> 
> Oh, I missed that detail.
> 
> I'm afraid memalign+free that might not be what you want: there is no guarantee that what you are getting hasn't been used before and is not already filled with other pages?
I'm not sure I've been using memalign() to allocate aligned memory and
the using madvise().

I'll switch up to mmap() for this test. I'll send v2.

> 



      reply	other threads:[~2025-07-02 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 10:24 Muhammad Usama Anjum
2025-07-01 14:51 ` David Hildenbrand
2025-07-02  7:39   ` Muhammad Usama Anjum
2025-07-02  8:28     ` David Hildenbrand
2025-07-02 13:52       ` Muhammad Usama Anjum [this message]

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=063b278a-ab6b-4c10-9ecf-f4ad7dbc8c14@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@kernel.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