From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3F41EA0542; Wed, 5 Oct 2022 01:30:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE90C40A7D; Wed, 5 Oct 2022 01:30:30 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 4DE0F40041 for ; Wed, 5 Oct 2022 01:30:28 +0200 (CEST) Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Mhv4T5292zpVD8; Wed, 5 Oct 2022 07:27:21 +0800 (CST) Received: from fraeml712-chm.china.huawei.com (10.206.15.61) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 5 Oct 2022 07:30:24 +0800 Received: from fraeml712-chm.china.huawei.com ([10.206.15.61]) by fraeml712-chm.china.huawei.com ([10.206.15.61]) with mapi id 15.01.2375.031; Wed, 5 Oct 2022 01:30:22 +0200 From: Konstantin Ananyev To: Bruce Richardson , =?iso-8859-1?Q?Morten_Br=F8rup?= CC: =?iso-8859-1?Q?Mattias_R=F6nnblom?= , "Konstantin Ananyev" , Kevin Laatz , "dev@dpdk.org" , "anatoly.burakov@intel.com" , Conor Walsh , David Hunt , Nicolas Chautru , Fan Zhang , "Ashish Gupta" , Akhil Goyal , Fengchengwen , Ray Kinsella , "Thomas Monjalon" , Ferruh Yigit , Andrew Rybchenko , Jerin Jacob , Sachin Saxena , "Hemant Agrawal" , Ori Kam , "Honnappa Nagarahalli" , =?iso-8859-1?Q?Mattias_R=F6nnblom?= Subject: RE: [PATCH v7 1/4] eal: add lcore poll busyness telemetry Thread-Topic: [PATCH v7 1/4] eal: add lcore poll busyness telemetry Thread-Index: AQHYyBwnq1Rf9qaPr0irR9A4hv15eq3mcjuwgAUpd4CABeTakIAEzzAAgAM/lACAA4UJAIAA3YyAgAAtPICAANeHYA== Date: Tue, 4 Oct 2022 23:30:22 +0000 Message-ID: <65e7b372212141b386b06b39ea32fa72@huawei.com> References: <24c49429394294cfbf0d9c506b205029bac77c8b.1657890378.git.anatoly.burakov@intel.com> <20220914092929.1159773-1-kevin.laatz@intel.com> <20220914092929.1159773-2-kevin.laatz@intel.com> <9a6fec15f9684d21bb4730596cceacff@huawei.com> <4af4b5d6-57a9-39a4-2197-a2acdc57156b@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D87386@smartserver.smartshare.dk> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.195.35.107] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Bruce, > On Tue, Oct 04, 2022 at 11:15:19AM +0200, Morten Br=F8rup wrote: > > > From: Mattias R=F6nnblom [mailto:hofors@lysator.liu.se] > > > Sent: Monday, 3 October 2022 22.02 > > > > [...] > > > > > The functionality provided is very useful, and the implementation is > > > clever in the way it doesn't require any application modifications. > > > But, > > > a clever, useful brittle hack is still a brittle hack. > > > >=20 > I think that may be a little harsh here. After all, this is a feature whi= ch > is build-time disabled and runtime disabled by default, so like many othe= r > components it's designed for use when it makes sense to do so. Honestly, I don't understand why both you and Kevin think that conditional compilation provides some sort of indulgence here... Putting #ifdef around problematic code wouldn't make it any better. In fact, I think it only makes things worse - adds more confusion, makes it harder to follow the code, etc.=20 >=20 > Furthermore, I'd just like to point out that the authors, when doing the > patches, have left in the hooks so that even apps, for which the "for-fre= e" > scheme doesn't work, can still leverage the infrastructure to have the ap= p > itself report the busy/free metrics. Ok, then it is probably good opportunity not to push for problematic soluti= on, but try to exploit these hook-points? Take one of existing DPDK examples, add code to expose these hook points. That will also demonstrate for the user how to use these hooks properly, and how difficult It would be to adopt such approach. =20 =20 > > > What if there was instead a busyness module, where the application > > > would > > > explicitly report what it was up to. The new library would hook up to > > > telemetry just like this patchset does, plus provide an explicit API = to > > > retrieve lcore thread load. > > > > > > The service cores framework (fancy name for rte_service.c) could also > > > call the lcore load tracking module, provided all services properly > > > reported back on whether or not they were doing anything useful with > > > the > > > cycles they just spent. > > > > > > The metrics of such a load tracking module could potentially be used = by > > > other modules in DPDK, or by the application. It could potentially be > > > used for dynamic load balancing of service core services, or for powe= r > > > management (e.g, DVFS), or for a potential future deferred-work type > > > mechanism more sophisticated than current rte_service, or some green > > > threads/coroutines/fiber thingy. The DSW event device could also use = it > > > to replace its current internal load estimation scheme. > > > > [...] > > > > I agree 100 % with everything Mattias wrote above, and I would like to = voice my opinion too. > > > > This patch is full of preconditions and assumptions. Its only true adva= ntage (vs. a generic load tracking library) is that it doesn't > require any application modifications, and thus can be deployed with zero= effort. > > > > I my opinion, it would be much better with a well designed generic load= tracking library, to be called from the application, so it gets > correct information about what the lcores spend their cycles doing. And a= s Mattias mentions: With the appropriate API for > consumption of the collected data, it could also provide actionable stati= stics for use by the application itself, not just telemetry. > ("Actionable statistics": Statistics that is directly usable for decision= making.) > > > > There is also the aspect of time-to-benefit: This patch immediately pro= vides benefits (to the users of the DPDK applications that > meet the preconditions/assumptions of the patch), while a generic load tr= acking library will take years to get integrated into > applications before it provides benefits (to the users of the DPDK applic= ations that use the new library). > > > > So, we should ask ourselves: Do we want an application-specific solutio= n with a short time-to-benefit, or a generic solution with a > long time-to-benefit? (I use the term "application specific" because not = all applications can be tweaked to provide meaningful data > with this patch. You might also label a generic library "application spec= ific", because it requires that the application uses the library - > however that is a common requirement of all DPDK libraries.) > > > > Furthermore, if the proposed patch is primarily for the benefit of OVS,= I suppose that calls to a generic load tracking library could be > added to OVS within a relatively short time frame (although not as quick = as this patch). > > > > I guess that the developers of this patch initially thought that it was= generic and usable for the majority of applications, and it came > as somewhat a surprise that it wasn't as generic as expected. The DPDK co= mmunity has a good review process with open discussions > and sharing of thoughts and ideas. Sometimes, an idea doesn't fly, becaus= e the corner cases turn out to be more common than > expected. I'm sorry to say it, but I think that is the case for this patc= h. :-( > > >=20 > I'd actually like to question this last statement a little. >=20 > I think we in the DPDK community are very good at coming up with > theoretical examples where things don't work, but are they really cases > that occur commonly in the real-world? >=20 > I accept, for example, that the "for free" approach would not be suitable > for something like VPP which does multiple polls to gather packets before > processing, but for some of the other cases I'd question their commonalit= y. > For example, a number of objections have focused on the case where > allocation of buffers fails and so the busyness gets counted wrongly. Ar= e > there really (many) apps out there where running out of buffers is not a > much more serious problem than incorrectly reported busyness stats? Obviously, inability to dynamically allocate a memory could flag a serious = problem.=20 Though I don't see why it should be treated as an excuse to provide a misle= ading statistics. There are many real-world network appliances that supposed to keep working properly even under severe memory pressure. As an example: suppose your app is doing some sort of TCP connection tracki= ng. So, for every new flow you need to allocate some socket-like structure. Also suppose that for performance reasons you use DPDK mempool to manage these structures. Now, it could be situations (SYN flood attack) when you run out of your so= ckets. In that situation it is probably ok to start dropping such packets, but traffic belonging to already existing connections, plus non-TCP traffic= =20 still expected to be handled properly. >=20 > I'd also say that, in my experience, the non-open-source end-user apps te= nd > very much to use DPDK based on the style of operation given in our DPDK > examples, rather than trying out new or different ways of working. (Maybe > others have different experiences, though, and can comment). I also tend = to > believe that open-source software using DPDK probably shows more variety = in > how things are done, which is not representative of a lot of non-OSS user= s > of DPDK. >=20 > Regards, > /Bruce