From: Vasileios Karakasis <bkk@cslab.ece.ntua.gr>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-numa@vger.kernel.org,
'Kornilios Kourtis' <kkourt@cslab.ece.ntua.gr>
Subject: Re: realloc function
Date: Wed, 05 Jan 2011 14:11:44 +0200 [thread overview]
Message-ID: <4D246000.8010404@cslab.ece.ntua.gr> (raw)
In-Reply-To: <e92e5084878b3f88a2861a9ba7b0388f.squirrel@www.firstfloor.org>
[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]
On 01/05/2011 12:20 AM, Andi Kleen wrote:
>> Hi,
>>
>> I am sending you the updated patch (against the latest 2.0.6 version). I
>> call numa_police_memory_int() only for the newly allocated pages, when
>> the area is expanded. I also added a numa_realloc_onnode() function in
>> the same fashion as that of the numa_alloc_onnode(), which sets a
>> specific memory binding. I pass the MPOL_MF_MOVE flag to mbind(), but I
>> am not sure if this is worth it, since the call becomes too slow even
>> in the case of no page migration. Without the MPOL_MF_MOVE flag, of
>> course, if the policy changes between realloc's, previously allocated
>> pages won't be affected.
>
> Thinking about it more police_* is likely still the wrong semantics.
> That will always set the current policy.
>
> But the user more likely wants the same policy the original
> mapping had, right?
I agree with that. In my use case at least, I start with an
alloc_on_node() and keep realloc'ing assuming all new pages will be
allocated on the node I specified. Of course, this questions more the
existence of a realloc_onnode() function, since its functionality
overlaps with that of migrating/moving pages. So adopting these
semantics, I think we can drop the numa_realloc_onnode().
>
> This could be implemented by calling get_mempolicy() on the old
> mapping with MPOL_F_ADDR and setting it on the new pages in
> the new mapping.
>
I will come up with a patch in the next few days.
> -Andi
>
>
Regards,
--
V.K.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2011-01-05 12:11 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
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 [this message]
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=4D246000.8010404@cslab.ece.ntua.gr \
--to=bkk@cslab.ece.ntua.gr \
--cc=andi@firstfloor.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.