From patchwork Mon Aug 18 07:41:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shukla X-Patchwork-Id: 35481 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2262620676 for ; Mon, 18 Aug 2014 07:42:18 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf40488532pde.10 for ; Mon, 18 Aug 2014 00:42:17 -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:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=6o8iAqJvIkysbF+YIkdpDagU/Qz6dzGa5cGc1GCsCP8=; b=ID4wpiABmXXmxiuK/iaHTs59VqneyLMaheb9ayypBBx1k6DmJVFYtAdqlz8fpuqLkn z+kJt2xmeVIsf6s98u5OlroLkcUUrbRlm/3z4NHg+3p2D/3l/vxZ682vp+mBc62OKj/a W3bCl9iznqtjl6cdy/qTmUMgP+AM5oqIxayOx7ruT9hsyUbi44ULc8EQrmNKbZqViM2F dwIa8QbF9nZpz95WBi00wkJhACUa8WdWi7q8vcRCGxzS8qT20ggJrvDiFPYztF60Bmeu soOcSHHVULiMGDDfgnKZYXuWn36nGsTJhbToI0d4iZNQK3+DnSQPYSmdPifKdddj9PRb lFcQ== X-Gm-Message-State: ALoCoQn8bqZCZMFYOp9kymvqY1Ih6SGN8EzCNNJKd6p6hxERM46AHTy5+fz8NgWN0pWseN9d+OAc X-Received: by 10.66.252.69 with SMTP id zq5mr17568665pac.29.1408347735568; Mon, 18 Aug 2014 00:42:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.39.148 with SMTP id v20ls1473166qgv.93.gmail; Mon, 18 Aug 2014 00:42:15 -0700 (PDT) X-Received: by 10.52.119.229 with SMTP id kx5mr3801778vdb.40.1408347735458; Mon, 18 Aug 2014 00:42:15 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id cb8si6938582vcb.36.2014.08.18.00.42.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 00:42:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id le20so5414946vcb.28 for ; Mon, 18 Aug 2014 00:42:15 -0700 (PDT) X-Received: by 10.220.86.72 with SMTP id r8mr348069vcl.36.1408347735370; Mon, 18 Aug 2014 00:42:15 -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.221.37.5 with SMTP id tc5csp131484vcb; Mon, 18 Aug 2014 00:42:14 -0700 (PDT) X-Received: by 10.224.123.8 with SMTP id n8mr53774192qar.40.1408347734792; Mon, 18 Aug 2014 00:42:14 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id u10si23073730qge.63.2014.08.18.00.42.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Aug 2014 00:42:14 -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-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XJHa1-0002wJ-KB; Mon, 18 Aug 2014 07:42:13 +0000 Received: from mail-pa0-f53.google.com ([209.85.220.53]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XJHZw-0002w2-Sq for lng-odp@lists.linaro.org; Mon, 18 Aug 2014 07:42:08 +0000 Received: by mail-pa0-f53.google.com with SMTP id rd3so7295185pab.40 for ; Mon, 18 Aug 2014 00:42:03 -0700 (PDT) X-Received: by 10.70.103.8 with SMTP id fs8mr37150596pdb.81.1408347723366; Mon, 18 Aug 2014 00:42:03 -0700 (PDT) Received: from santosh-Latitude-E5530-non-vPro.mvista.com ([111.93.218.67]) by mx.google.com with ESMTPSA id kk1sm15344746pbd.61.2014.08.18.00.42.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 00:42:02 -0700 (PDT) From: Santosh Shukla To: lng-odp@lists.linaro.org Date: Mon, 18 Aug 2014 13:11:45 +0530 Message-Id: <1408347705-22886-1-git-send-email-santosh.shukla@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Topics: patch Subject: [lng-odp] [PATCH 2/2] isolation: disable default odp cpuset 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: santosh.shukla@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.220.169 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 - Disable default odp thread cpuset. Use is-cpu-isolated.sh script to create cpuset for dplane, cplane for odp. - Use odp-on-isolated-cpu.sh script to test this application. - test script location [1] - Refer readme for instruction to use. [1] https://git.linaro.org/people/santosh.shukla/test-definitions.git/shortlog/refs/heads/isol-v2 Signed-off-by: Santosh Shukla --- example/isolation/odp_isolation.c | 5 +++++ example/isolation/readme | 20 ++++++++++++++++++++ platform/linux-generic/odp_linux.c | 12 ++++++++++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 example/isolation/readme diff --git a/example/isolation/odp_isolation.c b/example/isolation/odp_isolation.c index 8d8fffc..1ade4c7 100644 --- a/example/isolation/odp_isolation.c +++ b/example/isolation/odp_isolation.c @@ -214,6 +214,11 @@ int main(int argc, char *argv[]) thr_id = odp_thread_create(0); odp_init_local(thr_id); + /* + * create dummy dp thread and don't pin them on any core, + * use odp-on-isolated-cpu.sh script to define dplane cpuset + * and to pin, run app on them, Refer readme. + */ for (i=0; i +#define NO_HZ_FULL_ISOL /* + * don't use odp cpuset. + * enable this for odp isolation mode + */ + typedef struct { int thr_id; void *(*start_routine) (void *); @@ -49,7 +54,9 @@ void odp_linux_pthread_create(odp_linux_pthread_t *thread_tbl, int num, int first_core, void *(*start_routine) (void *), void *arg) { int i; +#ifndef NO_HZ_FULL_ISOL cpu_set_t cpu_set; +#endif odp_start_args_t *start_args; int core_count; int cpu; @@ -62,16 +69,17 @@ void odp_linux_pthread_create(odp_linux_pthread_t *thread_tbl, int num, memset(thread_tbl, 0, num * sizeof(odp_linux_pthread_t)); for (i = 0; i < num; i++) { + cpu = (first_core + i) % core_count; +#ifndef NO_HZ_FULL_ISOL pthread_attr_init(&thread_tbl[i].attr); CPU_ZERO(&cpu_set); - cpu = (first_core + i) % core_count; CPU_SET(cpu, &cpu_set); pthread_attr_setaffinity_np(&thread_tbl[i].attr, sizeof(cpu_set_t), &cpu_set); - +#endif start_args = malloc(sizeof(odp_start_args_t)); memset(start_args, 0, sizeof(odp_start_args_t)); start_args->start_routine = start_routine;