From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F07DCC433F5 for ; Fri, 11 Feb 2022 13:33:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.270515.464829 (Exim 4.92) (envelope-from ) id 1nIW39-0006i3-F8; Fri, 11 Feb 2022 13:33:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 270515.464829; Fri, 11 Feb 2022 13:33:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nIW39-0006hw-BD; Fri, 11 Feb 2022 13:33:23 +0000 Received: by outflank-mailman (input) for mailman id 270515; Fri, 11 Feb 2022 13:33:21 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nIW37-0006hk-Co for xen-devel@lists.xenproject.org; Fri, 11 Feb 2022 13:33:21 +0000 Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2c1cc74b-8b3f-11ec-8f75-fffcc8bd4f1a; Fri, 11 Feb 2022 14:33:19 +0100 (CET) Received: from pps.filterd (m0174679.ppops.net [127.0.0.1]) by mx0a-0039f301.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 21BDXHH5013770; Fri, 11 Feb 2022 13:33:17 GMT Received: from eur03-db5-obe.outbound.protection.outlook.com (mail-db5eur03lp2050.outbound.protection.outlook.com [104.47.10.50]) by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 3e5re2837x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Feb 2022 13:33:17 +0000 Received: from PA4PR03MB7136.eurprd03.prod.outlook.com (2603:10a6:102:ea::23) by VI1PR03MB6543.eurprd03.prod.outlook.com (2603:10a6:800:17d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.15; Fri, 11 Feb 2022 13:32:56 +0000 Received: from PA4PR03MB7136.eurprd03.prod.outlook.com ([fe80::c1c:f98:9dd:86e0]) by PA4PR03MB7136.eurprd03.prod.outlook.com ([fe80::c1c:f98:9dd:86e0%6]) with mapi id 15.20.4975.015; Fri, 11 Feb 2022 13:32:56 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2c1cc74b-8b3f-11ec-8f75-fffcc8bd4f1a 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== 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-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8bomLOGTWhU73lBEobhu7KCXWLNL+7knZzPF9tfwpRg=; b=IFF5UehHMHK1p/4RDle2dvKRd4YxuyQ+/f2kC4av5BdZCNHm7xZC70Ox3pEaSvNoDvEKH4nHMh1Fk3ZSJftxV0EHERlgWxkiEae3uaWJlwuGO6WOYntFYzrDfdnY1AFqJUtq3xUfWx/HkdT/8YR4NbeDyCoolLq7G2zs9Sgqylm5s5PGkfFVRsT9Y+4SxKsn1+amJGPJLUz0xoc8av53+mxgimn9X3qL11iVGiF5r+Ypi/hi82Na4yIyUXCn6y9S3o65bEVJ1esZSS2ruMOhsj0pmf6AyZwTdwyQt8eygMl+wxWkXHpEwNzEXsFFPjMjuPmdm6wKbqH8uyCHqy1i5A== From: Oleksii Moisieiev To: Juergen Gross CC: "xen-devel@lists.xenproject.org" Subject: Re: [RFC v2 1/8] xen/hypfs: support fo nested dynamic hypfs nodes Thread-Topic: [RFC v2 1/8] xen/hypfs: support fo nested dynamic hypfs nodes Thread-Index: AQHYHRW07SkrMxyT/k6/hhSCHW7RmqyMZwEAgAGeF4CAAFdXgIAAASWA Date: Fri, 11 Feb 2022 13:32:56 +0000 Message-ID: <20220211133255.GA2391443@EPUAKYIW015D> References: <8ab7e9ffd5f041c2631f754c7c596874cf6a99c1.1644341635.git.oleksii_moisieiev@epam.com> <74e4635d-10ad-86c4-71b1-6e46bc76a89a@suse.com> <20220211081613.GA2274024@EPUAKYIW015D> <342456bd-9138-fd6c-3c5c-2384bbf5d98b@suse.com> In-Reply-To: <342456bd-9138-fd6c-3c5c-2384bbf5d98b@suse.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7c8a30ef-58ef-40fc-abbf-08d9ed63035c x-ms-traffictypediagnostic: VI1PR03MB6543:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Qv4AN/PsAQ1uHJemKkju+vD2meOAxNv38/xpkkrzqEbXhkTGZPOBbFtlBVM/19X6GJBFOYIzwTjcUCNw9DQIasuvwS8FjdZ1VDGrLzZWPWzymoLZR1fsFu4L/q5koF3AXNbAyCHI1p5SD/A/PzGfBOsF8R8c4cGJiG6oW3pf3tni7jDZ8KOlNFSKC7F3wu7+GgqdmLVsF6iV85htSsy4z9/GhXqSv65jW1P+6+92RCezswe7L3Uzdl7rDdN7GbJze4Y6BKQsv52WDvU2LSfDIHdDilnIh1mw3jpaf22H8AQSksLV641fzUEvpbo9/9aGcyiByivyH40oai6fNxtQ2arvJHm5NlI0F35LoKcqVcdErNcf7MRF9DTCVUG4z+pHDl2Vzgdo7PuJMa1XI4SDZQXNI3zWPwpMN2TLce51dyg7kk0mfayvGYWphlcXaPqyt39xnPItbyKJUX10VymPrQXGE1R/fYljNq2IpMBCSps88cXCVvIzHlxjkmjsccNFmKqHYAdyGdmpGXostO4KSKSFQCewLESO3L6k7X/oie8B2OL9bZ3K5B5hcZ18BM2aBK2T6AmueZJ/wbzftqUK8qc709wx6lcHIoGkKwDnqhGBiECiVbVTUZhKrEm/pZ8qZ6rIEG9bR3dJzxWPwI3DcVAhvD7erJgV8P30gVwsCfdQPR2/GYRVOWn4L3ujuVD7X895ngFwJXgRiMXcpcE9Qw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR03MB7136.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(7916004)(366004)(71200400001)(86362001)(38100700002)(1076003)(38070700005)(83380400001)(6486002)(122000001)(33716001)(508600001)(33656002)(316002)(6506007)(6916009)(66476007)(186003)(2906002)(26005)(53546011)(6512007)(91956017)(9686003)(8936002)(5660300002)(8676002)(76116006)(66946007)(64756008)(66446008)(66556008)(4326008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?stzdXVS9BuMiS+J0YLe+VQXCsym1jGdNWewzxyCeAFs+Wx6hUznziN1z+3/D?= =?us-ascii?Q?5fyX3VpMzdASgtnv4ATirxVZdtExw87qQcwXH2dvW0HImZIQrgeWYkbi/5Zk?= =?us-ascii?Q?P07sBrCI7fvjCWHd3XScWXcNKCgdK447qXg36llBGohddtuiDziamuG9DN/2?= =?us-ascii?Q?T842Qo3GHf0Y8KoritaywQT8460YaPx0niMKDnEvBZ5QJd3h3i0I43LSYvsM?= =?us-ascii?Q?dMaRTB62f12h+I67zYMUrxs2cl1s6/FiFLrDYzKBRVuh7+rH/xong+bYqArA?= =?us-ascii?Q?X+9IW7Xg8juev+0Y7HC3jHIwjM3PTcHsMuIy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Q?jf6jWor2Hn9Ov/itQIrL96e4c8hdWIEO3tMVth9vjcJqWiaJWc+N/Qlb4IUW?= =?us-ascii?Q?UA79eQGEmplxL0u1uo+quTUF/0I5m0LcK7GJOW03ID9f0I31qvhRSP99tHV6?= =?us-ascii?Q?oOQvNiVlVyswkc+VNyoWywDS8HFsCDRuaZPfE3PSNQQoZTqErnjp3n31WlYf?= =?us-ascii?Q?hkN/AC9AxQSmEtTrigz5TR6+ZKWJ/qcb+RFyFXl8X4Eo1hxF6SJ1Qwz6VZag?= =?us-ascii?Q?FOqw7sOSOFSfe516nzfv8pG9aGo54apSmKeA8gxQsYFNXmUP7JEzkz3i8f7F?= =?us-ascii?Q?X+Jw6u+oZ1qGgjQZkSU6uI9YKUXDR8WjwGXXCJZqoK+f9bvmzMretFf54EBn?= =?us-ascii?Q?Y1LcNLCVqmH8zvq6JFSShBTGfSKYXTYbVtv1xnoSh++rpoD9xGTEEF4VWqUu?= =?us-ascii?Q?99tRS8NKSbPxMrsqV3yT8wqG1Vfg3SLbFxza0CZYLPBNVmx1oPSAr6g5T6KR?= =?us-ascii?Q?lbv+Umgajpd1LvLKPvLUwB3imvI=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: <2DDFFFC342B06F439F7DAD4B0BB37DD4@eurprd03.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR03MB7136.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c8a30ef-58ef-40fc-abbf-08d9ed63035c X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2022 13:32:56.2961 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: z6AJUOXLvpUamu6uIzrYTbxF2RzSlJ/0Sw4VqISvJQbkdSniWhmSRrpwehatUGlEkLE28PHh2VqV7fvzwLJY7M9omSAkqV9eFnAezHFDneQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB6543 X-Proofpoint-GUID: 6JYfY-NxFT2vHv541C0IP_5VCiKL3CQ4 X-Proofpoint-ORIG-GUID: 6JYfY-NxFT2vHv541C0IP_5VCiKL3CQ4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-11_04,2022-02-11_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 priorityscore=1501 mlxlogscore=999 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 impostorscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202110076 On Fri, Feb 11, 2022 at 02:28:49PM +0100, Juergen Gross wrote: > On 11.02.22 09:16, Oleksii Moisieiev wrote: > > Hi Juergen, > >=20 > > On Thu, Feb 10, 2022 at 08:34:08AM +0100, Juergen Gross wrote: > > > On 08.02.22 19:00, Oleksii Moisieiev wrote: > > >=20 > >=20 > > > > Add new api: > > > > - hypfs_read_dyndir_entry > > > > - hypfs_gen_dyndir_entry > > > > which are the extension of the dynamic hypfs nodes support, present= ed in > > > > 0b3b53be8cf226d947a79c2535a9efbb2dd7bc38. > > > > This allows nested dynamic nodes to be added. Also input parameter = is > > > > hypfs_entry, so properties can also be generated dynamically. > > > >=20 > > > > Generating mixed list of dirs and properties is also supported. > > > > Same as to the dynamic hypfs nodes, this is anchored in percpu poin= ter, > > > > 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 hand= le > > > > should be allocated on the first enter() call and released on the l= ast > > > > exit() call. > > > >=20 > > > > Signed-off-by: Oleksii Moisieiev >=20 > ... >=20 > > > > 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 { > > >=20 > > > Please rename to struct hypfs_dyndir. > >=20 > > Ok, thanks. > >=20 > > >=20 > > > > 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 ent= ry. */ > > > > unsigned int id; /* Numerical id. */ > > >=20 > > > What about the following change instead: > > >=20 > > > - 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 entr= y. */ > > >=20 > >=20 > > 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? >=20 > 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. >=20 This make sense. I'll make this union. Thanks. > >=20 > > 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 acces= s > > is needed? >=20 > Sure, if you need that. Thanks I will do this as well. Best regards, Oleksii >=20 > >=20 > > PS: I will address all your comments in v3. >=20 > Thanks, >=20 >=20 > Juergen