From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id 8A76B1B620 for ; Fri, 13 Oct 2017 10:20:30 +0200 (CEST) Received: by mail-pf0-f176.google.com with SMTP id 17so9028926pfn.12 for ; Fri, 13 Oct 2017 01:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=ZNc4zESaaj3f7Lpba4aQkQ9LH/HvyYIK6Q9ywYxjj/g=; b=SO6B/9yxgU+NYh15EmuX8vSDQxMGUwHg3gFq8w/3rrkWAARMom+HqAveFY6yvdxQsg aPGsDEzM2qgIouvO7M8YCxilsB8gWRQ0TeTtLo99G6to8iCKdv8DxaKMEsjJMFb4ybM/ UldJ28i//ufwcX2P3z5rgCAF4LeyxyMmYUCjWHd8I1BqJQJsBUhAxUTDlFbv+W7/Wgx6 WLT0WUcC4M37i0+ww8JEPW382YC040w+zsAvw4ByPTxDZupSxqkQG9glng34JNkHedI9 Gfe3Y2/ySgz6qaCcOc0IR/Wbl2OE2otG00kXKcAfKwrpdTWPzG4LcAFaB8LCIRxQmjD1 ZAQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ZNc4zESaaj3f7Lpba4aQkQ9LH/HvyYIK6Q9ywYxjj/g=; b=FYK67VaKXQ7uxM9N4eCa7SHhowTpQTpCQLWJCV93gQx9AQ0E5F3612gzjVm/9jeCuY 8PyEnR1f0eWAoCIZQ/QZHnVx61y+ezREnXhS1eZE/id97vQ84QFGugMUQqup6bqSZiV+ lDyTz4pI6kPZRUefP4kzWhlyaHstLlk+2wuEqgv9/IvkEgDI36zdNmpLsRsd3MDvagY5 lsAXRahkMmBRReirhkTg6Fuo71XVAzI3NAMdW7tF3tFLUE0oGhzUEzsw1cNs/JB4kRHB BUu8h23OJxpJLRWdty+kmh7tAZf2C3o2jiVLqw2Hd77U9gm8aWIKXlSsYwi58rFXfkkB Pa2g== X-Gm-Message-State: AMCzsaUPuw04s5/lz7r3B7Ao/TX4JMSCbWl283KyGeaat2IGv6I027Em Ju0FucaKLiozg/C3fmjZvQc= X-Google-Smtp-Source: AOwi7QCN8LOSyfa5WQkZTwMntMJ9SWYDUQZ+7v7l06Whq/aO7+TbcrvliCMaicLi6Yucq5t3Neph3w== X-Received: by 10.99.123.83 with SMTP id k19mr660584pgn.338.1507882829771; Fri, 13 Oct 2017 01:20:29 -0700 (PDT) Received: from [0.0.0.0] (67.209.179.165.16clouds.com. [67.209.179.165]) by smtp.gmail.com with ESMTPSA id x1sm1522419pfk.131.2017.10.13.01.20.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 01:20:29 -0700 (PDT) To: Jianbo Liu , Jerin Jacob Cc: "Ananyev, Konstantin" , Olivier MATZ , "dev@dpdk.org" , "jia.he@hxt-semitech.com" , "jie2.liu@hxt-semitech.com" , "bing.zhao@hxt-semitech.com" References: <20171010095636.4507-1-hejianet@gmail.com> <20171012155350.j34ddtivxzd27pag@platinum> <2601191342CEEE43887BDE71AB9772585FAA859F@IRSMSX103.ger.corp.intel.com> <20171012172311.GA8524@jerin> <20171013014914.GA2067@jerin> <20171013073336.GB10844@arm.com> From: Jia He Message-ID: <90d60ff6-86e2-f5d1-eb8b-b50ab56c9349@gmail.com> Date: Fri, 13 Oct 2017 16:20:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171013073336.GB10844@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] ring: guarantee ordering of cons/prod loading when doing enqueue/dequeue 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: Fri, 13 Oct 2017 08:20:31 -0000 Hi On 10/13/2017 3:33 PM, Jianbo Liu Wrote: > The 10/13/2017 07:19, Jerin Jacob wrote: >> -----Original Message----- >>> Date: Fri, 13 Oct 2017 09:16:31 +0800 >>> From: Jia He >>> To: Jerin Jacob , "Ananyev, Konstantin" >>> >>> Cc: Olivier MATZ , "dev@dpdk.org" , >>> "jia.he@hxt-semitech.com" , >>> "jie2.liu@hxt-semitech.com" , >>> "bing.zhao@hxt-semitech.com" >>> Subject: Re: [PATCH] ring: guarantee ordering of cons/prod loading when >>> doing enqueue/dequeue >>> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 >>> Thunderbird/52.3.0 >>> >>> Hi >>> >>> >>> On 10/13/2017 9:02 AM, Jia He Wrote: >>>> Hi Jerin >>>> >>>> >>>> On 10/13/2017 1:23 AM, Jerin Jacob Wrote: >>>>> -----Original Message----- >>>>>> Date: Thu, 12 Oct 2017 17:05:50 +0000 >>>>>> >>> [...] >>>>> On the same lines, >>>>> >>>>> Jia He, jie2.liu, bing.zhao, >>>>> >>>>> Is this patch based on code review or do you saw this issue on any >>>>> of the >>>>> arm/ppc target? arm64 will have performance impact with this change. >>> sorry, miss one important information >>> Our platform is an aarch64 server with 46 cpus. >> Is this an OOO(Out of order execution) aarch64 CPU implementation? >> >>> If we reduced the involved cpu numbers, the bug occurred less frequently. >>> >>> Yes, mb barrier impact the performance, but correctness is more important, >>> isn't it ;-) >> Yes. >> >>> Maybe we can find any other lightweight barrier here? >> Yes, Regarding the lightweight barrier, arm64 has native support for acquire and release >> semantics, which is exposed through gcc as architecture agnostic >> functions. >> https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html >> http://preshing.com/20130922/acquire-and-release-fences/ >> >> Good to know, >> 1) How much overhead this patch in your platform? Just relative >> numbers are enough >> 2) As a prototype, Is Changing to acquire and release schematics >> reduces the overhead in your platform? >> > +1, can you try what ODP does in the link mentioned below? Sure, pls see the result: root@server:~/odp/test/linux-generic/ring# ./ring_main HW time counter freq: 20000000 hz _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory _ishm.c:880:_odp_ishm_reserve():No huge pages, fall back to normal pages. check: /proc/sys/vm/nr_hugepages. _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory  PKTIO: initialized loop interface.  PKTIO: initialized ipc interface.  PKTIO: initialized socket mmap, use export ODP_PKTIO_DISABLE_SOCKET_MMAP=1 to disable.  PKTIO: initialized socket mmsg,use export ODP_PKTIO_DISABLE_SOCKET_MMSG=1 to disable. _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory         ODP API version: 1.15.0         ODP implementation name:    "odp-linux"         ODP implementation version: "odp-linux" 1.15.0-0 (v1.15.0) 1.15.0.0      CUnit - A unit testing framework for C - Version 2.1-3      http://cunit.sourceforge.net/ Suite: ring basic   Test: ring_test_basic_create ...pktio/ring.c:177:_ring_create():Requested size is invalid, must be power of 2,and do not exceed the size limit 268435455 _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory _ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory passed   Test: ring_test_basic_burst ...passed   Test: ring_test_basic_bulk ...passed   Test: ring_test_basic_watermark ...passed_ishmphy.c:152:_odp_ishmphy_map():mmap failed:Cannot allocate memory Suite: ring stress   Test: ring_test_stress_1_1_producer_consumer ...passed   Test: ring_test_stress_1_N_producer_consumer ...passed   Test: ring_test_stress_N_1_producer_consumer ...passed   Test: ring_test_stress_N_M_producer_consumer ... Cheers, Jia >> Reference FreeBSD ring/DPDK style ring implementation through acquire >> and release schematics >> https://github.com/Linaro/odp/blob/master/platform/linux-generic/pktio/ring.c >> >> I will also spend on cycles on this. >> >> >>> Cheers, >>> Jia >>>> Based on mbuf_autotest, the rte_panic will be invoked in seconds. >>>> >>>> PANIC in test_refcnt_iter(): >>>> (lcore=0, iter=0): after 10s only 61 of 64 mbufs left free >>>> 1: [./test(rte_dump_stack+0x38) [0x58d868]] >>>> Aborted (core dumped) >>>> >>>> Cheers, >>>> Jia >>>>> >>>>>> Konstantin > -- > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. >