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

Re: [PATCH] x86/NUMA: correct memnode_shift calculation for single node system


  • To: Alex Bennée <alex.bennee@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 27 Sep 2022 16:52:31 +0200
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XP3PNaiLaWY6VR4ZhXu1ItnyKhmSysFUsdujkPMM9JU=; b=SvxpcLpttObxHhiHpP0DT5jniz0mWBWYUxk7/X84XkH+lXOOh6wrOY60ZZGVXCDadyrGazI1u2sd/ve+I7CIklCwU7JF/8LNWksPDkCJqphheEkm65ewBB5nEx5DfzbTNv1FQvDzzFkp/wa9AeQ6rdHpO0KEB8tGq48/t1FnHfz+b1hN1/mmf+fx3zRQCjKP/NL2Ua5XWKH2TPuK8drz8+4vYzFKo1AnayY0rPocHUUBdY+2EoWhQYSLqClYsNJkfhYwkEe1T/e1Vm/CyA9ylp8eGCjWTzn1Xdm1Bg7/bmRxt5QSpgsKkERN3n4Ti7QIvHrxN1JXU+c0lKChavP4Kg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nwXuAPml73UmHt/vnhY0pD5Nn8/0SmwuK/yNGsnhnidcAmxtiaiq59sTVE9ZV5Jt6oo8Rx/9YhEe+OwccLZBKMbqgSE6XtQB+NS4FVZGYlfSjnTD0QqLncoWd4U51tShDKzEbbjYhFFYXhdz8O9IghRR+I2QHCmscM5O8ZDJsOxwWEt2r6dVX3v13JAYTntVDuIBuVpP96MOy3uW1Vv+t8Gz6r2Xz4luBiacgHA6feqR1gWvOWFvUkmBCHPc4xm3p/a2Wamyx0rx181aK+htzOqNpktI05ccHIvxcjsa2nAFBKwF33A/yi3HHhKzzdyOHSlQ6tlT5epHkHTwYWs9eQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 27 Sep 2022 14:52:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.09.2022 16:44, Alex Bennée wrote:
> Jan Beulich <jbeulich@xxxxxxxx> writes:
>> @@ -127,7 +128,7 @@ static int __init extract_lsb_from_nodes
>>          if ( spdx >= epdx )
>>              continue;
>>          bitfield |= spdx;
>> -        nodes_used++;
>> +        nodes_used += i == 0 || !nodeids || nodeids[i - 1] !=
>>              nodeids[i];
> 
> Is that boolean short cutting worth it instead of a more easily
> readable:
> 
>         if (i == 0 || !nodeids || nodeids[i - 1] != nodeids[i])
>            nodes_used++;
> 
> ?

If others (especially my co-maintainers) agree, I'd be willing to
switch. Generally I've come to prefer that form as it often serves
as an indication to compilers to try to avoid branches. (That said,
I've neither checked that this has this effect here, nor would it
really matter much, as this code is run exactly once during boot.)

Jan



 


Rackspace

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