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 5FB5CA0552; Thu, 20 Oct 2022 21:18:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C0DB410D1; Thu, 20 Oct 2022 21:18:31 +0200 (CEST) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mails.dpdk.org (Postfix) with ESMTP id 1F8D340FAE for ; Thu, 20 Oct 2022 21:18:30 +0200 (CEST) Received: by mail-lf1-f54.google.com with SMTP id j4so1291445lfk.0 for ; Thu, 20 Oct 2022 12:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=P667oHiDVtpSytQwXNdKdkEtR9XNrUvnrXv1Ug1QXyQ=; b=DE8zorxZuR7t/uILMqoTa7cVzaBBOp1QPEaEaO1k0Yoo4qlpLyq6qsq5xyjuexs/DE WnLm/h76+hWnp0WxnzrqeZX/GXrrCcvDh05w1B4KSChLLHxSqTSCfqo+NiZF/KCHMfae uHh7hr2mGAVIrVmMAVRyuPhYErjRFVM+1v6NjqXyfn5fr5TvP0/nhEtuEeJpgXUMzDdn 0/owIgEvas3Tf5x+ctJNujVHL8JNQsGM+mvd4tSEUS9HB5tjOhEvudr7N5tNUSahiAp6 K3aAo7kXCjiDQTh1rKwMa9GnhrwYpvuK9wQaPfg7TqeuYE5VgF9HTfQXrBIZ3pwIZIFu U9dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P667oHiDVtpSytQwXNdKdkEtR9XNrUvnrXv1Ug1QXyQ=; b=dIpzDMhb2XvrgDyV+GY7GEMQZ609LGnx228UzTxZ3Z7Al3zJWVhPGuTct5429qNFh7 z3GeUTC9ILWaBUrKo8vFwGeLomBZ6pSPvOpSd4zSDhdEA6tcVRZL5lIHxQyzBws3y47g 929Gp004f3bVC5wSbXQWgsCmF+PMbBteiDO7RWkxzhDcme4/zaJjPWCUkJhTTYo6aAEt omvgjWfsWTolUPzjapZbhU3WxFU4ult27xvE0yeftXz+ghulq02BjLsvMAE3KxHIMcVq dWWPkkSpJVBkEats4o0WlDec5f6SEt6woG920xU+RUJO7AZZrAJv/kRvhDdzWV76F9vE Ivzw== X-Gm-Message-State: ACrzQf3g+D1gQO7oI9SAvfuezGaMIgy2eE7Gi4KTXT2Qb3jMj0BM/4l/ r2wuN4XTrpcjUy++wZ8m4X4= X-Google-Smtp-Source: AMsMyM44XDkVR+IYRaptg68KqDiz9Rj1wXUgpmFZ07rLDRrmEjEbKuVxyr3w5PSEGDdQZ10Dr7AM/g== X-Received: by 2002:a05:6512:308d:b0:4a2:33d3:b8f1 with SMTP id z13-20020a056512308d00b004a233d3b8f1mr5576027lfd.133.1666293509479; Thu, 20 Oct 2022 12:18:29 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id b29-20020ac25e9d000000b0048cc076a03dsm2821878lfq.237.2022.10.20.12.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 12:18:28 -0700 (PDT) Date: Thu, 20 Oct 2022 22:18:27 +0300 From: Dmitry Kozlyuk To: Amit Prakash Shukla Cc: David Marchand , Thomas Monjalon , Anatoly Burakov , "dev@dpdk.org" , Jerin Jacob Kollanukkaran , "bruce.richardson@intel.com" , "ciara.power@intel.com" Subject: Re: [EXT] Re: [PATCH v5 2/2] mem: telemetry support for system memory information Message-ID: <20221020221827.73275090@sovereign> In-Reply-To: References: <20220525103352.1806937-1-amitprakashs@marvell.com> <20220929114313.1346972-1-amitprakashs@marvell.com> <20220929114313.1346972-2-amitprakashs@marvell.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 2022-10-11 07:10 (UTC+0000), Amit Prakash Shukla: > Thanks David for the feedback. Please find the proposed fixed inline. > > > -----Original Message----- > > From: David Marchand > > Sent: Saturday, October 8, 2022 1:17 AM > > To: Amit Prakash Shukla ; Thomas Monjalon > > ; Anatoly Burakov ; > > dmitry.kozliuk@gmail.com > > Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran ; > > bruce.richardson@intel.com; ciara.power@intel.com > > Subject: [EXT] Re: [PATCH v5 2/2] mem: telemetry support for system > > memory information > > > > External Email > > > > ---------------------------------------------------------------------- > > On Thu, Sep 29, 2022 at 1:44 PM Amit Prakash Shukla > > wrote: > > > > > > Changes adds telemetry support to display system memory information, > > > allocated using calls malloc, calloc, mmap, etc. This patch is based > > > on malloc_info. This patch adds following endpoints: > > > > malloc_info is a GNU extension. > > It is not available in musl and it breaks compilation in Alpine Linux. > > So I can't take this patch. > > Shall we limit this for Glibc at compile time ? > > +#if defined __GLIBC__ && defined __GLIBC_PREREQ > +#if __GLIBC_PREREQ(2, 10) > /* Gets system memory stat's XML format. */ > ret = malloc_info(0, fp); > +#endif > +#else > + RTE_LOG(DEBUG, EAL, "Error: malloc_info not supported by libc\n"); > + fclose(fp); > + return -1; > +#endif > > I will send out a v6 if the above solution is fine. > > > > > > > > > > > 1. /sysmem/sys_heap_list > > > The commands displays the arenas currently in use. > > > Example: > > > --> /sysmem/sys_heap_list > > > {"/sysmem/sys_heap_list": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]} > > > > > > > I am unsure about the command names. > > > > Those commands are really low level and tied to glibc malloc. > > It is unlikely we will have an unified naming with other libc/OS. > > > > I would prefer another pair of eyes, especially on this patch. > > Dmitry, Anatoly? I agree with David. Microsoft CRT provides completely different statistics. I can't say for FreeBSD. Even if GNU libc is used, the process can be run with jemalloc, for example, and this statistics become meaningless then. What is "system" memory, anyway? It can be acquired bypassing malloc, it can be hugepages mmap'd without DPDK, etc. What is the task this API must solve? My guess is that monitoring needs to know how much physical memory 1) the process uses and 2) how much it can use, so on Linux this API could be implemented using getrusage() and getrlimit(). I don't think that a fully portable implementation is possible, but at least API will be unified.