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

Re: [PATCH] x86/mem: Make mem_hotadd_check() more legible


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 19 Jul 2023 15:10:41 +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=9nihrLMiEyoI4GBPA78WwCBZHID1xUUoZR9T/b1mXCU=; b=GloLooGOVfwsmA4F7cpWhsBga2Y9JlRqLBccB9S4wMNpko5gmVYJlucyHHPlukDQtgKcAMSGB/SD0Q4SkwmeBLdtxyGu6F6Q4bg5PkOHwE9lKeUe+cswIU3Qvb4f7jRE1PaxlQ9TDlZmzhOYFIfjGU4J3jbeQO8LxfH7jOWZMU1JJDAVpZ+s/CYKgxxfxJKzMkj0a4/13C/0/um1DwTg2TnZK49XABvWCMwgJMsDPe58AIx7xEPBcTpfrGOCZVSEzxgDGYqtu+BtkQyvnASeOZrlC5LxUqdwx0+myvQ22aE6OC6EYpHTPEz5ao8iRAyRHqxYz0BHm06mB4o+9dzm+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QGubNe+PTk3RpcgFVUHcBTTm3SNgPWiV4A17gYtD1yeyH72UJ80rUPBHiXNS9EhfAAf1IzTiSC7p2D+so5fzP8M94VSkMqqQZg2oNn4Cu3F+7Jw+QSNoBBeMce+WGw8b5r/5jMAfcCqCtFzBi0w+wZJowQgr4If+wktFwfh7WOEqPIwih1Hur67e3KjByepFtuRSh7oKzi/j/dncjJ9qnEJFBbzgF6qnfX9ZdWAW0LC2gaVKJUK7n77JKxEzrcJrALwxY4j004r4cOZdo3luJZi6MfdlzcCRa1KOhb5KRw0JOKRYIF1f4JnNfFbad4b2EoZtbotZoH2QexhiqYCfNA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 19 Jul 2023 13:11:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.07.2023 14:54, Alejandro Vallejo wrote:
> On Wed, Jul 19, 2023 at 02:09:55PM +0200, Jan Beulich wrote:
>>> [1] The hand-crafted alignment there is going to collide with the efforts
>>> to integrate automatic style checkers. It's also not conveying critical
>>> information, so I'd argue for its removal in the spirit of making future
>>> diffs less intrusive.
>>
>> ... I don't agree here. First of all I don't see why this should
>> make style checking harder. There's nothing written anywhere that
>> such alignment padding isn't allowed in our code, so any checker
>> we want to use would need to tolerate it. Plus while such padding
>> doesn't convey critical information, it still helps readability.
>>
> Considering the last Xen Summit sessions I think it's reasonable to assume
> we do want automatic style checking to become a reality. If we want an
> automatic style checker to be eventually introduced I think we should be
> mindful of style changes unlikely to be captured by _any_ policy we may end
> up having. In particular, alignment of arguments across different
> statements on different functions/macros is unsupported on (most?) major
> style checkers, and that's highly unlikely to ever change.
> 
> In particular, any style checker must follow strict rules in order for it
> to yield consistently deterministic results (otherwise it might suffer from
> termination issues). Expecting a style checker to automatically generate
> heuristics that happen to match our current code configuration is not a
> realistic goal, I reckon.

I wasn't thinking of heuristics. I also wasn't expecting a style checker
to actually request adjustments to insert padding where may (seem to be)
missing. What I would expect is that it also doesn't point out such
seemingly excessive padding, requesting it to be dropped. I'll admit that
this may lead to the checking being slightly less useful, because of
potentially not pointing out an issue where there is one, but that would
still seem better to me than involving heuristics.

Jan

> In this sense, having a guideline (i.e: not a rule) about trying to avoid
> hand-crafted alignment where the benefit of it is not critical would be
> good. In the spirit of making a complicated problem simpler rather than...
> well, complicated.
> 
> Alejandro




 


Rackspace

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