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

Re: [RFC v2 1/8] xen/hypfs: support fo nested dynamic hypfs nodes


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Fri, 11 Feb 2022 13:32:56 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=8bomLOGTWhU73lBEobhu7KCXWLNL+7knZzPF9tfwpRg=; b=MtqG4p2jj3frsnEEEwSkSg9y5D2uviRbJySuoCqtF9CkCMMoWPEYOljhs2P36w9d+tkSjeRuZxzfi1z4kPbIcM22HaEYOTlh/bHKspwh3eFzDc6MdoJH2wvtx4oCBsTcpzWaDkPG6CuWx+h4yvQRxq2m6T0vp6hEnU1sh+OYDeGUsmy0SlUF8Ebnh+XYDObiaxoR5G4DK2q4XsMoJMbSsQCOaj4D7qYWsW2LUVvW57err58AeWRzdjLZZ5Of7IG7NRXX7CVYbipVznAetH4cv1zX4yis2+rlvKDDT+vAQR7Ac27lkxyoWIAKh7RSZKopQkWZl6vnTK7IzOUr91R+LA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YbXx/mdvPJ3gyIjLImoP8clYqZReC9YyLiXY1s2Xrx537W2NcIhiRFWE7x6dc+RMBkGiH04l7ADlqcI0X41QCCn47nGCnaeeGdoTFtRdy939v5TvZvi2NCTgqAQOqk4PQWyMSn2tbd8eAkecoOKBhDazN3qq9IQZfgK96O6qSYRwIVs7J8ydZ411PnTdbU+XKY8x8/Cpqmre5+Xjs8WsiT8+ztbyBkyh6xC3mD7rHZhtvjINX6ox/UUyJkWp1vlOVhir2InYyviKd4hjLPIeffoAaB87HKvyQgbcQC2+c3/m0YTg4D55YhE5i1WQdfPCs8KYJogwrA52APPgkLryig==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 11 Feb 2022 13:33:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYHRW07SkrMxyT/k6/hhSCHW7RmqyMZwEAgAGeF4CAAFdXgIAAASWA
  • Thread-topic: [RFC v2 1/8] xen/hypfs: support fo nested dynamic hypfs nodes

On Fri, Feb 11, 2022 at 02:28:49PM +0100, Juergen Gross wrote:
> On 11.02.22 09:16, Oleksii Moisieiev wrote:
> > Hi Juergen,
> > 
> > On Thu, Feb 10, 2022 at 08:34:08AM +0100, Juergen Gross wrote:
> > > On 08.02.22 19:00, Oleksii Moisieiev wrote:
> > > 
> > 
> > > > Add new api:
> > > > - hypfs_read_dyndir_entry
> > > > - hypfs_gen_dyndir_entry
> > > > which are the extension of the dynamic hypfs nodes support, presented in
> > > > 0b3b53be8cf226d947a79c2535a9efbb2dd7bc38.
> > > > This allows nested dynamic nodes to be added. Also input parameter is
> > > > hypfs_entry, so properties can also be generated dynamically.
> > > > 
> > > > Generating mixed list of dirs and properties is also supported.
> > > > Same as to the dynamic hypfs nodes, this is anchored in percpu pointer,
> > > > which can be retriewed on any level of the dynamic entries.
> > > > This handle should be allocated on enter() callback and released on
> > > > exit() callback. When using nested dynamic dirs and properties handle
> > > > should be allocated on the first enter() call and released on the last
> > > > exit() call.
> > > > 
> > > > Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@xxxxxxxx>
> 
> ...
> 
> > > > diff --git a/xen/include/xen/hypfs.h b/xen/include/xen/hypfs.h
> > > > index e9d4c2555b..5d2728b963 100644
> > > > --- a/xen/include/xen/hypfs.h
> > > > +++ b/xen/include/xen/hypfs.h
> > > > @@ -79,8 +79,8 @@ struct hypfs_entry_dir {
> > > >    struct hypfs_dyndir_id {
> > > 
> > > Please rename to struct hypfs_dyndir.
> > 
> > Ok, thanks.
> > 
> > > 
> > > >        struct hypfs_entry_dir dir;             /* Modified copy of 
> > > > template. */
> > > >        struct hypfs_funcs funcs;               /* Dynamic functions. */
> > > > -    const struct hypfs_entry_dir *template; /* Template used. */
> > > > -#define HYPFS_DYNDIR_ID_NAMELEN 12
> > > > +    const struct hypfs_entry *template; /* Template used. */
> > > > +#define HYPFS_DYNDIR_ID_NAMELEN 32
> > > >        char name[HYPFS_DYNDIR_ID_NAMELEN];     /* Name of hypfs entry. 
> > > > */
> > > >        unsigned int id;                        /* Numerical id. */
> > > 
> > > What about the following change instead:
> > > 
> > > -    const struct hypfs_entry_dir *template; /* Template used. */
> > > -#define HYPFS_DYNDIR_ID_NAMELEN 12
> > > -    char name[HYPFS_DYNDIR_ID_NAMELEN];     /* Name of hypfs entry. */
> > > -
> > > -    unsigned int id;                        /* Numerical id. */
> > > -    void *data;                             /* Data associated with id. 
> > > */
> > > +    const struct hypfs_entry *template;  /* Template used. */
> > > +    union {
> > > +#define HYPFS_DYNDIR_NAMELEN    32
> > > +        char name[HYPFS_DYNDIR_NAMELEN]; /* Name of hypfs entry. */
> > > +        struct {
> > > +#define HYPFS_DYNDIR_ID_NAMELEN 12
> > > +            char name[HYPFS_DYNDIR_ID_NAMELEN]; /* Name of id entry. */
> > > +            unsigned int id;                    /* Numerical id. */
> > > +        } id;
> > > +    };
> > > +    void*data;                          /* Data associated with entry. */
> > > 
> > 
> > I'm not sure I see the benefit from this union. The only one I see is
> > that struct hypds_dyndir will be smaller by sizeof(unsigned int).
> > Could you explain please?
> 
> My main concern is that it is not obvious to a user that the
> numerical id is needed only for a special case. Putting it into
> the union makes this much more clear.
> 

This make sense. I'll make this union. Thanks.

> > 
> > Also what do you think about the following change:
> > -    char name[HYPFS_DYNDIR_ID_NAMELEN];     /* Name of hypfs entry. */
> > -
> > -    unsigned int id;                        /* Numerical id. */
> > -    void *data;                             /* Data associated with id. */
> > +    char name[HYPFS_DYNDIR_ID_NAMELEN];     /* Name of hypfs entry. */
> > +
> > +    unsigned int id;                        /* Numerical id. */
> > +    union {
> > +       const void *content;
> > +       void *data;                             /* Data associated with id. 
> > */
> > +    }
> > This change is similar to the hypfs_entry_leaf. In this case we can
> > store const pointer for read-only entries and use data when write access
> > is needed?
> 
> Sure, if you need that.

Thanks I will do this as well.

Best regards,
Oleksii
> 
> > 
> > PS: I will address all your comments in v3.
> 
> Thanks,
> 
> 
> Juergen







 


Rackspace

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