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 668E8A04B5; Tue, 12 Jan 2021 11:30:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54196140E4E; Tue, 12 Jan 2021 11:30:14 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 6FBC9140E57 for ; Tue, 12 Jan 2021 11:30:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610447413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=k9rsk190owTe21V43n6DsvOscZBWbum+pQkNRQoO9c8=; b=CArPbnF3PLNLkXCbDe8w0JA6VTLO/uRvRnITTq4TrthHdPnWX7qlP95bazEw+EUwaqAd11 c9qSVn+14wZ8ORLOkWolPHT5YEUNp+IQe3BP/8dgp+4c6oLyKG3E9Ms2rOXc0/+yRYk+fp 4rIciAJAbQQYfTU1snOxv40gMxc/yHg= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-uPOnG_eRM9GWwF3TwzDeRQ-1; Tue, 12 Jan 2021 05:30:11 -0500 X-MC-Unique: uPOnG_eRM9GWwF3TwzDeRQ-1 Received: by mail-ua1-f70.google.com with SMTP id y16so317090ual.22 for ; Tue, 12 Jan 2021 02:30:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k9rsk190owTe21V43n6DsvOscZBWbum+pQkNRQoO9c8=; b=UfQoAyTbUp4unFieA0K8h6Uh0l0SnfCgQdHK7xrwzAudRfWo2fiZ+cObuaE/L4d8jl VayHg7hJhfXbCwfaxmtVLYzbyUyesTH7ZboqmLj/ax4f4yFCEv99h7sV0mzWDGuufan4 0YKzu5G80so1y2G6Uaw7hZwqjDJRFelmv1eY76bKjVXdQmlUyHcLpnKn8nY86lJ13zL6 px/Lo6HrWa/53HdziKBj0eYucvvnT9kJYs+Zzv6fzcDOgXbQRYwn/7y1rY99PikS8NRq WBX0A2b9FILofvlXDmbW3x9hXEJA1A2Ks9y5t9bI96EwnWq9njWGIiNZuAD9aEkx+5dH LGxA== X-Gm-Message-State: AOAM532OvmOfAljfn5w3LA+C2g8FK8qaynsSes+YVVXNCdgkZl+Uuwsl 5O2Ql6ZggFkNGDLN8+XNOmjtvsfmYbIbTcP5/vgj96rbZRD5ghoHU5DL3DWMVYkZlPtIwkxJfdj he1siAlBPeg8JYJHhq4M= X-Received: by 2002:a1f:dac7:: with SMTP id r190mr3351338vkg.22.1610447411081; Tue, 12 Jan 2021 02:30:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXEwh8DqlURFPCCO4AwR+Xh5NutkphoE9vNMI1kZGOnS0fmD1NypV1tytUOq9ThHojkOoBMLztj0oPuf53IBQ= X-Received: by 2002:a1f:dac7:: with SMTP id r190mr3351328vkg.22.1610447410862; Tue, 12 Jan 2021 02:30:10 -0800 (PST) MIME-Version: 1.0 References: <0ae7d9b2c1ee0e12f8ae7faa2d154c03ae7e0c92.1604935662.git.anatoly.burakov@intel.com> <8f49e252a7be2d8561f4b32193e5800f98c40b0e.1604936860.git.anatoly.burakov@intel.com> In-Reply-To: <8f49e252a7be2d8561f4b32193e5800f98c40b0e.1604936860.git.anatoly.burakov@intel.com> From: David Marchand Date: Tue, 12 Jan 2021 11:29:59 +0100 Message-ID: To: Anatoly Burakov Cc: dev , Damjan Marion Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 21.02 v2] mem: don't warn about base addr if not requested 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" On Mon, Nov 9, 2020 at 4:48 PM Anatoly Burakov wrote: > > Any EAL memory allocation often goes through eal_get_virtual_area() > function, which will print a warning whenever the resulting allocation > didn't match the specified address requirements. This is useful for > when we have requested a specific base virtual address, to let the user > know that the mapping has deviated from that address. > > However, on Linux, we also have a default base address that's there to > ensure better chances of successful secondary process initialization, > as well as higher likelihood of the virtual areas to fit inside the > IOMMU address width. Because of this default base address, there are > warnings printed even when no base address was explicitly requested, > which can be confusing to the user. > > Emit this warning with debug level unless base address was explicitly > requested by the user. > > Cc: Damjan Marion > > Signed-off-by: Anatoly Burakov > --- > > Notes: > v2: > - Fix the condition to not update the address incorrectly > - Instead of removing the warning, let it have debug level unless base address > was explicitly specified by the user > > I'm not entirely sure the trade off between user confusion and helpful debug > information is worth it, but in my experience, i've stopped getting any emails > about secondary processes a long time ago and this isn't a widely used feature, > so i believe this is worth it. > > lib/librte_eal/common/eal_common_memory.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c > index 33917fa835..1b50c2099d 100644 > --- a/lib/librte_eal/common/eal_common_memory.c > +++ b/lib/librte_eal/common/eal_common_memory.c > @@ -140,9 +140,19 @@ eal_get_virtual_area(void *requested_addr, size_t *size, > return NULL; > } else if (requested_addr != NULL && addr_is_hint && > aligned_addr != requested_addr) { > - RTE_LOG(WARNING, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", > - requested_addr, aligned_addr); > - RTE_LOG(WARNING, EAL, " This may cause issues with mapping memory into secondary processes\n"); > + /* > + * demote this warning to debug if we did not explicitly request > + * a base virtual address. > + */ > + if (internal_conf->base_virtaddr != 0) { > + RTE_LOG(WARNING, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", > + requested_addr, aligned_addr); > + RTE_LOG(WARNING, EAL, " This may cause issues with mapping memory into secondary processes\n"); > + } else { > + RTE_LOG(DEBUG, EAL, "WARNING! Base virtual address hint (%p != %p) not respected!\n", > + requested_addr, aligned_addr); > + RTE_LOG(DEBUG, EAL, " This may cause issues with mapping memory into secondary processes\n"); > + } > } else if (next_baseaddr != NULL) { > next_baseaddr = RTE_PTR_ADD(aligned_addr, *size); > } > -- > 2.17.1 > EAL options like --in-memory or --no-shconf makes MP unusable. If we add a rte_mp_disable() for them, we could check here for MP status here and display nothing at all. WDYT? -- David Marchand