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

Re: [PATCH 1/5] xen/domain: Remove function pointers from domain pause helpers


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 15 Nov 2021 11:20:31 +0100
  • 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=ycgNOxVJRYLj0YEZjL+D8k3uwU/iSODKZskAKvuAumU=; b=addhgLTQC7ZWLsU3JyWFGjKyWjlI2+BNWOrlgUMx/rmnl50zenW2W83iOEaCmUI2rA5XJr13m0sQce/v8JFINYfDXeIviYkbhwdJUVW7xv+f8gnG9CZsC6y7mNRu4+u9S59oBJtn9ZICZ5uMqPEawQQyv+rSZbwPkRKAH2i/cq2IsJtQ0VBlIb4aZJb49cB/eOG95BD5rJd+BVst7DI/j19e7TEErO2gHYYXUysaXKrytk6LnIzCK13XG/MI39cqJ4hqrBupN5DguKkWoBDOUmNiKOagcVbOWhMw8fvM+EHSXMYxXeWwGfvQyOLAuyaP5joTpivS0hIgGJ9nVYuN1w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mFk7A3z6hUpmrP224iwlLwOsPoWx2of9j2D+rujHWZqvic8w5hbl7hR7UnVCcb64lXDESVs3PT+o18UyVRgYsJPSipOsucGIRGr7ph3tjirmJ1HO/+Ge3bVFCr9BXQoLfb1BXV+GlY8wz1+QT9qKZMoaCaNPY6vkBw/SyOwWSKUe0HIUiDKlgg3dHEsYVAL7x3PgrFdWTs0WECFrXG+wdsgHkUmmwL+e4FDrlu2cJ9EtlRR0I26CbzNlDSNmZk8mM1/pb+tVQdJL5bgh1DoXdzce8vcFoNfQ5qeBtSmOBnI8wCEkQEJroeYdjKobRm3QhiQDCRWUY43TqhO+WrQtMA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Mon, 15 Nov 2021 10:20:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.11.2021 11:13, Bertrand Marquis wrote:
>> On 11 Nov 2021, at 17:57, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>> --- a/xen/common/domain.c
>> +++ b/xen/common/domain.c
>> @@ -1234,15 +1234,18 @@ int vcpu_unpause_by_systemcontroller(struct vcpu *v)
>>     return 0;
>> }
>>
>> -static void do_domain_pause(struct domain *d,
>> -                            void (*sleep_fn)(struct vcpu *v))
>> +static void _domain_pause(struct domain *d, bool sync /* or nosync */)
> 
> Here you use comments inside the function definition.
> I think this is something that should be avoided and in this specific case a
> boolean sync is clear enough not to need to explain that false is nosing.

While I agree the comment here isn't overly useful, I think ...

>> @@ -1250,12 +1253,12 @@ static void do_domain_pause(struct domain *d,
>> void domain_pause(struct domain *d)
>> {
>>     ASSERT(d != current->domain);
>> -    do_domain_pause(d, vcpu_sleep_sync);
>> +    _domain_pause(d, true /* sync */);
> Same here.

... comments like this one are pretty useful to disambiguate the plain
"true" or "false" (without the reader needing to go look at the function
declaration or definition).

Jan




 


Rackspace

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