From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com
 [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id 1559E2E41
 for <dev@dpdk.org>; Mon,  3 Aug 2015 00:07:53 +0200 (CEST)
Received: by wibxm9 with SMTP id xm9so91496371wib.1
 for <dev@dpdk.org>; Sun, 02 Aug 2015 15:07:53 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=uMgWyhrbW8ty+M0+keNyVQ6enz1lcy3ML4qFtCKVKGw=;
 b=f9MIowHkJqTxo6Rs6J5AoSZ8lXOf3DbHTPHmgTWJqcBPCdhoIz2gk0Y2oi8TgrmPrB
 1ZXpxg2ZJ6IRj0z/IB4m70l23orBPfQtpBMol9cI9z3MQf91KUdn8biH0GhDi5A8UeAU
 Jdx5hH3LB84Rnzr6WjyRBjdvE1czaat9JVMEqA5bzeh2MCNmx0i/0ueMqdRjRoTqcgqW
 1TZlnZet+saxyi6LCQYmOPheroZsvRM3AuNW5bn6mveva9cohbb30VdznzOjHFwqgVqY
 4gj8BRIDEUiddYqvHOvZvBrQ0lKE+k0SMgkmf1P/1bCgz9hTiXMSJB8zsN+wBDtG+yb1
 RH8A==
X-Gm-Message-State: ALoCoQkGQ11nNj7K3PBQttoxDbgd79i3CjDywzzY6D9TbSZpvxZTUrEmSv/nVnHuPv+5/FjF6w2h
X-Received: by 10.180.36.3 with SMTP id m3mr28801410wij.60.1438553272787;
 Sun, 02 Aug 2015 15:07:52 -0700 (PDT)
Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136])
 by smtp.gmail.com with ESMTPSA id lq9sm19527211wjb.35.2015.08.02.15.07.51
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 02 Aug 2015 15:07:52 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: rsanford2@gmail.com
Date: Mon, 03 Aug 2015 00:06:38 +0200
Message-ID: <1803527.ArLAiIq7YK@xps13>
Organization: 6WIND
User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; )
In-Reply-To: <1438037168-639-1-git-send-email-rsanford2@gmail.com>
References: <1437691347-58708-1-git-send-email-rsanford2@gmail.com>
 <1438037168-639-1-git-send-email-rsanford2@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 0/3] timer: fix rte_timer_manage and
	improve unit tests
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sun, 02 Aug 2015 22:07:53 -0000

2015-07-27 18:46, rsanford2@gmail.com:
> From: Robert Sanford <rsanford@akamai.com>
> 
> This patchset fixes a bug in timer stress test 2, adds a new stress test
> to expose a race condition bug in API rte_timer_manage(), and then fixes
> the rte_timer_manage() bug.
> 
> Description of rte_timer_manage() race condition bug: Through code
> inspection, we notice a potential problem in rte_timer_manage() that
> leads to corruption of per-lcore pending-lists (implemented as
> skip-lists). The race condition occurs when rte_timer_manage() expires
> multiple timers on lcore A, while lcore B simultaneously invokes
> rte_timer_reset() for one of the expiring timers (other than the first
> one).
> 
> Lcore A splits its pending-list, creating a local list of expired timers
> linked through their sl_next[0] pointers, and sets the first expired
> timer to the RUNNING state, all during one list-lock round trip.
> Lcore A then unlocks the list-lock to run the first callback, and that
> is when A and B can have different interpretations of the subsequent
> expired timers' true state. Lcore B sees an expired timer still in the
> PENDING state, atomically changes the timer to the CONFIG state, locks
> lcore A's list-lock, and reinserts the timer into A's pending-list.
> The two lcores try to use the same next-pointers to maintain both lists!
> 
> v2 changes:
> Move patch descriptions to their respective patches.
> Correct checkpatch warnings.

Applied, thanks