From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasileios Karakasis Subject: Re: realloc function Date: Wed, 05 Jan 2011 14:11:44 +0200 Message-ID: <4D246000.8010404@cslab.ece.ntua.gr> References: <4D20B7E6.9020207@cslab.ece.ntua.gr> <4D22461A.4050206@cslab.ece.ntua.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE12F1267C21272B09FA12BA2" Return-path: In-Reply-To: Sender: linux-numa-owner@vger.kernel.org List-ID: To: Andi Kleen Cc: linux-numa@vger.kernel.org, 'Kornilios Kourtis' This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE12F1267C21272B09FA12BA2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Thinking about it more police_* is likely still the wrong semantics. > That will always set the current policy. >=20 > 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(). >=20 > 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. >=20 I will come up with a patch in the next few days. > -Andi >=20 >=20 Regards, --=20 V.K. --------------enigE12F1267C21272B09FA12BA2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAk0kYAYACgkQHUHhfRemepykXwCePDP/dwcY1aAKeYPVfkbF38bH 4zUAn2DV2fI+vx2zBZv4dV3YQBXa0G/X =Esfj -----END PGP SIGNATURE----- --------------enigE12F1267C21272B09FA12BA2--