From patchwork Thu Nov 24 08:24:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 83799 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp25438qgi; Wed, 23 Nov 2016 23:25:43 -0800 (PST) X-Received: by 10.200.41.100 with SMTP id z33mr655417qtz.154.1479972343367; Wed, 23 Nov 2016 23:25:43 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 40si14328067qtm.258.2016.11.23.23.25.43; Wed, 23 Nov 2016 23:25:43 -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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1264162D9F; Thu, 24 Nov 2016 07:25:43 +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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 5474062DA9; Thu, 24 Nov 2016 07:25:01 +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 E50C362CAC; Thu, 24 Nov 2016 07:24:57 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by lists.linaro.org (Postfix) with ESMTPS id A2D8162CAC for ; Thu, 24 Nov 2016 07:24:56 +0000 (UTC) Received: by mail-lf0-f54.google.com with SMTP id t196so21620608lff.3 for ; Wed, 23 Nov 2016 23:24:56 -0800 (PST) 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=4t1VrtpzRUUlzTg4aHytndntiz+WosqHMBfT53AyXeo=; b=Fwbhe8QAI7gy9DzMlBG+4y4hwla2ZNuqINAm9JUvNxWGV1eFmftCkroUDn2QrNJqU0 l1meDPSg8VCjzcjWS9ecDF+Cn0y97nFYAxrN6zul+5UEs3JLGxtXZwBA9ScmEU1Z9GTb qceEoOb5HCqhRJdgd9e4dxkxavu/YZshoaSCCTSkgvdiRcwvv5DTctfy95eM5736jaXQ vMlLHXelgg9LP3OHESTPxWU3R5vxWnLxHpVhKwbHIj3pvmUT51TEI9rXZAFiwt21HwMw QikJWpAM1xRVBk0fIMNzfWAxG6KPUKvA1JUi13xpKQ/d6NIODGnPBDb/9SsHTGZcq2yq B35Q== X-Gm-Message-State: AKaTC02gO+ObkFwglHWjQDVZ3/v3SHNc/+goSYW/LFSWnQ9TxfMwxjMhDv5kMuiK/Hfw1qY7Rnw= X-Received: by 10.46.69.136 with SMTP id s130mr500632lja.29.1479972295465; Wed, 23 Nov 2016 23:24:55 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id 37sm7794110lfw.31.2016.11.23.23.24.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Nov 2016 23:24:54 -0800 (PST) From: Christophe Milard To: maxim.uvarov@linaro.com, mike.holmes@linaro.org, bill.fischofer@linaro.org, lng-odp@lists.linaro.org Date: Thu, 24 Nov 2016 09:24:18 +0100 Message-Id: <1479975872-4945-2-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479975872-4945-1-git-send-email-christophe.milard@linaro.org> References: <1479975872-4945-1-git-send-email-christophe.milard@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv8 01/15] linux-gen: _ishm: fix for alignment request matching page size 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" There is no reason to toggle the _ODP_ISHM_SINGLE_VA flag when the alignment exactely matches the page size. This just results in wasting the odp-common virtual space Signed-off-by: Christophe Milard --- platform/linux-generic/_ishm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c index f4aa6d3..3371d94 100644 --- a/platform/linux-generic/_ishm.c +++ b/platform/linux-generic/_ishm.c @@ -756,7 +756,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, * the same address every where, otherwise alignment may be * be wrong for some process */ hp_align = align; - if (hp_align < odp_sys_huge_page_size()) + if (hp_align <= odp_sys_huge_page_size()) hp_align = odp_sys_huge_page_size(); else flags |= _ODP_ISHM_SINGLE_VA; @@ -777,7 +777,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, * size then we have to make sure the block will be mapped at * the same address every where, otherwise alignment may be * be wrong for some process */ - if (align < odp_sys_page_size()) + if (align <= odp_sys_page_size()) align = odp_sys_page_size(); else flags |= _ODP_ISHM_SINGLE_VA;