[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:55:39 +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=wgJdF0YUrX9dl8I6Mk8SvQd/Fvmv82xtDqUaM7mpsGM=; b=Tpm+aPFAV4jXmGnXeVOUGvKpM9hBU49xVAzLAdNkkvqbEfj5B0s3UAeT8c0Vu32uzoBdPviSjYr7pDP1vnYxpsPHenVrV+rjNIjO9iGpjE9Vev58z7Bvv9Gbh9OpRZznIKivUhipC/2Z0rIHmx1tqMOxvYf6PQdM3U2sz3TgzvyhbhsMg5PFLr7I+kVn4pOtnsnpERlvkNRQjO7s+NFX3ZBKicX8ojaL8xX0TRfM50axTXIMl6FAJbwGIIWnMK2h27DaDdhWNC8Jy7NPSquTg3Aliw5gQJh7CAFji2oWwz3qluzOsE9ZIn0o0LVlxyDZUtQ4EwVq8AFA1nH/BVR8IQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iRqseEckfZKTaQTpB6dJ+3e6OQ7BdGcQVtfAjmzQTBObCInJhF8dktPnYq4T8l7WczCcr1NvxWaovDlug4O+bbBph0irNsEwfd9bGruv0iWqyYf+Z290SxHFCm1KFoKlkVpLNuIF8JmvFtt8Jrldtf9/ZxB0jtoR8hRQlrdBnMjuDP5u+GHVki+CLxFLcAefLxuIbTA8TRGqVWMtdCVO1NeiOODoj8Bcje0vn4gG/EFG1Lawmo3Icj2GZbzQwAqWBehX0qIyX2PgEBMAkw4aiLWdpJgRIYIhh8Ns2gzNwUS3Okw2/o7v0fRhT50l/0Nou8tMEZ3t0pHKUDjNXD2RDg==
- 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:55:48 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 15.11.2021 11:23, Bertrand Marquis wrote:
> 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.
Except the form Andrew has used is the one we've been using elsewhere
for some time.
Jan
|