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 498F5A034F; Tue, 12 Oct 2021 02:24:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 116324067C; Tue, 12 Oct 2021 02:24:48 +0200 (CEST) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) by mails.dpdk.org (Postfix) with ESMTP id 3817F40151 for ; Tue, 12 Oct 2021 02:24:46 +0200 (CEST) Received: by mail-yb1-f180.google.com with SMTP id n65so42758949ybb.7 for ; Mon, 11 Oct 2021 17:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iHuWvrX7iwL8r3Cj5RrfhSqm8A2tWXkNTZdTcEPEv2A=; b=Z4lNu29dQTxY/4Oio5rx/I6wM3Jo6LjUe/Cg5u14sW9S/m2U8gULtKEOcqjbISkX/R 56iLBYZPCrqO9+dlVYcTyJArmjePiPcw3adeSwe/Iebam5I2qM8MWXfuyG4Y9gnVkm5U YWVUp1KCD20RnZni1y1ukopUs0eIZPBJkcHohJhVozyBzrvNKwtsUk3hptXSYhtVZEMe ERTgGiHLgqFGK9VXGppmMkIgGDuEGkKwkuIrkR60mj3Q8eVRRxLijWhps5pHdA13Cg6m WiyZvIbzTMOC9QnwMPg3PUkky5LKw0NzfpRMyaPF8FtXD5swYVqPlNqwNUcT56L2EiUi UhkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iHuWvrX7iwL8r3Cj5RrfhSqm8A2tWXkNTZdTcEPEv2A=; b=3U7LsISPS7a+T9EKOmAxbZNhCjcQZGhsjpAIKpr643JPrBOsPpnhGILpulu45DL8Tr u2s41su+NSLJFf7eRiR2/L5/7ZgmHdyV4jOerbjiemNhQGeUSbaTx1CysS99WZMoO/nQ +dcghCev+TKZPkue0tfwlCjRJLa6Knrt7HgnjArc8xHLzwfG/SZgVhIKKWDNgJN15/eT YixX/nuV0/fEZYWwXXeJNFVq/V//5qB/y3/4eaIGbvolIp9lyOtp22wVeecipVVInkN6 jbIjeydG9EW9iPSpJJSmsCR3s31BiEvktzB0q0rKAdVRJwbPxW1xldiz0dsV5a6mZa8q JRtQ== X-Gm-Message-State: AOAM531k0r5xCj3O+kXbQln9IW0+USM7GtBIWBMY4VRT0+P7AMokmSXs QFJUUODdEeotW4qzivl04OAUr69YzBZp6V2StQw67yHS X-Google-Smtp-Source: ABdhPJzTTskKuktetLLZicRdOY1Xg2SQ6gVIQkhcNgTaW2iclggoYmjAdhZg3SLvAmWc49FNaQUsYm7s0SoF7Lhhp3Y= X-Received: by 2002:a25:be0c:: with SMTP id h12mr23821937ybk.22.1633998285409; Mon, 11 Oct 2021 17:24:45 -0700 (PDT) MIME-Version: 1.0 References: <20211011223840.32c95da3@sovereign> In-Reply-To: <20211011223840.32c95da3@sovereign> From: Brijesh Singh Date: Mon, 11 Oct 2021 17:24:34 -0700 Message-ID: To: Dmitry Kozlyuk Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] Mmap query 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 Sender: "dev" Hi Dmitry, Thank you for your response. The mystery is that we are not doing mmap anonymous, and ftrace shows high time for clear page. I suspect, the file is being unlinked before being opened. But we haven't been able to trace it yet. Regards, Brijesh On Mon, Oct 11, 2021 at 12:38 PM Dmitry Kozlyuk wrote: > Hi Brijesh, > > 2021-10-11 10:25 (UTC-0700), Brijesh Singh: > > Hi there, > > We are seeing high mmap time for 1G hugepage during eal memalloc init. > Most > > time is spent for clearing page, each 4k size.. > > It's not clear to me why clear huge pages is called? The code mmaps > rte_map > > file with map_populate and map_shared this shouldn't cause page zeroing. > > I am curious to know how zeroing is forced? > > The kernel clears all anonymous memory before handling it to the user > space. > It is done for security: there may be sensitive data left by previous users > of those pages. > > There is a pending patchset that aims to solve your issue: > https://mails.dpdk.org/archives/dev/2021-October/223723.html > Please see commit messages for some more explanations. > > > As an alternative, I would like to memset from userspace. In my > experiment > > we are noticing memset 1G file is faster that clear huge pages. > > Can you share the numbers? From my experiments, mmap() is just a little > longer then memset() of the same amount of memory, apparently because the > kernel has some extra work to set up the mapping. >