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

Re: [PATCH v5 9/9] xen: retrieve reserved pages on populate_physmap


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 31 May 2022 11:40:39 +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=NRrEYUr1PhB3yQHjeFKf3cDCjzXMujI4Hq1C9vwnkvI=; b=oAVth+f22xen9vHKY3/HRGw7z/llmMj3XXwjuKJbwfVW6Lv0rSPeuGWCaFaTRV5M+tGoyZQCJBks5i1YX80phGkbkQnejyNhMUhbeAs62iGGLsCTIi2biHegZURq8XmbXdOz4g0WcH8DVSQvX06IGTN30mvgT7ThNRLOKqM1SVEUhV2AFR69JX3EHcgDoY8zi4yKOD/RudRNlYbpmjsFALi60Bae5bafQijxTUbwRgrrFajDLDshzYe+lVMZDyOq7T1+Ly6uugOns3w9AGv6Afn43mNCy4GJO7RtALbS3AaPWKw09MOfBxOibE9LGa+5Lhr2ICcD3X09bTYTmpI7XA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m+7HpAxEfWF3qYQYQHsiduRs0orIRYTLtc/LZr1U+GdG14UR70btuzkZERTg+YFOA+KUFZaXyxsyMljvNXvPgwB5KqygwpniRglBnTauT/HkeKSQYxe78YZm8Qm8wonf7I+dykO3aawqQ6/iUcep9uY1rbYh+QdAvCHuuRHE+hqrzjBhMAhB/8qxPBUEzsQK7KNfg5XthWc0wjr8VAISReu9JGmi0Fegsic/q+alLjHIfHJOrOAJMQcIZKG3Jn1Mp40+Mtwy6VABRQyCYj1Flfhdm9wayyvfOcFktnLpCI1bDUa3tEQpF+WqyFUE4ckDKeoF98LzE02tS6tFm8+ASA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: wei.chen@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Penny Zheng <Penny.Zheng@xxxxxxx>
  • Delivery-date: Tue, 31 May 2022 09:40:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.05.2022 11:35, Julien Grall wrote:
> On 31/05/2022 09:54, Jan Beulich wrote:
>> On 31.05.2022 05:12, Penny Zheng wrote:
>>> --- a/xen/common/memory.c
>>> +++ b/xen/common/memory.c
>>> @@ -245,6 +245,29 @@ static void populate_physmap(struct memop_args *a)
>>>   
>>>                   mfn = _mfn(gpfn);
>>>               }
>>> +            else if ( is_domain_using_staticmem(d) )
>>> +            {
>>> +                /*
>>> +                 * No easy way to guarantee the retrieved pages are 
>>> contiguous,
>>> +                 * so forbid non-zero-order requests here.
>>> +                 */
>>> +                if ( a->extent_order != 0 )
>>> +                {
>>> +                    gdprintk(XENLOG_WARNING,
>>> +                             "Cannot allocate static order-%u pages for 
>>> static %pd\n",
>>> +                             a->extent_order, d);
>>> +                    goto out;
>>> +                }
>>> +
>>> +                mfn = acquire_reserved_page(d, a->memflags);
>>> +                if ( mfn_eq(mfn, INVALID_MFN) )
>>> +                {
>>> +                    gdprintk(XENLOG_WARNING,
>>> +                             "%pd: failed to retrieve a reserved page\n",
>>> +                             d);
>>> +                    goto out;
>>> +                }
>>> +            }
>>
>> I'm not convinced of having these gdprintk()s here. 
> 
> There are a number of time where I wished some error paths would contain 
> debug printk(). Instead, I often end up to add them myself when I 
> struggle to find the reason of a failure.

But this model doesn't scale - we don't want to have log messages on
each and every error path. I agree having such for very unlikely
errors, but order != 0 is clearly a call site mistake and memory
allocation requests failing also ought to not be entirely unexpected.

Jan




 


Rackspace

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