From: "Andi Kleen" <andi@firstfloor.org>
To: Vasileios Karakasis <bkk@cslab.ece.ntua.gr>
Cc: linux-numa@vger.kernel.org,
'Kornilios Kourtis' <kkourt@cslab.ece.ntua.gr>
Subject: Re: realloc function
Date: Mon, 3 Jan 2011 00:42:32 +0100 [thread overview]
Message-ID: <cb6acfbaf0298126322f9e92f46b5b17.squirrel@www.firstfloor.org> (raw)
In-Reply-To: <4D20B7E6.9020207@cslab.ece.ntua.gr>
> I am submitting a patch for a realloc function that might be useful. The
> proposed numa_realloc() is merely a wrapper to mremap(), which it calls
> with the flag MREMAP_MAYMOVE. The policy of the vm area is copied by the
> kernel in case of moving. I am also submitting a test program, that
> keeps expanding an initial allocation until a limit is reached and
> checks the mempolicy of the expanded area in every iteration.
>
> My use case is a dynamic array implementation which uses realloc() to
> dynamically expand the array and I want to convert it to a numa-aware
> implementation.
You need to call numa_police_memory_int() in the function, otherwise
the policy won't be actually preserved.
-Andi
next prev parent reply other threads:[~2011-01-02 23:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-02 17:37 realloc function Vasileios Karakasis
2011-01-02 23:42 ` Andi Kleen [this message]
2011-01-03 21:56 ` Vasileios Karakasis
2011-01-03 22:44 ` Cliff Wickman
2011-01-04 22:20 ` Andi Kleen
2011-01-05 12:11 ` Vasileios Karakasis
2011-01-05 15:00 ` Vasileios Karakasis
2011-01-05 19:25 ` Andi Kleen
2011-01-10 22:12 ` Vasileios Karakasis
2011-01-10 22:17 ` Andi Kleen
2011-01-11 16:29 ` Cliff Wickman
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=cb6acfbaf0298126322f9e92f46b5b17.squirrel@www.firstfloor.org \
--to=andi@firstfloor.org \
--cc=bkk@cslab.ece.ntua.gr \
--cc=kkourt@cslab.ece.ntua.gr \
--cc=linux-numa@vger.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;
as well as URLs for NNTP newsgroup(s).