From patchwork Thu Nov 5 18:02:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 56071 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp552767lbr; Thu, 5 Nov 2015 10:03:01 -0800 (PST) X-Received: by 10.55.72.85 with SMTP id v82mr9314791qka.3.1446746581669; Thu, 05 Nov 2015 10:03:01 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w194si5407096qha.90.2015.11.05.10.03.01; Thu, 05 Nov 2015 10:03:01 -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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id 4CEEC61B30; Thu, 5 Nov 2015 18:03:01 +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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 4EA7A61B6A; Thu, 5 Nov 2015 18:02:34 +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 80FD061B54; Thu, 5 Nov 2015 18:02:17 +0000 (UTC) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by lists.linaro.org (Postfix) with ESMTPS id C109761B30 for ; Thu, 5 Nov 2015 18:02:15 +0000 (UTC) Received: by obdgf3 with SMTP id gf3so72400693obd.3 for ; Thu, 05 Nov 2015 10:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LIYybZgjxfSKKzTcL21KSUaH7O8NILMe4kmXlPcRsOE=; b=1BkLBK7kyvWaeR7vkmSNrJ0jyLrVLu9wfS/nBKj7uH8L7MOR18n7tAGCifTIa+OEnt zilXyqGQ/ID25HHjW89nuxz+GAFiypM3GMnzwXDrpTxwcgagjlW2sYytdLpIcXXVaXXE pzAGpYIrxrvt1IcA+WVF7LyxoABBDjRtZaSVnIetLtyr+r+GM21sdhPVO0YEwQdKsD8o ZjSEQN14kzc4+et3xzjtxQ3tJDoxARHSfNLqDcOBTjxMsw3KISoSoq0y/oIUYEV5QlvA h+slVTBoR7DqcyHtXRAadrPVtscmaEFsoR0n+k/Vh89IVNsxZ+2ifneCAaiaydqbQ/ex P6ww== 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:in-reply-to :references; bh=LIYybZgjxfSKKzTcL21KSUaH7O8NILMe4kmXlPcRsOE=; b=jppO7jX7ZxynPBd53RN/tGCOaFpe5l1Wd3qjQnUKxYcd0XUNcQWb8pyeKOFlWUPSjM QGE3llIXgNU+5wdYc67SSSFfGUU5hGGm5xxxfNrSThQe0KDWURVWAunTp8ncllGzn7Cp 0gmNRookOqO8D6RdanabPYArSElVPYIAfPBnHK3BhFHWABPT0SwQQtvqsJ5agXthL2Ii ach3a430FGY8ocU2SgTEzRy/qLnEqWJBiHzOYilqPqI4pYMClMDo/+LZiJnehuCKGIAS tcJyiY0m05mQYoOtLDTVK/YPFccTH/QuVQu0DKqAJcxUIyKghaQLA7A3VvdOEucITezj QaXw== X-Gm-Message-State: ALoCoQkvfQkh/7nAeMkStJNTo/tojbyHq+YTniSHqNCau6kj2uMR1QBwiuQp26xaz/abmQAJRIDI X-Received: by 10.182.81.5 with SMTP id v5mr5880882obx.78.1446746535275; Thu, 05 Nov 2015 10:02:15 -0800 (PST) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id s5sm3072789oie.12.2015.11.05.10.02.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Nov 2015 10:02:14 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 5 Nov 2015 12:02:08 -0600 Message-Id: <1446746528-25786-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446746528-25786-1-git-send-email-bill.fischofer@linaro.org> References: <1446746528-25786-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/2] linux-generic: pool: accelerate buffer allocation marking 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Since we're now caching the local thread ID for cache management, use this copy for buffer allocation marking as well to avoid unneeded calls to odp_thread_id() Signed-off-by: Bill Fischofer --- platform/linux-generic/include/odp_pool_internal.h | 2 -- platform/linux-generic/odp_pool.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 94bf1fa..fb51119 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -214,7 +214,6 @@ static inline odp_buffer_hdr_t *get_buf(struct pool_entry_s *pool) } odp_atomic_inc_u64(&pool->poolstats.bufallocs); - myhead->allocator = odp_thread_id(); } return (void *)myhead; @@ -276,7 +275,6 @@ static inline void *get_local_buf(local_cache_t *buf_cache, } buf_cache->bufallocs++; - buf->allocator = odp_thread_id(); /* Mark buffer allocated */ } return buf; diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 9fd64d6..638b387 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -520,6 +520,9 @@ odp_buffer_t buffer_alloc(odp_pool_t pool_hdl, size_t size) } } + /* Mark buffer as allocated */ + buf->buf.allocator = local_id; + /* By default, buffers inherit their pool's zeroization setting */ buf->buf.flags.zeroized = pool->s.flags.zeroized;