From patchwork Tue Mar 17 09:53:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Barbu X-Patchwork-Id: 45871 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 024442153C for ; Tue, 17 Mar 2015 09:54:14 +0000 (UTC) Received: by wevk48 with SMTP id k48sf827518wev.0 for ; Tue, 17 Mar 2015 02:54:13 -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=kyzrACq6prjRxxusgol2bqvf/5D9HBj41CnBchNQ1zo=; b=QvfYlS6M5l4tKxIFhC9jdn6y1W+Gknd6iSCp8H2dRXwhbHSsfc5IKEmc+rw/3wV828 s6dG5aqL72lamRGkJde6xa3naYtyx3lq9r0a1+LkUwMOdyvmyu3SEyWWI5MHreqoitXg oKoUCm8PXtTTiuJdOzeJWbPUo0TR9qJmN/u8bGT1Q/HTXlQFaF/PuFw7X6v0mgrrj2Cu FObr4NI7ZxhK4LcCpkdO95FF7NJ8yW8TT4xIg6zzdYYR/923wiulqHT7xj+XPegDHc8w BytA1C8///SZIzbhzSIG0JjBQfLMbIAGCQSg0hh/fGlfGEZRBveeaLg9kn2qTXbj36zP D2SQ== X-Gm-Message-State: ALoCoQmQMzcrLInoaa7xboVzrFz4rS1fuI4JEwQC2HqE5ELfkmxm62dv78QENKL3sHFIY5m7VZgC X-Received: by 10.112.13.228 with SMTP id k4mr9719357lbc.8.1426586053240; Tue, 17 Mar 2015 02:54:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.234 with SMTP id i10ls13154lae.103.gmail; Tue, 17 Mar 2015 02:54:12 -0700 (PDT) X-Received: by 10.112.64.193 with SMTP id q1mr59279943lbs.88.1426586052732; Tue, 17 Mar 2015 02:54:12 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id d9si10121689lah.156.2015.03.17.02.54.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 02:54:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by labjg1 with SMTP id jg1so3757925lab.2 for ; Tue, 17 Mar 2015 02:54:12 -0700 (PDT) X-Received: by 10.112.201.231 with SMTP id kd7mr38832611lbc.35.1426586052636; Tue, 17 Mar 2015 02:54:12 -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 h5csp393153lbj; Tue, 17 Mar 2015 02:54:11 -0700 (PDT) X-Received: by 10.140.98.243 with SMTP id o106mr77935257qge.99.1426586051327; Tue, 17 Mar 2015 02:54:11 -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 o8si6223324qcq.18.2015.03.17.02.54.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Mar 2015 02:54:11 -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 1YXoCO-0004eo-Ar; Tue, 17 Mar 2015 09:54:08 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YXoC7-0004dO-UC for lng-odp@lists.linaro.org; Tue, 17 Mar 2015 09:53:52 +0000 Received: by labjg1 with SMTP id jg1so3749585lab.2 for ; Tue, 17 Mar 2015 02:53:46 -0700 (PDT) X-Received: by 10.112.154.163 with SMTP id vp3mr34472981lbb.93.1426586026246; Tue, 17 Mar 2015 02:53:46 -0700 (PDT) Received: from cipriantemp.enea.se (sestofw01.enea.se. [192.36.1.252]) by mx.google.com with ESMTPSA id x4sm2708712lba.22.2015.03.17.02.53.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Mar 2015 02:53:45 -0700 (PDT) From: Ciprian Barbu To: lng-odp@lists.linaro.org Date: Tue, 17 Mar 2015 11:53:29 +0200 Message-Id: <1426586009-21519-4-git-send-email-ciprian.barbu@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1426586009-21519-1-git-send-email-ciprian.barbu@linaro.org> References: <1426586009-21519-1-git-send-email-ciprian.barbu@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 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.215.52 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 --- v2: - removed #if 1 and trailing whitespaces platform/linux-generic/odp_schedule.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index dd65168..18513da 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -153,6 +153,28 @@ int odp_schedule_term_global(void) for (i = 0; i < ODP_CONFIG_SCHED_PRIOS; i++) { for (j = 0; j < QUEUES_PER_PRIO; j++) { + 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); + } + } + if (odp_queue_destroy(sched->pri_queue[i][j])) { ODP_ERR("Sched term: Queue destroy fail.\n"); rc = -1;