Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1864530rwr; Fri, 21 Apr 2023 00:13:35 -0700 (PDT) X-Google-Smtp-Source: AKy350a2jp7xJgDyUN9Bx7lIvBfZQljEhx7jiIS8e5llMoQn5F7yB07lH+GbvmihQ1T+sIeQThNY X-Received: by 2002:a05:6a20:c901:b0:cc:a5d4:c334 with SMTP id gx1-20020a056a20c90100b000cca5d4c334mr5225075pzb.10.1682061214912; Fri, 21 Apr 2023 00:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682061214; cv=none; d=google.com; s=arc-20160816; b=a0IDY5DT8UekhxzoCVpuTENtrjxLV3URY79ExzAaJvP9m6pDWXOgGMlQRQT6J959c7 32pbFy6V7tFynw79f7yLduLm7RKwSHIpqH4qgdPM/Y8a8DaH+2lYoXIR2ypN3NKi04M3 hEo9Nyb4CI4Cp3xO27psWQPd0Sjb5EJUepK/AgvKZEpl64tlKpok33Aj+QE/5DCNPAvO a/PsKCIaInxE0TaXuIQVSBU2TnbGb3JIsTmh6U3IaylalTWnEQvjDhEi3FYOvtHF0lIC /ADBTryQV5KtUwufRo+i/Y23pY7fPdue8cmItCzVRY2HT47FFdwoDt2UnXZ90Jvx5qPt PLrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YvNqSawyJ3nJ/vCXn5tWx+RQcufZPyD2kLszhPcCGec=; b=iEKuD32u5UfsmoK5Omf5ZyFoV6xmLXGII/L9FwEJo25VUnMsF8MZMd3QspEs2P6vDp 3LsqKZNxX23uIs/4w1Z58DVzRkM2P24+gnMGLpPLTfsD7lPc0ZknGszeoRigmKcvi0Sm +Q506Sy3s0dw22pjHc5ufahOqLgvuDaiHIYrpNA9nuwyztGgAcnsIjmjBP2stTAy11TQ jPYwa1JUYHF89fsalnJboRfRNbp3jPeXIkSc7GL1Yp8swMfUz/S/hhUIermDF1JjjKrn xaJYE9sSQXvdtIU79nj2jUphovx/yHvZKCAor2Ki0ACKKFJ4Vw3bSVY4g16OFIBN/MjV 96BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dQaSVH4J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a634954000000b0051b4f4a2032si3615612pgk.599.2023.04.21.00.13.20; Fri, 21 Apr 2023 00:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dQaSVH4J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbjDUHJz (ORCPT + 99 others); Fri, 21 Apr 2023 03:09:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjDUHJy (ORCPT ); Fri, 21 Apr 2023 03:09:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A833D1BD6 for ; Fri, 21 Apr 2023 00:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682060952; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YvNqSawyJ3nJ/vCXn5tWx+RQcufZPyD2kLszhPcCGec=; b=dQaSVH4JFlQNFv6Lk8FuUxE5LQDZqueuai/Ow1Qpipj4idA5Vxr/zhfRRGaWx1cIgj+0La oyCIXFPQYrBODLRRQ6kWlgBjQPGhV7UyOOngYHhnjzNf9rt3daZb0Lad46oLbZ6O2yDHuc WWsoIncHaAVXE11RuIEALXmJ+tUb8G0= Received: from mail-oa1-f69.google.com (mail-oa1-f69.google.com [209.85.160.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-487-QAh_RlKmNjCn4q4hONujAA-1; Fri, 21 Apr 2023 03:09:11 -0400 X-MC-Unique: QAh_RlKmNjCn4q4hONujAA-1 Received: by mail-oa1-f69.google.com with SMTP id 586e51a60fabf-1878c453f6fso1338498fac.2 for ; Fri, 21 Apr 2023 00:09:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682060951; x=1684652951; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YvNqSawyJ3nJ/vCXn5tWx+RQcufZPyD2kLszhPcCGec=; b=Uc4buAoMRLZKdRkhyZEoY9z36rK2dWLM/9QHPuRevi6kEHm50LxA84MTo8fjEKzeoS NySHfM/6fDV1P1vP+5ES+KNpn50wNPY6r98HMi84aHzq08v2kZyxSQu0AyGsWx2MOUHM G8PQJfZ53609TVzf/W3RGTav0UTlAiItWJ3QbWjvuvLfefZwCc4RGE9ctqrEx2N9jsh+ W3TzzDXaryZ5GC3llp+MTBggiR73BRF7Vprys46nz+C224fwtYsOUOELXixOsPyC07Ja xGkQazUjq/UxFKJvpeHQAHeonvttDpf0Ef+zUnXqbO3XdZniQgp3hRwLtUwoDkhpp/WR 26kA== X-Gm-Message-State: AAQBX9ch9eMjre9c2SvOXeCd3TNsYwo5rCWNw8XxDun3xcUMMXQQsbRd O3ELA2+3KZYqqiHTcInQbvkRVQiW5Sfns8qQ9Qt86QS3bF46Nz8JRhq2RTYmUV95zYdJeV664UQ eUeo+YxjkXimmH5NR9jwWK+xDmRPZVJCrG2qQthm7 X-Received: by 2002:a05:6870:428e:b0:177:b62d:cc1c with SMTP id y14-20020a056870428e00b00177b62dcc1cmr3330130oah.0.1682060950843; Fri, 21 Apr 2023 00:09:10 -0700 (PDT) X-Received: by 2002:a05:6870:428e:b0:177:b62d:cc1c with SMTP id y14-20020a056870428e00b00177b62dcc1cmr3330122oah.0.1682060950649; Fri, 21 Apr 2023 00:09:10 -0700 (PDT) MIME-Version: 1.0 References: <20230419134329.346825-1-maxime.coquelin@redhat.com> In-Reply-To: From: Jason Wang Date: Fri, 21 Apr 2023 15:08:59 +0800 Message-ID: Subject: Re: [RFC 0/2] vduse: add support for networking devices To: Peter Xu Cc: Maxime Coquelin , xieyongji@bytedance.com, mst@redhat.com, david.marchand@redhat.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, xuanzhuo@linux.alibaba.com, eperezma@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 21, 2023 at 2:39=E2=80=AFAM Peter Xu wrote: > > On Thu, Apr 20, 2023 at 12:34:06PM +0800, Jason Wang wrote: > > > 3. Coredump: > > > In order to be able to perform post-mortem analysis, DPDK > > > Vhost library marks pages used for vrings and descriptors > > > buffers as MADV_DODUMP using madvise(). However with > > > VDUSE it fails with -EINVAL. My understanding is that we > > > set VM_DONTEXPAND flag to the VMAs and madvise's > > > MADV_DODUMP fails if it is present. I'm not sure to > > > understand why madvise would prevent MADV_DODUMP if > > > VM_DONTEXPAND is set. Any thoughts? > > > > Adding Peter who may know the answer. > > I don't.. but I had a quick look, it seems that VM_DONTEXPAND was kind of > reused (and I'm not sure whether it's an abuse or not so far..) to > represent device driver pages since removal of VM_RESERVED: Interesting, but there're indeed cases where VM_DONTEXPAND is used by non-driver codes. The pages mapped by VDUSE are not device driver pages but the IOTLB and virtqueue. Btw the definition of VM_SPECIAL doesn't say anything related to dump: /* * Special vmas that are non-mergable, non-mlock()able. */ #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP | VM_MIXEDMAP) > > https://lore.kernel.org/all/20120731103457.20182.88454.stgit@zurg/ > https://lore.kernel.org/all/20120731103503.20182.94365.stgit@zurg/ > > But I think that change at least breaks hugetlb once so there's the > explicit hugetlb check to recover that behavior back: > > https://lore.kernel.org/all/20180930054629.29150-1-daniel@linux.ibm.com/ This seems similar to the case of VDUSE. Thanks > > Thanks, > > -- > Peter Xu >