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 8B0D1A034F; Mon, 11 Oct 2021 21:38:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 11B97410FA; Mon, 11 Oct 2021 21:38:43 +0200 (CEST) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mails.dpdk.org (Postfix) with ESMTP id 0763140E0F for ; Mon, 11 Oct 2021 21:38:41 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id y26so78707709lfa.11 for ; Mon, 11 Oct 2021 12:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LS+rNP6iN+bcFzlWesb9VDestNidzfbBHq8zRdKTN4c=; b=cT0Bzc16OlcGOlBx4bUwn22UKyKp+pbIhWv3u/wDN7beR1XNaJ2p2u00zsn6boCfPJ v/rc2aFtTwwh1J2S8M6t9orXoTqoxc9LU1/cTnmaOfOPFeiDvBq3clIgtWEMeA61PBWi Em+cNSvuRmUEEMcY1iWPUGmVIvhlhtTBqbDVkNU2EVARBr1M+KC3ztJTNAB7p4JU//R5 5CS2K7vNC/r/gsRRibrYJHNa7KpZzpqwm1iUjW9fhcvatgFBo2EPnykjvDQF4TDinRLq 8h3EzF6+1eusA3ekdPF7FTUrAdXLXMLASGH3O7cL6qubI4OsOERzmwbsafxNratjDqzA 7S5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LS+rNP6iN+bcFzlWesb9VDestNidzfbBHq8zRdKTN4c=; b=EuNIhIMnoNGOdNvQkAIUCGOi1DU83xK1EGBcogUG1iySAobaXUKcUOWzZ0lcZol5Uj FdXrUohOkC5XeCO17oG1IC+6KImqKUEZ3FAmYskMJUMyQZdtUKRsYPm8S4sOc3njkVFW 8k3QVsWUG53a4XYwHrIC2m03F2dNc2CIGIhVTGxMj+RDnCYY/eYwMTgWA7gqDJyKV/nk o+Hcc4GfjHZzCJtxoRVd8MZGLl3lYxxjjHIE+M/t+lrko8ZZrwsHDyggKIMgqeuNT7np sI5v7mF86NoiLn1A0KMGwd7apuWXj9/ZV65FFIabYp3fCEOzyK2tDNHPVFKnOspq5s+c +jWw== X-Gm-Message-State: AOAM5329bwebE5UTWpNCTVH4JoqxoOR5o5Q2Exy1AbvQ/IIGRpK3hTjT ZGSzIyinI3x5sYO/qu/KlA0= X-Google-Smtp-Source: ABdhPJwJh7Ui4oix/jWEFQBdQPp8iwrgi+S/UiMPSAfIOKX8inaFV6l6EaptTfO0lW17OJyecwTqoA== X-Received: by 2002:a2e:5019:: with SMTP id e25mr25036678ljb.63.1633981121429; Mon, 11 Oct 2021 12:38:41 -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 q4sm811633lfe.195.2021.10.11.12.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 12:38:41 -0700 (PDT) Date: Mon, 11 Oct 2021 22:38:40 +0300 From: Dmitry Kozlyuk To: Brijesh Singh Cc: dev@dpdk.org Message-ID: <20211011223840.32c95da3@sovereign> In-Reply-To: References: X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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.