Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2663801imm; Sun, 3 Jun 2018 08:41:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ6SE1W5IdCoxHrPhxQta+lzoUfgxKlQOJGwy86vL/7Eqt+yP77wMgBTYEWNSeJvhI+X4Y2 X-Received: by 2002:a65:52cc:: with SMTP id z12-v6mr14488464pgp.126.1528040513899; Sun, 03 Jun 2018 08:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528040513; cv=none; d=google.com; s=arc-20160816; b=RiXlX5zs4Zzg5h6IyF1xMsX9AEEgkCENg5t5rWcAfFyz1JTALoIXve3iGNzQZuChVT NvMYfB3/3TVpRqvInsz1pwC/calrqDK1PPRqRXNEXyxn6HfM4a7a7uWknqofp7DpNKoH xrgczvZ4qoVorZaTmsY6y36nuS3azCgZS0ZSEvJiA/rk8YCFUaW/pPAUIM9UZvkBIZ2R HMMO6zt0Y22gssg/OddpS+SE+8reNIlthhVaguT08YwpHWjEmRsSOXUrBBA0dagxm/pn FSPuSVPazN9eJOFWq4InkdrIkeCQH/ZYoQ7nMrMWJZmyDJ7hDMYliMrkdhW2zOl/6mux 6wTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=JM7JjxeCWwduKVWKQheqeBrYbiv5kBELGmc0GU79VXs=; b=luLhNN2FRsvbCgLJ5iWD+CUdzlSyTboM+uwWfRti0l3Bu0PloA7G0fivxQERZsBs7Y zNaEVxPlk5zPBhODCekiAlLH1oAWjnvl+0Tq6O2PZRHAT454CsWcIIv7dXp5vM0/PW7H w23f0AgJ0U4GgNtElO/jIqe49rdOk+sxmkuuioee1H5c4oKoZs/wY7GNoL9qegzAhiC9 7eNVI3xjrB3gPRPou3ck9QlKlTKBwzim3fBXLcOph7x8JjTDOvcUn4WLAWsVtlZR1vhF qkaD/yUwKnrBgaId1P8Kt5GVgiF25rErCDgkijX37SEvk7up8RNMnFjvGM3aMISXOopO Mr1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5-v6si9127464pgd.653.2018.06.03.08.41.08; Sun, 03 Jun 2018 08:41:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751585AbeFCPkM (ORCPT + 99 others); Sun, 3 Jun 2018 11:40:12 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45738 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751132AbeFCPkL (ORCPT ); Sun, 3 Jun 2018 11:40:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 654E0818A6AB; Sun, 3 Jun 2018 15:40:10 +0000 (UTC) Received: from wei-ubt (dhcp-14-122.nay.redhat.com [10.66.14.122]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 259CD2026DEF; Sun, 3 Jun 2018 15:40:06 +0000 (UTC) Date: Sun, 3 Jun 2018 23:40:04 +0800 From: Wei Xu To: Jason Wang Cc: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jfreimann@redhat.com, tiwei.bie@intel.com Subject: Re: [RFC V5 PATCH 8/8] vhost: event suppression for packed ring Message-ID: <20180603154004.GA24012@wei-ubt> References: <1527559830-8133-1-git-send-email-jasowang@redhat.com> <1527559830-8133-9-git-send-email-jasowang@redhat.com> <20180530114200.GA23792@wei-ubt> <12f2c455-5868-3b07-0eba-d49dcafd10f2@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <12f2c455-5868-3b07-0eba-d49dcafd10f2@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sun, 03 Jun 2018 15:40:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sun, 03 Jun 2018 15:40:10 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'wexu@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 31, 2018 at 11:09:07AM +0800, Jason Wang wrote: > > > On 2018年05月30日 19:42, Wei Xu wrote: > >> /* This actually signals the guest, using eventfd. */ > >> void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq) > >> { > >>@@ -2802,10 +2930,34 @@ static bool vhost_enable_notify_packed(struct vhost_dev *dev, > >> struct vhost_virtqueue *vq) > >> { > >> struct vring_desc_packed *d = vq->desc_packed + vq->avail_idx; > >>- __virtio16 flags; > >>+ __virtio16 flags = RING_EVENT_FLAGS_ENABLE; > >> int ret; > >>- /* FIXME: disable notification through device area */ > >>+ if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) > >>+ return false; > >>+ vq->used_flags &= ~VRING_USED_F_NO_NOTIFY; > >'used_flags' was originally designed for 1.0, why should we pay attetion to it here? > > > >Wei > > It was used to recored whether or not we've disabled notification. Then we > can avoid unnecessary userspace writes or memory barriers. OK, thanks. > > Thanks