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 ABCECA0543; Thu, 22 Sep 2022 11:00:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C4E540156; Thu, 22 Sep 2022 11:00:57 +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 C3674400D7 for ; Thu, 22 Sep 2022 11:00:55 +0200 (CEST) Received: by mail-lf1-f50.google.com with SMTP id o2so13523285lfc.10 for ; Thu, 22 Sep 2022 02:00:55 -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; bh=jm+C6eGo1rew9BFQZdEy7kNIeDL24lvZgfAxmnQQ4s4=; b=U9+fh6efI1Gc0e+Q0C/fu4LGJJmBZfFWNWKZEQJhuW4JpBs9VAG3Nh9eGPXazCNCuy 8x4Q1Z9xtqz3CSqN5ncGRLTx6jmP6N9BNTXejjo49yAv1T5M4+aZ0TyaRfQZWQpirqMI oqk1t5eDK2Y7iIjFYylH0XJysTF3VpROb4MKXZzlHhE3uge5yFeicAF5+kEYcq4P39Wp 458lzHMhdzZcThMZweejO0USWWMEDWP5x8N4qXdiL5mdp5WOm7igi/7sakj+zuugtp7l C2AuT9edBQQ9hQ34kiYxuhgH6XbEr206RoTa9MGHaJP+ZhisOCbH3z2UIlNqgsuKOnpE MEXg== 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; bh=jm+C6eGo1rew9BFQZdEy7kNIeDL24lvZgfAxmnQQ4s4=; b=NUqlvmFCaEubRdM0DYhmDQ1/4YGYRvMMQEMz/m2p6JaXK6ND5BY7r6WWsppLiHjYpA Pe+Up29K6jieWxM0+CBkQS8CxWxKo6a5Ow4D1PYF3RQ2BNNvDQxETIgc2J/T65yHFfSF rcxI5rEH5kyUTtbGH2btxAB5vz2Pq6JGZaJI43vG6nIFwIgSu5p3+6yY9Sntqj3Zzs/D QUdgMjATZXNM5wo+kzgEZ/si8CXzjxyl8UHEhsWxAiL+KyKu9IDqwDpJxUuPe5D/BrYA LJwiLmUnnaELYYJDAzf0q+pe3w7NEVRuKkvyeFhZZLNE7df7HZiZgV8CU3e9kyzmJ+F8 l8cw== X-Gm-Message-State: ACrzQf14LYbw+TF9g4UnFgVB0+YPcvuKEapzGOZ+53LGBgSs6AWCC56e uYs6JygXAQyLamY9YgwVSSs= X-Google-Smtp-Source: AMsMyM6jvG/R8XWizud06nLOSmLDCKz80EMXLSyxH0LdMbIYIMGCNs1lSsgDoy1ecZyfFnI/AGZ/Sg== X-Received: by 2002:a05:6512:2283:b0:49f:490c:8636 with SMTP id f3-20020a056512228300b0049f490c8636mr829114lfu.273.1663837255149; Thu, 22 Sep 2022 02:00:55 -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 d25-20020ac25459000000b0048af4dc964asm841887lfn.73.2022.09.22.02.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 02:00:54 -0700 (PDT) Date: Thu, 22 Sep 2022 12:00:52 +0300 From: Dmitry Kozlyuk To: "Umakiran Godavarthi (ugodavar)" Cc: "anatoly.burakov@intel.com" , "dev@dpdk.org" , "stephen@networkplumber.org" Subject: Re: DPDK 19.11.5 Legacy Memory Design Query Message-ID: <20220922120052.710c2cd1@sovereign> In-Reply-To: References: 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 Hi Umakiran, > From: Umakiran Godavarthi (ugodavar) > Date: Wednesday, 14 September 2022 at 1:00 PM [...] > 1. Then we go to DPDK Memory segment list walkthrough and for each FBARRAY , we find the used pages by DPDK and unmap the remaining pages by below code (Idea is to free the huge pages taken by DPDK process virtual memory) -> Free_HP will be 0 then, as X pages are used by DPDK and all unnecessary pages are freed in this step) > Sample Code of 4 : > > rte_memseg_list_walk_thread_unsafe(dpdk_find_and_free_unused, NULL); ->DPDK_FIND_AND_FREE_UNUSED is called for each Memory segment list (FBARRAY pointer is derived from MSL like below) > > dpdk_find_and_free_unused(const struct rte_memseg_list *msl, > void *arg UNUSED) > { > Int ms_idx; > arr = (struct rte_fbarray *) &msl->memseg_arr; > > /* > * use size of 2 instead of 1 to find the next free slot but > * not hole. > */ > ms_idx = rte_fbarray_find_next_n_free(arr, 0, 2); > > if (ms_idx >= 0) { > addr = RTE_PTR_ADD(msl->base_va, ms_idx * msl->page_sz); > munmap(addr, RTE_PTR_DIFF(RTE_PTR_ADD(msl->base_va, msl->len), addr)); > } > } You unmap memory, but you do not maintain DPDK memory management structures, that is, DPDK does not know that this page is no longer usable. Probably this is the reason for the crash. You could print regions you're unmapping and the segfault address to confirm.