From patchwork Mon Mar 16 14:51:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Barbu X-Patchwork-Id: 45855 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 12CB82142A for ; Mon, 16 Mar 2015 14:52:07 +0000 (UTC) Received: by widex7 with SMTP id ex7sf8131071wid.2 for ; Mon, 16 Mar 2015 07:52:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=nd0LYe+WAZJBWx5rk7tHl2iLsKuGXiRx4nQmnCf7/mA=; b=g/qvKWRCDN9wHGEhtf0rosVuFaBlnK8FZproasSv6f0VtisCCuf6rkq3pBjyeCl7Ck 6/JCS0Ke64rN9jvw4DN40ISxM42KoT2i7FZ+AmGpvU3jRbLM1sv3LieshguKFWBlp6s7 7WDfjKYeeVHF8zsxantWh72s8cYi5II0KeNwpTplZct6rrM+PPSqdvBvjzTPDGrB58GR 9FHs/DytyXs2c2GQKrGR6ns7anRjmr+HwhBTSLpmCyVwN05E/GVqne2aAXHqJUO5HeeT EaStDLEXWP1tqAiPQTXSD2LbJ84ZXUKzQvc3grfT0SzjBEAyYycvyo74M/Zs4dD5ZkoU g/BQ== X-Gm-Message-State: ALoCoQkTkw/u0Ng3C+Pqht8/0N2h1ix6PA9V4jjBYNRlWRymGbufB2+BZEEv/mdA0xl+X2/hl5cd X-Received: by 10.152.19.67 with SMTP id c3mr7980436lae.7.1426517526354; Mon, 16 Mar 2015 07:52:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.121.70 with SMTP id li6ls648897lab.44.gmail; Mon, 16 Mar 2015 07:52:05 -0700 (PDT) X-Received: by 10.112.171.65 with SMTP id as1mr55839920lbc.45.1426517525745; Mon, 16 Mar 2015 07:52:05 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id cq11si8222575lad.134.2015.03.16.07.52.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2015 07:52:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbsy1 with SMTP id sy1so32626278lbb.1 for ; Mon, 16 Mar 2015 07:52:05 -0700 (PDT) X-Received: by 10.112.212.106 with SMTP id nj10mr36858503lbc.36.1426517525551; Mon, 16 Mar 2015 07:52:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2635121lbj; Mon, 16 Mar 2015 07:52:05 -0700 (PDT) X-Received: by 10.55.26.209 with SMTP id l78mr81948416qkh.60.1426517524794; Mon, 16 Mar 2015 07:52:04 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 9si10110376qgo.114.2015.03.16.07.52.03 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Mar 2015 07:52:04 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YXWN7-000261-20; Mon, 16 Mar 2015 14:52:01 +0000 Received: from mail-la0-f47.google.com ([209.85.215.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YXWMq-00024J-J0 for lng-odp@lists.linaro.org; Mon, 16 Mar 2015 14:51:44 +0000 Received: by labjg1 with SMTP id jg1so41992907lab.2 for ; Mon, 16 Mar 2015 07:51:39 -0700 (PDT) X-Received: by 10.112.110.231 with SMTP id id7mr55800882lbb.28.1426517498652; Mon, 16 Mar 2015 07:51:38 -0700 (PDT) Received: from cipriantemp.enea.se (sestofw01.enea.se. [192.36.1.252]) by mx.google.com with ESMTPSA id ps2sm2236822lbb.20.2015.03.16.07.51.37 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Mar 2015 07:51:38 -0700 (PDT) From: Ciprian Barbu To: lng-odp@lists.linaro.org Date: Mon, 16 Mar 2015 16:51:27 +0200 Message-Id: <1426517487-7124-4-git-send-email-ciprian.barbu@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1426517487-7124-1-git-send-email-ciprian.barbu@linaro.org> References: <1426517487-7124-1-git-send-email-ciprian.barbu@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 3/3] linux-generic: schedule: make sure SCHED queues get freed by the scheduler X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ciprian.barbu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 ODP_QUEUE_TYPE_SCHED queues only get marked as destroyed, they need to be removed from the pri_queues of the linux-generic scheduler Signed-off-by: Ciprian Barbu --- platform/linux-generic/odp_schedule.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index dd65168..8429bb9 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -153,6 +153,31 @@ int odp_schedule_term_global(void) for (i = 0; i < ODP_CONFIG_SCHED_PRIOS; i++) { for (j = 0; j < QUEUES_PER_PRIO; j++) { +#if 1 + odp_queue_t pri_q = sched->pri_queue[i][j]; + + for (;;) { + odp_event_t ev = odp_queue_deq(pri_q); + odp_buffer_t desc_buf; + queue_desc_t *desc; + odp_queue_t queue; + + desc_buf = odp_buffer_from_event(ev); + if (desc_buf == ODP_BUFFER_INVALID) { + break; + } + + desc = odp_buffer_addr(desc_buf); + queue = desc->queue; + /* Let deq_multi_destroy do the job */ + if (queue_is_destroyed(queue)) { + odp_queue_deq_multi(queue, + sched_local.ev, + MAX_DEQ); + } + } +#endif + if (odp_queue_destroy(sched->pri_queue[i][j])) { ODP_ERR("Sched term: Queue destroy fail.\n"); rc = -1;