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 2050A41CA9; Thu, 16 Feb 2023 03:54:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE59640A8B; Thu, 16 Feb 2023 03:54:47 +0100 (CET) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by mails.dpdk.org (Postfix) with ESMTP id E185D40695 for ; Thu, 16 Feb 2023 03:54:46 +0100 (CET) Received: by mail-qk1-f172.google.com with SMTP id y10so237521qkm.3 for ; Wed, 15 Feb 2023 18:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1lYm1mbooSKSR3pVuHRe4e7B75QwkckimxAxtuc+3nM=; b=Caq7moKsTSdNAKkRlyxmQ1JBi0obQhmP7ASIuZeCz6EdDytdT6dGa1C23rok1qFYZm Cd+8NSIC6r00ve0B2zlEhL2EZ/jvp7hVGLmEW59MU1OmZXzyl8v/ixRdJbeLSpU6ziaV op4XQE/DRj0S1L0dQOltwH7htUt1fE2WoLg3yf9b2cL9zqWzJD46rP2pPkzrK4TX9wW8 xgpkwwDIvzjSjoGPPVhjlJc/rycCYzHPauENeWq5eia3FmXJJPOFfXuwuDalwHszw66D UB8YNJldjWsD96BbiVuTlG2CfvInfznEktX2nYfn7xawIuQsvHw5GwlToFE60QNKkDOS XZ1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1lYm1mbooSKSR3pVuHRe4e7B75QwkckimxAxtuc+3nM=; b=oACP9w9ExMi83yb0fA18DIdG42Jrc5L3P1s8edftlM83nplG9JOOPDXp8zx8RH7/1A UctYqCB+IsUtHARURhsPkEFoiQnRJEVGpcn8D91LcrC4O81a2Fd2SBGhYcunTpkdRPB5 8z3Jt4qPzIMd7XKoV/RcKNrMhqrMHl/ActrYpU0s/hZSz1ae7elYojLLGGKgLlBQKx5D cTqz0/kYjKAa0M0jl8kY+bZuac6yR8aF0xSgiLvooJHiBPbB046FF1s1UqCVcPfQGd71 Wep8sq+XLVlSp8Anow6NFOcZq4Q5F2IAtdKYkuGqycpishjRjD1mXC764E5DM15k711V 2GKw== X-Gm-Message-State: AO0yUKX4nSrSflWaaEdcZYNTcTQnU8bMgHFzTZSw+DIxhUFco2ISkURG N+D1ChTWyOxm5CgIKb60FrCRANjfg3P50humbRF4FA== X-Google-Smtp-Source: AK7set+n1PWpr11CjzYEq283/wu+SPh7aSoJlQt9TTkcNnu10HTWa+7TGb/ptWX9PBHSTw7gqqlMMj+e/aCatRGDEbw= X-Received: by 2002:a05:620a:4f2:b0:73b:6d03:fb3e with SMTP id b18-20020a05620a04f200b0073b6d03fb3emr173330qkh.398.1676516086279; Wed, 15 Feb 2023 18:54:46 -0800 (PST) MIME-Version: 1.0 References: <20230210063022.52171-1-changfengnan@bytedance.com> <2134819.GUh0CODmnK@thomas> <98CBD80474FA8B44BF855DF32C47DC35D8773F@smartserver.smartshare.dk> <20230215091616.1217c509@hermes.local> In-Reply-To: <20230215091616.1217c509@hermes.local> From: Fengnan Chang Date: Thu, 16 Feb 2023 10:54:35 +0800 Message-ID: Subject: Re: [External] Re: [PATCH] malloc: fix malloc performance may becomes worse as the number of malloc increases To: Stephen Hemminger Cc: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Thomas Monjalon , anatoly.burakov@intel.com, dev@dpdk.org, rsanford@akamai.com, bruce.richardson@intel.com, maxime.coquelin@redhat.com, david.marchand@redhat.com, jerinj@marvell.com, honnappa.nagarahalli@arm.com, Fidaullah Noonari Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Stephen Hemminger =E4=BA=8E2023=E5=B9=B42=E6= =9C=8816=E6=97=A5=E5=91=A8=E5=9B=9B 01:16=E5=86=99=E9=81=93=EF=BC=9A > > On Wed, 15 Feb 2023 12:10:23 +0100 > Morten Br=C3=B8rup wrote: > > > Looking isolated at the patch itself... > > > > I agree with the way the patch modifies the ranges of the free list, an= d the consequential removal of the "- 1" from the calculation of log2. > > > > Intuitively, the lists should cover ranges such as [0x100..0x3FF], whic= h this patch does, not [0x101..0x400], how it was previously... The ranges = with this patch make much more sense. > > > > So if the existing code is otherwise correct, i.e. handles the size wit= h/without MALLOC_ELEM_HEADER_LEN correctly, my gut feeling says this patch = is an improvement. > > > > Acked-by: Morten Br=C3=B8rup > > It would be good to have a malloc performance test. > Possibly something reused from some other project. I have done some performance tests in SPDK before=EF=BC=8Cmaybe available f= or your reference: https://bytedance.feishu.cn/wiki/wikcnKWXQmN4qhyxLcWJqP4vrOs In one word, the performance of 4k malloc has improved, and other cases almost the same.