[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 01/10] page-alloc: Clamp get_free_buddy() to online nodes


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Tue, 30 Jul 2019 08:09:14 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CEKBwt9pOQOcttd85ycIJ8RvVLnAKU0WOjUOSKoMdGo=; b=D1jQ2lASsEPEpX/1B7lLMdpYei6GzYAIm2IsQWJJWRlkebovaCzYUQ+OlSkE7SZ64cdaS7fBet/t4djIiWwawwCmM8Az4r5A1MyMYpNJXcKyzWi5l+/qxIdrUVqndF1cuVfx6ikKum+3iicbUAwKtQoKhvKmaCrS4h1DjC9XGPMWwK6mFeMRiC+FwjMNbIq94G6sfR2gy/ruvHVU9DE7Jigx884h3LKfeUCUGRQClrnNdZCSj6HOkCc9pOZ1bdt+fdRRW6ZO0zqToZUrUfsSK/AEqGodoh/Nr2hJWMpw5M7+6gkDydfChUSAffKWLt2zcaW4kSlNJc/LFrYkPTXWLQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PaC2oywjvyxzX74mygbtl7yxrfWzgA1fLM/vmYS67P7qwehcI0X7OdAyjmrwXq9rE/M/jXmWRFk2FMXal2WPB4JEkWWfz4vf8nIA0Rk0AZMdNWLPvbX1Il+ym6KM6EuTaeDnJCxR/IDxrQKb0WZDBPheZl0eLPOepi79OAz9K5KJNip8WLUm98faXE8/ecjpfzPDVpz3IbGXiLzm+AjtLYPxQ7AvF2mH8f8Ep2GmeoeuwdWMJnaHWNmoSOGjBEf1c6DMevSHPIvZ3HG/KvnOwwsUnoGqqU/q4mCpEAIVGyrE5RrsJ8BiIa4+M/ANpY9naT3afc5voP0oLqUvH8mnFQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: StefanoStabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 30 Jul 2019 08:11:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVRgcXbA5oo5qfM0G3fbP8NjBdsqbhvgyAgAAbkuCAAPZygA==
  • Thread-topic: [Xen-devel] [PATCH v3 01/10] page-alloc: Clamp get_free_buddy() to online nodes

On 29.07.2019 19:26, Andrew Cooper wrote:
> On 29/07/2019 16:48, Jan Beulich wrote:
>> On 29.07.2019 14:11, Andrew Cooper wrote:
>>> +    if ( d )
>>> +        nodes_and(nodemask, nodemask, d->node_affinity);
>> Despite my earlier ack: Code further down assumes a non-empty mask,
>> which is no longer guaranteed afaics.
> 
> Nothing previous guaranteed that d->node_affinity had any bits set in
> it, either.
> 
> That said, in practice it is either ALL, or something derived from the
> cpu=>node mappings, so I don't think this is a problem in practice.
> 
>> I think you want to append an
>> "intersects" check in the if().
> 
> I think it would be better to assert that callers don't give us complete
> junk.
> 
>> With that feel free to promote my
>> A-b to R-b.
> 
> How about:
> 
>      if ( d )
>      {
>          if ( nodes_intersect(nodemask, d->node_affinity) )
>              nodes_and(nodemask, nodemask, d->node_affinity);
>          else
>              ASSERT_UNREACHABLE();
>      }
> 
> ?
> 
> This change has passed my normal set of prepush checks (not not that
> there is anything interesting NUMA-wise in there).

domain_update_node_affinity() means to guarantee a non-empty mask (by
way of a similar assertion), when ->auto_node_affinity is set. Otoh
domain_set_node_affinity() may clear that flag, at which point I can't
see what would guarantee that the intersection would remain non-empty
as CPUs get offlined. (I don't understand, btw, why the function calls
domain_update_node_affinity() after clearing the flag.) Therefore I
don't think an assertion like you suggest would be legitimate. For
this there would be a prereq of domain_update_node_affinity() clearing
the flag when it finds the intersection has become empty. And even
then there would be a window in time where the intersection might be
actively empty, so some synchronization would be needed in addition.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.