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 2CCDCA0C49 for ; Tue, 20 Jul 2021 12:07:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED6D040E0F; Tue, 20 Jul 2021 12:07:45 +0200 (CEST) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by mails.dpdk.org (Postfix) with ESMTP id 9475340689 for ; Tue, 20 Jul 2021 11:29:11 +0200 (CEST) Received: by mail-lj1-f182.google.com with SMTP id t3so78766ljc.3 for ; Tue, 20 Jul 2021 02:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=3kG3GvRm8fedE0FALMVpdilvQqx8vU5ACvcC75bWshc=; b=Ll7xIwglUmIaAWvJuzEFDaDD0jlcIDB8WWsfHsPsfsZsYdK0Mljh0/NB8xvVrRdNwJ /gkCmA0QHTrEwMCu4IrCFV3GlLJR6gZI1APYSQ2O9Plmz5crGnO95zb60543fEazU1j1 trlCtwKoUsBJp24sOLrWkekpnBgVRsVnepWU4mE/0gc+m6RNBbMLqY0T1eFArJo7inwM pU9GMdKw37+TWM3FpmqhvZjByWOoIr2yaGUEEYyI891/75mfPi7a4K3c3uoIqLmrZoOk Xif2qdwCumAFKMxp0/Le9zCMIWtFoCc3YTnVPAar70x2oxzBax9/Z0Pi0C0UFMTeM8Pl hWXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3kG3GvRm8fedE0FALMVpdilvQqx8vU5ACvcC75bWshc=; b=JYeHI1awd20OZNPWHvxwkjmq/jLjkEy4ICVRKI9KmgPz1abNrx8eOHbWlb7Wn1bA2s om0iKEOutITzcekDdgZarVw+Q3l/v+4FgJZC+CtWF0+HwEzWsdlV4nK4SzrSYG/+0GKS z3JjTGKp82fyjQoxWgnMovFZwWrJ1pfz/Rf6XRELeSbHWt+duTVy/8eatKx6WQGdhTJV /XwFjexSl2593p+DuMZPfEQ4VQjKixZIBxLiyDmVpYvs/Y1a9BwrcikKOHEJ+e+Yfvei eL9AwM2sC5Vr0vhzy5HKN8nmVCzoDAPYUkAsGT27DK8TofR6C361eyXbNmyr/729Amf9 qpKw== X-Gm-Message-State: AOAM533xEApK+J7uk0zAa3MnKleqYVEBleCw4SEhoBzfJCXzMP+a+1I1 KsEk9rEnFALOqr5D5uK1gutKY0kogPCEJ4WRW0m11KZM3zm6b+cw X-Google-Smtp-Source: ABdhPJyGw1ryYO/ltTfuhThFEar5d8Gru2LgbXxKXOn2MR2skQJcWajx4gVTQzSuU9uq1MWj5zUL7rWLKAQGhpbWBls= X-Received: by 2002:a2e:934b:: with SMTP id m11mr26352258ljh.284.1626773350826; Tue, 20 Jul 2021 02:29:10 -0700 (PDT) MIME-Version: 1.0 From: Fengkai Sun Date: Tue, 20 Jul 2021 17:28:59 +0800 Message-ID: To: users@dpdk.org X-Mailman-Approved-At: Tue, 20 Jul 2021 12:07:42 +0200 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-users] Secondary process cannot call functions on hugepages X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi list, Recently I read about the multi-process support of dpdk and found the feature of keeping the hugepage mappings between primary and secondary processes very interesting. Therefore, I made the following experiments: 1. I modify the glibc to make dlopen() map shared libraries on hugepages. This is done by changing the underlying mapping strategy from mmap to pread. 2. I allocate a continuous address by rte_malloc(), and instruct dlopen() to map a shared library there, let's call it lib1.so. 3. After dlopen() succeeds, I use dlsym() in the primary process to locate the global variables and functions in lib1.so, and it turns out they are correctly mapped and functions can be called without a problem. 4. Because hugepage seems to get away with the effect of ASLR, I record the address of those global variables and functions in lib1.so, and verify them in the secondary process. The secondary can access the global variables at the same address, but when it tries to call the function, a segfault occurs. 5. I try to use dlopen() with the same arguments as the primary process in the secondary process, but it just gives a segfault. Unfortunately, gdb also gives a segfault when the program starts up, so I cannot give some useful debug info. My question is, does dpdk permit functions to be loaded on hugepages and be called by multiple functions? Though the two processes see the exact same content on the hugepage, the secondary just cannot call the function on it. Any intuitive advice is appreciated. -- Best, Fengkai