From patchwork Thu Feb 26 19:42:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 45203 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7886420674 for ; Thu, 26 Feb 2015 19:43:27 +0000 (UTC) Received: by wghl18 with SMTP id l18sf10006445wgh.3 for ; Thu, 26 Feb 2015 11:43:26 -0800 (PST) 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=upZQcULyg6HF5PCT70auzzm4oZXa+HsBW2EvYqflQyE=; b=KpA/AgsofaBnq49UTOCj4gR0JPB8GkKKFoA1IgLf9n0UyaMaNDy46zcHJfQCffvIAU zSd42fSHKYjABffGyanEuSt692rx0rGKQAt6BK+WZDtN+snpN+Ejc+z/LIgNYv2UmS4b zLz7e+itH3o5tH7uJ7TuA6wiopQ2IeSr5+drmM96Hq0SHNHTkDjm9VlnsqPz8Gb+UhbA np+pm8kXOAzYdNZXXmVuVWh0wqZkVnnf6o/1AYELAl1WFYGF2Q3TGhwsNBCUTw30rwYr jK8WJDvA+boXustzXLIWbLB1yQvIbZ1UKjGIKIFYLDj1SqTGwFcdUhDCrIfKF5fO72Sw 9KHA== X-Gm-Message-State: ALoCoQlXobYM63xfs3uCliW6iqrZ5xwrWtBgn5F8aPOG5L/y0Mo8780/i7zm1RhypNgj+l4iMIp0 X-Received: by 10.180.182.44 with SMTP id eb12mr3968477wic.4.1424979806797; Thu, 26 Feb 2015 11:43:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.4 with SMTP id f4ls34554lah.18.gmail; Thu, 26 Feb 2015 11:43:26 -0800 (PST) X-Received: by 10.112.12.228 with SMTP id b4mr9214065lbc.83.1424979806560; Thu, 26 Feb 2015 11:43:26 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id c10si1422596lab.0.2015.02.26.11.43.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 11:43:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lams18 with SMTP id s18so13219493lam.13 for ; Thu, 26 Feb 2015 11:43:26 -0800 (PST) X-Received: by 10.112.185.66 with SMTP id fa2mr9063584lbc.117.1424979806460; Thu, 26 Feb 2015 11:43:26 -0800 (PST) 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 h5csp3515903lbj; Thu, 26 Feb 2015 11:43:25 -0800 (PST) X-Received: by 10.140.22.234 with SMTP id 97mr20536070qgn.52.1424979805042; Thu, 26 Feb 2015 11:43:25 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id g47si1800378qge.6.2015.02.26.11.43.23 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Feb 2015 11:43:25 -0800 (PST) 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 1YR4LB-0004Et-Sa; Thu, 26 Feb 2015 19:43:21 +0000 Received: from mail-la0-f44.google.com ([209.85.215.44]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YR4L3-0004Cv-JT for lng-odp@lists.linaro.org; Thu, 26 Feb 2015 19:43:13 +0000 Received: by labhs14 with SMTP id hs14so13264336lab.4 for ; Thu, 26 Feb 2015 11:43:08 -0800 (PST) X-Received: by 10.152.183.165 with SMTP id en5mr9594906lac.0.1424979787649; Thu, 26 Feb 2015 11:43:07 -0800 (PST) Received: from localhost.localdomain (broadband-46-188-125-102.2com.net. [46.188.125.102]) by mx.google.com with ESMTPSA id n9sm398494lbp.0.2015.02.26.11.43.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Feb 2015 11:43:06 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 26 Feb 2015 22:42:58 +0300 Message-Id: <1424979778-20444-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1424979778-20444-1-git-send-email-maxim.uvarov@linaro.org> References: <1424979778-20444-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 2/2] linux-generic: reword messages for odp_shm_reserve 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: maxim.uvarov@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.48 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 "mmap HP failed" is confusing message. It's not error it's just debug hint that memory will be allocated with normal pages, not huge pages. Also all ODP_DBG and etc macro already print function name, no need to have it in message. Signed-off-by: Maxim Uvarov Reviewed-by: Mike Holmes --- v2: add name to debug message as Mike asked. platform/linux-generic/odp_shared_memory.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 9f6ce1e..f995168 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -212,7 +212,7 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, fd = shm_open(name, oflag, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (fd == -1) { - ODP_DBG("odp_shm_reserve: shm_open failed\n"); + ODP_DBG("%s: shm_open failed.\n", name); return ODP_SHM_INVALID; } } else { @@ -224,7 +224,7 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, if (find_block(name, NULL)) { /* Found a block with the same name */ odp_spinlock_unlock(&odp_shm_tbl->lock); - ODP_DBG("odp_shm_reserve: name already used\n"); + ODP_DBG("name \"%s\" already used.\n", name); return ODP_SHM_INVALID; } @@ -238,7 +238,7 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, if (i > ODP_SHM_NUM_BLOCKS - 1) { /* Table full */ odp_spinlock_unlock(&odp_shm_tbl->lock); - ODP_DBG("odp_shm_reserve: no more blocks\n"); + ODP_DBG("%s: no more blocks.\n", name); return ODP_SHM_INVALID; } @@ -253,14 +253,16 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, if ((flags & ODP_SHM_PROC) && (ftruncate(fd, alloc_hp_size) == -1)) { odp_spinlock_unlock(&odp_shm_tbl->lock); - ODP_DBG("odp_shm_reserve: ftruncate HP failed\n"); + ODP_DBG("%s: ftruncate huge pages failed.\n", name); return ODP_SHM_INVALID; } addr = mmap(NULL, alloc_hp_size, PROT_READ | PROT_WRITE, map_flag | MAP_HUGETLB, fd, 0); if (addr == MAP_FAILED) { - ODP_DBG("odp_shm_reserve: mmap HP failed\n"); + ODP_DBG(" %s:\n" + "\tNo huge pages, fall back to normal pages,\n" + "\tcheck: /proc/sys/vm/nr_hugepages.\n", name); } else { block->alloc_size = alloc_hp_size; block->huge = 1; @@ -274,7 +276,7 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, if ((flags & ODP_SHM_PROC) && (ftruncate(fd, alloc_size) == -1)) { odp_spinlock_unlock(&odp_shm_tbl->lock); - ODP_ERR("odp_shm_reserve: ftruncate failed\n"); + ODP_ERR("%s: ftruncate failed.\n", name); return ODP_SHM_INVALID; } @@ -282,7 +284,7 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, map_flag, fd, 0); if (addr == MAP_FAILED) { odp_spinlock_unlock(&odp_shm_tbl->lock); - ODP_DBG("odp_shm_reserve: mmap failed\n"); + ODP_DBG("%s mmap failed.\n", name); return ODP_SHM_INVALID; } else { block->alloc_size = alloc_size;