From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 3946E23B for ; Sun, 6 May 2018 05:51:53 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9F5D521BEC; Sat, 5 May 2018 23:51:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 05 May 2018 23:51:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=rVG8D+d4akrQd2ip7mbufONCjjtHMAAEDqkO1xZx3XE=; b=LG0F48gt WiBqZ2z5rxPznxKcx8EOUs5JjGrnYSGGzlIjIt+EPCmFlS2uXE3YGzKqaxFDn2Gk fX82nDg01w9sql98csaAP0gTI6w21qQ0pa7aoHcAS5WSlpN61S1qZQpUWaARWBRP ZQ9KjX8P8CFvSkxe3tyLIYyzJDL8AtwA/iAfiKOP0uxAotu0PP2yPZxamqFc28t1 vmwJH/qLcWtsCSK26JxbwrPjoiRMSF7tU8QNo/b3R+uZGLBBNAlkXmdGpiWPbhnG oM/g4cJb1bXU58i0Wuq6s1xI/E3qGcP7xkz6tyfKusnfcs+q2xMso2f/518Uiiq+ 2CqI1xxGbM9VRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=rVG8D+d4akrQd2ip7mbufONCjjtHM AAEDqkO1xZx3XE=; b=a7KtUQuD4hEaiYdVml/53A0RDekgwnguN0Uvhz07McyGc 5sjvZi3e/xkE01WJK2cswOO5neYiSLRoQQF0IvBgGYTCN1sch4FOvmNrKLCSjhYB weEHZnvAwa3lwSFvr9Io9BTllmnAVJAM1gl4cHg0vxczSCgDPy7WtIzyG3gmDJLB dCrvOdlV5KXWgLk9zpV4Cw3Xlht6nIEC8EAZLsEIIp+MemoG5uDyw/CsXCMrVM7d /yiWbIZYIx/nMRaZL0ioZJbyNNeDZu1n2bpWwbX6Yuga8v292LTwtkW0m7nkltpI AlH/LHcbYWzVVNbTC92QLOUeNtD12rCG2H2eaDmvw== X-ME-Sender: Received: from yuanhanliu-NB0 (unknown [223.74.148.102]) by mail.messagingengine.com (Postfix) with ESMTPA id C02F6E50C0; Sat, 5 May 2018 23:51:51 -0400 (EDT) Date: Sun, 6 May 2018 11:51:23 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: Jianfeng Tan , dpdk stable Message-ID: <20180506035123.nl52slupnjm4ufz4@yuanhanliu-NB0.tencent.com> References: <20180422150949.17523-1-yliu@fridaylinux.org> <20180422150949.17523-36-yliu@fridaylinux.org> <6d78c0cd-08b1-2b57-ad96-b0b7a0d7063b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d78c0cd-08b1-2b57-ad96-b0b7a0d7063b@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-stable] patch 'vhost: avoid concurrency when logging dirty pages' has been queued to LTS release 17.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2018 03:51:53 -0000 On Mon, Apr 23, 2018 at 11:03:22AM +0200, Maxime Coquelin wrote: > Hi Yuanhan, > > On 04/22/2018 05:09 PM, Yuanhan Liu wrote: > > Hi, > > > > FYI, your patch has been queued to LTS release 17.11.2 > > > > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. > > It will be pushed if I get no objections before 04/29/18. So please > > shout if anyone has objections. > > Please don't pick this patch, it cause a regression with multiqueue, > I posted a revert of the patch on list last week. Hi Maxime, Thank you for letting me know. I have now dropped it. --yliu > > I'm working on an alternative solution, but while it is ready, better to > keep performance penalty from initial patch. > > > Thanks, > Maxime > > Thanks. > > > > --yliu > > > > --- > > From acdf634b3533a5ccb1528ee546ac9dcfb57b8a36 Mon Sep 17 00:00:00 2001 > > From: Maxime Coquelin > > Date: Wed, 21 Mar 2018 16:44:13 +0100 > > Subject: [PATCH] vhost: avoid concurrency when logging dirty pages > > > > [ upstream commit 394313fff39d0f994325c47f7eab39daf5dc9e11 ] > > > > This patch aims at fixing a migration performance regression > > faced since atomic operation is used to log pages as dirty when > > doing live migration. > > > > Instead of setting a single bit by doing an atomic read-modify-write > > operation to log a page as dirty, this patch write 0xFF to the > > corresponding byte, and so logs 8 page as dirty. > > > > The advantage is that it avoids concurrent atomic operations by > > multiple PMD threads, the drawback is that some clean pages are > > marked as dirty and so are transferred twice. > > > > Fixes: 897f13a1f726 ("vhost: make page logging atomic") > > > > Signed-off-by: Maxime Coquelin > > Reviewed-by: Jianfeng Tan > > --- > > lib/librte_vhost/vhost.h | 12 ++++-------- > > 1 file changed, 4 insertions(+), 8 deletions(-) > > > > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h > > index c8f2a8176..5c488fa57 100644 > > --- a/lib/librte_vhost/vhost.h > > +++ b/lib/librte_vhost/vhost.h > > @@ -261,18 +261,14 @@ struct virtio_net { > > #define VHOST_LOG_PAGE 4096 > > /* > > - * Atomically set a bit in memory. > > + * Mark all pages belonging to the same dirty log bitmap byte > > + * as dirty. The goal is to avoid concurrency between different > > + * threads doing atomic read-modify-writes on the same byte. > > */ > > static __rte_always_inline void > > -vhost_set_bit(unsigned int nr, volatile uint8_t *addr) > > -{ > > - __sync_fetch_and_or_8(addr, (1U << nr)); > > -} > > - > > -static __rte_always_inline void > > vhost_log_page(uint8_t *log_base, uint64_t page) > > { > > - vhost_set_bit(page % 8, &log_base[page / 8]); > > + log_base[page / 8] = 0xff; > > } > > static __rte_always_inline void > >