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

RE: [PATCH v6 9/9] xen: retrieve reserved pages on populate_physmap


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Thu, 9 Jun 2022 05:58:44 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=bWAEh1+OLJV9Xdv58lHsoPOV4yHsCh0rjQy+NPOPoOs=; b=AskxFymftaOyRu1BaCFTFHkSE8dn0XFrwmDLhPNdUQIws1XV4uWom9lk/bnnUvT/nlcpcvRgK4BeAocrGrEKMQg52SpgYKRD2gpF0zD27m71EtI5rC5iKE0Dchls7rSSqwIb+edaaR+WMcTlspmcmxhTlcQTtynD1QfH/v40OwAUOpT9y7GS3NzJcO5lCPfhInPnhCrXW6iMX/3Oj5ywEOTdIhBgN8Yj+G43R9ixfnyxCudeJA5VgRZchWsim5rHqklrLXP+B63sjqzFz5dsjSPxSFc9vQfeX+0VG0qzx8P/uwM6F7LQVc/Yvlx9lJNMpM8ftY16ctXF16LxYe4M9g==
  • 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=bWAEh1+OLJV9Xdv58lHsoPOV4yHsCh0rjQy+NPOPoOs=; b=UsPh3IwKrl8OJRJYuo4N/YF7YbnHcxrhshRgZYTgAIZIR2YICrLCA1FBr2DvRgNR0vlJ9n9fAow7uqhrtTCyWYck7KyMLsN+3DB31Cn2WHyaCv4F/asWvfGndmHQPgH0UwMHtSHvFNT8tL2lGsgJ0uN+f7Q9E77zfjE0gquUMUcm0RraxpqvPv8+unwq6iakxnBL3TUbI6Ex3P6ey7fBzdBKdX+8f9jfNXp8/+ocKp8cZaP1u05CMNXQLmw2Zr17xCX1ZerGXwWw+bp7HGRRg5NnMesHkMWBO/hwD9zImd1iQKjtLMt+jcWSPy1h4v0pG3Oj1jZXf+zu/gzI+dSnIA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=UxSWc5Sil4Y7AsYsmph20zaW1fk9R5dKnSbmZjyGqMVAsD7g6t9chzKpk7SdKKnnlyA6IcHd5r5NdbnzOK/i+mmUEg2/EIxfUOtQ96+EPgzu2KfmPq2medsoKUEPZ4k7E8e4YWwIweCDJ77oHoy/gXLo1G2GqoWzjcKjMxFpX9rFFRPUYJjpwMrr9L/so920QjeUTL9YLf+1795o/HxA9v9kCidN7xAGfQYKon1gEr+HTLF8HW72YD/ft7Pmq1eVE3vtBzG40vns+XGKQLRaZ6+m4Ty0zmpYbDsWfmAW7l9yTFhnFgqbrPKuEsuoK+2QpAIA1ZLWKUnous6t5fEchQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IysKou5d/5XJzVm2vbpBvFdsC8iGAlUg0T/Et+Eu3Be/7o/4edW3HFRLUrFv2AbkOfktcsoJIA6FCXaCUFjOu71Gwn0ObYm5FeUmIXcdpyCbzbnVoiSvO7w4b9+NQFHZN5AvikzbXyyQWepQAqgGPrbpdMU+XJeNPkXhhHLJHmbWkBfWsLEmWYxiQaRKQTbPFrPaRBx1sDG4fLOUJ0xSZXfQlRhySszB4j1Jux+NVOdP7+dnkmI4frv89F6sGd13VekIvPJ5uJXPVLvh2bnohOWKK8/xpQnl5uhriQZS/giD/fw2LQ0bs0yvJwjeyINrVflaw+dopJfzbwckWYJEsg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 09 Jun 2022 05:59:01 +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: AQHYekCd/J/B/CFgukmRW4QioUnzda1DlC2AgAMCXbA=
  • Thread-topic: [PATCH v6 9/9] xen: retrieve reserved pages on populate_physmap

Hi Jan

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Tuesday, June 7, 2022 3:58 PM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>
> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; George Dunlap <george.dunlap@xxxxxxxxxx>;
> Julien Grall <julien@xxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; 
> Wei
> Liu <wl@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v6 9/9] xen: retrieve reserved pages on populate_physmap
> 
> On 07.06.2022 09:30, Penny Zheng wrote:
> > +/*
> > + * Acquire a page from reserved page list(resv_page_list), when
> > +populating
> > + * memory for static domain on runtime.
> > + */
> > +mfn_t acquire_reserved_page(struct domain *d, unsigned int memflags)
> > +{
> > +    struct page_info *page;
> > +
> > +    spin_lock(&d->page_alloc_lock);
> > +    /* Acquire a page from reserved page list(resv_page_list). */
> > +    page = page_list_remove_head(&d->resv_page_list);
> > +    spin_unlock(&d->page_alloc_lock);
> 
> With page removal done under lock, ...
> 
> > +    if ( unlikely(!page) )
> > +        return INVALID_MFN;
> > +
> > +    if ( !prepare_staticmem_pages(page, 1, memflags) )
> > +        goto fail;
> > +
> > +    if ( assign_domstatic_pages(d, page, 1, memflags) )
> > +        goto fail;
> > +
> > +    return page_to_mfn(page);
> > +
> > + fail:
> > +    page_list_add_tail(page, &d->resv_page_list);
> > +    return INVALID_MFN;
> 
> ... doesn't re-adding the page to the list also need to be done with the lock
> held?

True, Sorry about that.
Like I said in another thread with Julien, I'll add the missing half part
"
For freeing part, I shall get the lock at arch_free_heap_page(),
where we insert the page to the rsv_page_list, and release the lock at the end 
of
the free_staticmem_page
"

> 
> Jan


 


Rackspace

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