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 BD9A042575; Tue, 12 Sep 2023 04:45:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4950D402AC; Tue, 12 Sep 2023 04:45:02 +0200 (CEST) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by mails.dpdk.org (Postfix) with ESMTP id B3FE6402A3 for ; Tue, 12 Sep 2023 04:45:01 +0200 (CEST) Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-411ff285950so11006071cf.1 for ; Mon, 11 Sep 2023 19:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1694486701; x=1695091501; darn=dpdk.org; 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=OYa9zWcd+kWunTaH2AkMFSziD6JXonJ4fVyK22/aEt0=; b=XcZxH9L9R7ZM6/U3HWjfCzE7GmE52TJp4dTELAmuAHjM6bT3VJeLkwm1ubsx2d8tnq olnP6HwOVKu7ghkNAEVJkmDbUpYFHHDb0jj5BcehJw9OL04v2MfMe569tLmEgqriuNlV LO19WWWTgp8qCTm5wzUeBAclEPT18Pk7NtKCWIhdnbtkStO6OdcS+mvw21I6sNrxulAE a00lImXz99bU3/hu21WSbQlWctnch3FSc/M5sFiUM2jDRgqu0WKclsIYVZmSN4JLrumc b0FlngsPNpRYeM5DTDmt+/tLlFK88f+3PbQfkjZjlZ6xKZAYIit/YSi5Upkc9JV3h5Pc ppNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694486701; x=1695091501; 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=OYa9zWcd+kWunTaH2AkMFSziD6JXonJ4fVyK22/aEt0=; b=lQTBToiRuwshnYosvUaZ98ATwib7JseJV3PK0Dn+FPi4XdOtyHw9W9VRgI8huK204k MV2IFKA/dLOmBE6EXaakdgzhExt7e7R0CaKMDIuyTXRzSq/FxvHHl1zhx1X0O2KIp6wx sI6Q8MUE2lLnWYedDWJXq26hD4y5t96tUzl8Q5SvPgJi+MiwAKefTfgFRcEJVO4V+31t BxY2gl4Q5NY5zdD/9x0wr6OCkHGGTQbPkNK0QI54B2NQYLdKNq5k8izkSIaQLTn97k4/ ipLm9o0q2AKsXGEJANybLKZfq+Lf7gFbWt+3HG5QLlUNYtJSdpKkciziClYzggPz3O/R lNvw== X-Gm-Message-State: AOJu0YwJpP2cepE5fp81oU+LlJFcYp1kLN351+DiJAqEnDwn0CI8sj0s BJyxEnekT2hxrehA4AdDVkaRrs/Hx4zTC9ThuKXsAg== X-Google-Smtp-Source: AGHT+IG/P4lrnzGhxMhbChUda4BfvQz943fQ4oCpYn67MTlLO5iHtYLvnD72a3WDVyy+Kz/+9CaUyX7IIji5lgwsV8o= X-Received: by 2002:a05:622a:1a18:b0:412:2dd3:e0ed with SMTP id f24-20020a05622a1a1800b004122dd3e0edmr11122363qtb.0.1694486700972; Mon, 11 Sep 2023 19:45:00 -0700 (PDT) MIME-Version: 1.0 References: <20230831111937.60975-1-changfengnan@bytedance.com> <20230906080819.689bcb8d@hermes.local> In-Reply-To: <20230906080819.689bcb8d@hermes.local> From: Fengnan Chang Date: Tue, 12 Sep 2023 10:44:50 +0800 Message-ID: Subject: Re: [External] Re: [RFC PATCH] move memset out of hold lock when rte_free To: Stephen Hemminger Cc: anatoly.burakov@intel.com, dev@dpdk.org, dkozlyuk@nvidia.com 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 This patch still have problem, I'll fix next version. Stephen Hemminger =E4=BA=8E2023=E5=B9=B49=E6= =9C=886=E6=97=A5=E5=91=A8=E4=B8=89 23:08=E5=86=99=E9=81=93=EF=BC=9A > > On Thu, 31 Aug 2023 19:19:37 +0800 > Fengnan Chang wrote: > > > +#ifndef RTE_MALLOC_DEBUG > > + if (internal_conf->legacy_mem) { > > + /* If orig_elem is dirty, the joint element is clean, we = need do memset now */ > > + if (elem->orig_elem->dirty && !elem->dirty) > > + memset(ptr, 0, data_len); > > + } else if (!elem->dirty) { > > + memset(ptr, 0, data_len); > > + } > > +#else > > + /* Always poison the memory in debug mode. */ > > + memset(ptr, MALLOC_POISON, data_len); > > +#endif > > The code reads better if positive clause was first. Got it, I'll do as you suggest in next version. > I.e. > > #ifdef RTE_MALLOC_DEBUG > /* Always poison the memory in debug mode. */ > memset(ptr, MALLOC_POISON, data_len); > #else > ...