From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mta113.f1.k8.com.br (mta113.f1.k8.com.br [187.73.32.185]) by dpdk.org (Postfix) with ESMTP id AE4C3235 for ; Tue, 7 Aug 2018 15:24:42 +0200 (CEST) Received: from [192.168.1.4] (pool-173-48-214-200.bstnma.fios.verizon.net [173.48.214.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtpz.f1.k8.com.br (Postfix) with ESMTPSA id BB8FE8015A; Tue, 7 Aug 2018 13:24:35 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.6.8 smtpz.f1.k8.com.br BB8FE8015A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digirati.com.br; s=default; t=1533648280; bh=wJLCW2qgidbyK8dgoaYGOKvrStT3G/RByclMeLJWYUM=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=vmQ6bTiwKvhTWqOffB3UH1xF4z52SQaMm/18WWgZNySTncidspljONHHQIgw/ebBa 3ftqcCEPx6PASWzarh0TpTLBHJh7G7uYgJ6N9YvbcVDtvEbfLw5AjS3aqgL3Sr8Wh8 6bJ/w5w4sTNY3x9Bqy6NBJugluJFXdG//AXLwsVk= To: Stephen Hemminger Cc: "Wang, Yipeng1" , "Wiles, Keith" , "Fu, Qiaobin" , "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev@dpdk.org" , "Doucette, Cody, Joseph" , "Gobriel, Sameh" , "Tai, Charlie" References: <20180728174851.46422-1-qiaobinf@bu.edu> <5CCC4983-8B4F-480B-B6E1-3A01806BC416@intel.com> <7E249D4F-3CAA-4EDB-936D-4DFAEA55F0D8@bu.edu> <8a2eb96f-bf40-a6af-c22c-072f915e063e@digirati.com.br> <76a8c325-2fc0-b805-015c-97d6cba83a58@digirati.com.br> <20180803082410.53078d0a@xeon-e3> From: Michel Machado Organization: Digirati Internet LTDA. Message-ID: Date: Tue, 7 Aug 2018 09:24:32 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180803082410.53078d0a@xeon-e3> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 08 Aug 2018 15:37:28 +0200 Subject: Re: [dpdk-dev] [PATCH] hash table: add a bucket iterator function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 13:24:43 -0000 On 08/03/2018 11:24 AM, Stephen Hemminger wrote: > Often for time based cleanup it is better to have a second linked list that is ordered > by time value. Then the cleanup code can start at the oldest stop when it reaches > the last item that could expire. > > That does mean having some form of lock and doing delete/insert on every usage. > > i.e > spinlock(&timer_lock); > TAILQ_REMOVE(&timer_list, entry, timer_list); > entry->expiration = new time; > TAILQ_INSERT_TAIL(&timer_list, entry, timer_list); > spinunlock(&timer_unlock); We'll try it. Thanks for the suggestion, Stephen. [ ]'s Michel Machado