[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v4 01/10] xen/page_alloc: Extract code for consuming claims into inline function
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Bernhard Kaindl <bernhard.kaindl@xxxxxxxxxx>
- Date: Wed, 4 Mar 2026 18:04:10 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=7dJQeHs9cvZ6btZc71IPUR3teyBS83Ug9Xkx1pLIiw8=; b=S2qZFIgmpWqJLigarlfN0L4nDIkuMBqrqEqwFRdnjgD28wUrDZTE0T4GZ5FGHup6DxTzvg7S4eUbHr4sEZqyrk6iGJlJdVv5W64dw/ZEtjXf5tsAQnkyamvVjNX5X+zYlz1Jm5Ikghtdof6JE7DWd2qbh1YYiXENYnNj/hipn9NCHCsEqkox9hPRbkIiiCzg8K8jWHWqvljDfORArFjoE6RXV7cwFGbSM54ZERKHyKTXziTphy7D49QyezvdNoIm7DUCGve7Bo0/Ou9ssHMLUoKzn16IaSckKEv3vdJClhMRPf+h4/Tbv3Jz0haykEItoAqWHFoTK6Xj3Iy4U/N05Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ymcZB7avWz+upqpYod/pq+fsiZAHbbvaCVTsEpDhT5cqoR471dzK7HLSQLP1uujj+TEXkrvwifq93ExuqTI+FEUjiHBhwVP8CxtXysxjr+HpvohW4fG1DAg3uTb9um2wQr2UuK8aehW2PHZwlOWhYaFafwyTytU3/hotGOEFPD1KCCVBkjgMphhjRjafDS9EevXpUyB1JbgAih1SOMC31t88cFRB0iC49Ren5U94oEq87K5VplOMRRfsqbCdCEyHxwCj9k4s/WKxnAwztgEUwvyVlsL4znRJsAgjRu53BGkEq8ue+GrJBUS0XQtJzsca7BqK3LjkLQ2E7rJ+K6g1WQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Andrew Cooper <andrew.cooper@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 04 Mar 2026 18:04:37 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHcq/LTrNW7h1OyYkqbdUVMe4OBY7Weji2g
- Thread-topic: [PATCH v4 01/10] xen/page_alloc: Extract code for consuming claims into inline function
> > +static inline
>
> Generally we prefer to avoid "inline" in .c files. This is better left to the
> compiler. Furthermore while we have a few examples of this kind of line split,
> it's clearly not the preferred form. You'll find ample well-formed static
> functions in this one source file alone.
Ok, I will look for the preferred form.
> > +void consume_outstanding_claims(struct domain *d, unsigned long allocation)
> > +{
> > + if ( !d || !d->outstanding_pages )
> > + return;
> > + ASSERT(spin_is_locked(&heap_lock));
>
> Why is this not the first thing in the function?
Thanks, will move it up.
> > @@ -1048,29 +1075,8 @@ static struct page_info *alloc_heap_pages(
> > total_avail_pages -= request;
> > ASSERT(total_avail_pages >= 0);
> >
> > - if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
> > - {
> > - /*
> > - * Adjust claims in the same locked region where total_avail_pages
[...]
>
> Much of this comment is lost. Parts have been moved, but I think another part
> (in particular the first paragraph) wants to be retained here. Plus in general
> when rearranging code it is best to take the original commentary as is (typo
> or factual corrections of course included as necessary).
Ack, thanks, indeed, it is a good idea to keep this in place to inform readers
of the importance of having claims release and avail counter updates in the
same locked region. I'll retain the fist paragraph here and maybe only move
the 2nd part of the comment out of the alloc_heap_pages code flow.
Bernhard
|