From patchwork Tue Sep 11 14:00:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 146457 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3680261ljw; Tue, 11 Sep 2018 07:05:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZONexkhT+GM1pJbPhQk0Sw2IaOn53RH+vbq2gnLmPKf5Bbb+YP+qXBlT+AW48stbdGRF4N X-Received: by 2002:aed:2a13:: with SMTP id c19-v6mr19858244qtd.147.1536674731921; Tue, 11 Sep 2018 07:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536674731; cv=none; d=google.com; s=arc-20160816; b=BBDwvaUsXen/tRN3qkr/IrFA/sFzlT1DgDffXMG8TvNc41m99TCuJ6ELwwGXgqwya+ GDIFXQ7JXfg4+UDZyl+QY+BWe8sjy1+vv53sO/fLb0m64qwHd2sD5/97S5aJlUxdT2uj fjdffwPk01C78vZxmKig/7iOXzOfsfYUZWJYKnpGkLX4P43r0vzjGMk6Ug/G3GCJyuNg PlJJlpkfFtGltHDREcOyvdc1ICeWQCMCAen6Mq2s+B0YaxGOxp6xkBWufgreUm8axZ2P zZhxwVlPn9TN/MhuNMb/+zsIQqV9BxWPHFQ2oinhgMJ6ruFHyuADcrI9GYnIZ/cr7ssE mzNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to; bh=SS4g/QRXYFr215gSnfJe7699YRSnNHsmfNxPzgJ7ozY=; b=ZA+u4MzoiWwGSSUSn/ToWhKfrkIA/pHTM5ahlKIl8uQ9n2JhGd3rECEq1G8y8fpdy9 n+aX7qceZpSbN4ApawmOEzvZtJgfzGwWYD8Bz1rto2hAgicWJRVgF1t8+Kl1hgKf77+j QnwRp1SoewZGOqYsBzF9M6UJjk4CK0zACLrKq4VE26UscgNV8sFI5HHkYc1DQTNHmwDR Cxb3lC35o+HtbQuojXDpsSTYhoLkpB2Kc2dPqhj+7Jk4XR0QAVU4f1xoTVMpaOKMXidz oO98Coax7EWi1+4eD9lmD30BAFyh5qijsCg7KDH1MuhJxdkRPEHCsrQHMsjtHD4/VZRX pDLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id p33-v6si5067804qtd.201.2018.09.11.07.05.31; Tue, 11 Sep 2018 07:05:31 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 869F661C20; Tue, 11 Sep 2018 14:05:31 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW 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 8DA0261C28; Tue, 11 Sep 2018 14:02:21 +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 BACCE61C20; Tue, 11 Sep 2018 14:01:54 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 1375D61C05 for ; Tue, 11 Sep 2018 14:00:33 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward106j.mail.yandex.net (Yandex) with ESMTP id C8A8D1805613 for ; Tue, 11 Sep 2018 17:00:29 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2F46waNuvL-0T0K8Tpc; Tue, 11 Sep 2018 17:00:29 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mBghUNGHde-0RSq5fFL; Tue, 11 Sep 2018 17:00:27 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 11 Sep 2018 14:00:15 +0000 Message-Id: <1536674416-8465-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536674416-8465-1-git-send-email-odpbot@yandex.ru> References: <1536674416-8465-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 699 Subject: [lng-odp] [PATCH v1 5/6] linux-gen: sched: stash ring pointer 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" From: Petri Savolainen Save ring pointer into stash to avoid table lookups when releasing the atomic context. Signed-off-by: Petri Savolainen --- /** Email created from pull request 699 (psavol:master-sched-optim-clean-ups) ** https://github.com/Linaro/odp/pull/699 ** Patch: https://github.com/Linaro/odp/pull/699.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 32d7a11f22e6f2e1e378b653993c5377d4116d8f **/ platform/linux-generic/odp_schedule_basic.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 6ed1f8b49..77fee74dd 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -137,6 +137,7 @@ typedef struct ODP_ALIGNED_CACHE { uint16_t ev_index; uint32_t qi; odp_queue_t queue; + ring_t *ring; odp_event_t ev[BURST_SIZE_MAX]; } stash; @@ -604,10 +605,7 @@ static void schedule_pktio_start(int pktio_index, int num_pktin, static inline void release_atomic(void) { uint32_t qi = sched_local.stash.qi; - int grp = sched->queue[qi].grp; - int prio = sched->queue[qi].prio; - int spread = sched->queue[qi].spread; - ring_t *ring = &sched->prio_q[grp][prio][spread].ring; + ring_t *ring = sched_local.stash.ring; /* Release current atomic queue */ ring_enq(ring, sched->ring_mask, qi); @@ -990,8 +988,9 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], } else if (sync_ctx == ODP_SCHED_SYNC_ATOMIC) { /* Hold queue during atomic access */ - sched_local.stash.qi = qi; - sched_local.sync_ctx = sync_ctx; + sched_local.stash.qi = qi; + sched_local.stash.ring = ring; + sched_local.sync_ctx = sync_ctx; } else { /* Continue scheduling the queue */ ring_enq(ring, ring_mask, qi);