[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 15 Nov 2021 10:23:47 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=wg7zFFlTSh9cfxBzNVu6uYIAkzK7iko8jMNfsXGwjj0=; b=AGyceUFtqTtDWysZqIHWtP2t9S3uopJYPAyN1CC2HODmJOGg5z/UgYFdj72jSSUbzmB0ZQ6bM1zyiOIKHzQTMvrRZPi3WBtn3EUDbnKSot+F1fwldzvK1t3OrGHoSFiR3GySqjXCUmrPP6t+UNF2e6GEId1Ep1AHeIyGZOCgzcLWUu3Wig7JrQUkFHD/NN6SC6KRn0KTlAgHZx5Rd0mz4Z3q3MzrTCJ++4BqtoOTMoESMTqyKzvYdOhm00Zkuv0HEd66o0Hr9TYDr7EeSgtj0lkyJjhmbFEZn2qAsH2k6vN8A5NpnUfTQVlhKoHIrZmlGHdoPmtHiTms1FfgUItEZg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C46zhMWIPPlafbzkNmlgaS8PjAe1I6mP5YrtKlnh6/TUQqr1zcsG2kSzoRThhzNS7/YFa/FPnE+BBL8hDDZd63mIkpv/uOtn0YpGoDb+Vm2D6OmXVE2pb5ZGOL8vrCR6IzLfcXSK2zu68GfbOk8X86W3qsN2Y7WZWbeCMuxgBsOAz1bTSrsxmWtDNSdgDNSIjVvV6Z5yfeCj1GxOCPQlcAvxirC0zW5hCUYfIwyoC02xtESL9rA9u5/4RE1M6hqd/PRy/kwBTZ4HXd+j+TTGwloZPRYJZjr2MJwrXg7hjkSLxOemH6NdUJsgaZIsz604cr19ivTr+VTJjfUSJoOa4A==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.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:24:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHX1yW51DCh4Kb6WkC+olJaqOqcEawEZHMAgAACF4CAAADoAA==
  • Thread-topic: [PATCH 1/5] xen/domain: Remove function pointers from domain pause helpers

Hi Jan,

> On 15 Nov 2021, at 10:20, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> 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).

I agree with that but the comment here is useful, it could be added before
the call instead of inside it.

Bertrand

> 
> Jan
> 




 


Rackspace

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