From patchwork Tue Jan 17 18:17:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 91707 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp598980qgi; Tue, 17 Jan 2017 09:20:46 -0800 (PST) X-Received: by 10.55.195.148 with SMTP id r20mr36338119qkl.45.1484673646758; Tue, 17 Jan 2017 09:20:46 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m70si17074312qki.44.2017.01.17.09.20.46; Tue, 17 Jan 2017 09:20:46 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1C34760EF5; Tue, 17 Jan 2017 17:20:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 87234609E7; Tue, 17 Jan 2017 17:18:51 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2F023609F8; Tue, 17 Jan 2017 17:18:44 +0000 (UTC) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) by lists.linaro.org (Postfix) with ESMTPS id 1513B609CE for ; Tue, 17 Jan 2017 17:18:39 +0000 (UTC) Received: by mail-lf0-f41.google.com with SMTP id v186so113807903lfa.1 for ; Tue, 17 Jan 2017 09:18:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bDYJLzAafV0FUzKzvfOb1iGMroNE87sbmM3er6megWg=; b=KrldZURqpW635cE9SDMpyJcHqssrwN6V1PAToizgD72i7lNaRO+lnk0z9LET23VN5c hl2QX7GI2OnbUFVP0NoyFjQF7TnF/YVPI92womu1Aiqwpnam19L3fNDSUjtMagO9Twir u+/m3AgBjwTYZ8UjpNN8zvZF/sbe9MJINGUp2PZ1us2yxKVi8l+hx9HxdpCG7VhZFfsY lHXM0t45tRyP7m8gTJ9Ll4E/17dDRCIKKY4aWV/Ca2XDtEqMG15lwTMzsErrw5kzB0BA v7aeIU6lM8QnJ9R4NvS4V+unUvHiNTSr1miw2XaNCklsoymL5mAUEPdtJ1P4jiLoPFtE esiw== X-Gm-Message-State: AIkVDXKuy1Qqz6pJLka7ogu2gOpzI65SlPoAYPywssWZzrQNT69VnIknp9NblrSDibZKWyzl8N4= X-Received: by 10.46.21.6 with SMTP id s6mr16110527ljd.73.1484673517781; Tue, 17 Jan 2017 09:18:37 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id 14sm9365278lju.16.2017.01.17.09.18.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 09:18:36 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, bill.fischofer@linaro.org, yi.he@linaro.org, forrest.shi@linaro.org, maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Tue, 17 Jan 2017 19:17:57 +0100 Message-Id: <1484677083-12831-1-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [lng-odp] [API-NEXT PATCHv8 0/6] small memory amount allocator for drv shm X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Since V7: -doxygen fix (Thanks Maxim!) Since V6: -rebased Since V5: -title fix (Yi) -rebased -flag name fix (Christophe) Since V4: -fix for clang Since V3: -copyright year changed Since V2: -comment and doxygen fixes (Petri) Since V1: -Common south pool (for all drivers) suppressed. (Petri) -function to create and destroy the pools exposed to the interface, so that each user create his own pools (Petri) -support for fixed size allocator added (Petri, Bill) -Creation parameter now includes the min-alloc/max_alloc (Petri) -Pool creation parameter passed as struct (Petri) This patch series aims at giving the ability for units using the ODP drv (south) interface to allocate small unit of memory (hence going lower than the page size, which is the lower limit for odp_drvshm_reserve()). South interface users can create and destroy pool of memory using odpdrv_shm_pool_create() odpdrv_shm_pool_destroy(). The interface also provides two functions: odpdrv_shm_pool_alloc() and odpdrv_shm_pool_free() whose usage is very similar to malloc/free, but which also guarantee address uniqueness amoung all ODP threads). Internally, for the linux-gen implementation, this is implemented thanks to a buddy and slab allocator handling the preallocated memory. Enumerators typically will need this to contruct the list of enumerated devices. ODP will also need it for building list of things such as enumerators, devio, drivers... (PS:I guess this concept will be needed as well on the north (API) interface when we start looking into having things working "in process mode") Christophe Milard (6): linux-gen: _ishm: adding buddy and slab allocation drv: adding odpdrv_shm_pool functions linux-gen: drv: shm: adding pool allocator test: drv: shm: adding basic buddy allocation tests test: drv: shm: adding basic fixed size allocation tests test: drv: shm: adding buddy allocation stress tests include/odp/drv/spec/shm.h | 99 +++ platform/linux-generic/Makefile.am | 2 + platform/linux-generic/_ishm.c | 14 +- platform/linux-generic/_ishmpool.c | 811 +++++++++++++++++++++ platform/linux-generic/drv_shm.c | 44 ++ .../linux-generic/include/_ishmpool_internal.h | 56 ++ .../linux-generic/include/odp/drv/plat/shm_types.h | 3 + .../common_plat/validation/drv/drvshmem/drvshmem.c | 355 +++++++++ .../common_plat/validation/drv/drvshmem/drvshmem.h | 3 + 9 files changed, 1386 insertions(+), 1 deletion(-) create mode 100644 platform/linux-generic/_ishmpool.c create mode 100644 platform/linux-generic/include/_ishmpool_internal.h -- 2.7.4