From patchwork Tue Feb 24 12:24:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 44939 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 888B420502 for ; Tue, 24 Feb 2015 12:25:00 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id r20sf14699289wiv.3 for ; Tue, 24 Feb 2015 04:24:59 -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=ePgivae7mO4/WOgJqjaw6YEY5JiUJWYd5S4ACCPJKMI=; b=SqBg1DFQdCGoBAKK+m3vpi3q9rpYYF20bFIuwNMZ+mKObkKtg/QZTqjnMBmYH9TCsF O5Bbz/30KtD/uZAqf/NPuIpkw6lUsBg7anHqlynWUEOZFIiwIZoQfVL/MBKhhesjgikS IE1uGMbrhndqZa43ocL5CjCFS17DQoNt8xKJuhjmynlmdQPNU/NThl07jvYE4VDPwQg4 0jZb94E0xltvgymvRqo5mHRXYKz9ajDDZ4yfRqPZkgAKQZJVgT0If04X9JLW3pGJVEMm m33z1O5UKzkEYcGdoUeK6gXJTvq+XnLnA3I5NqvieKLo7sj+xvK3hIBiqR5ecjKwdySE e5OA== X-Gm-Message-State: ALoCoQmTBoxj7rkFpp4BUbbX3SMroNIohfBg77IqAE7PHt9DbsFNXWes7D+l5crp/6sQKpbIRvE3 X-Received: by 10.180.94.134 with SMTP id dc6mr2053148wib.2.1424780699816; Tue, 24 Feb 2015 04:24:59 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.101 with SMTP id lv5ls673685lac.22.gmail; Tue, 24 Feb 2015 04:24:59 -0800 (PST) X-Received: by 10.152.6.100 with SMTP id z4mr13992829laz.114.1424780699649; Tue, 24 Feb 2015 04:24:59 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id kv18si26513439lbb.19.2015.02.24.04.24.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 04:24:59 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labgf13 with SMTP id gf13so2591767lab.0 for ; Tue, 24 Feb 2015 04:24:59 -0800 (PST) X-Received: by 10.112.188.165 with SMTP id gb5mr14436366lbc.35.1424780699490; Tue, 24 Feb 2015 04:24:59 -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 h5csp1875476lbj; Tue, 24 Feb 2015 04:24:58 -0800 (PST) X-Received: by 10.140.165.198 with SMTP id l189mr35986981qhl.93.1424780697595; Tue, 24 Feb 2015 04:24:57 -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 n9si15153077qhb.0.2015.02.24.04.24.54 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 04:24:57 -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 1YQEXk-0000Wg-PC; Tue, 24 Feb 2015 12:24:52 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQEXa-0000UL-Lu for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 12:24:42 +0000 Received: by labge10 with SMTP id ge10so25148355lab.12 for ; Tue, 24 Feb 2015 04:24:37 -0800 (PST) X-Received: by 10.112.181.41 with SMTP id dt9mr3770823lbc.56.1424780677080; Tue, 24 Feb 2015 04:24:37 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id zo8sm649738lbc.37.2015.02.24.04.24.35 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Feb 2015 04:24:36 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 15:24:07 +0300 Message-Id: <1424780647-10250-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1424780647-10250-1-git-send-email-maxim.uvarov@linaro.org> References: <1424780647-10250-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 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.46 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 --- 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 251bf97..602e42f 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -209,7 +209,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("shm_open failed\n"); return ODP_SHM_INVALID; } } else { @@ -221,7 +221,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 already used\n"); return ODP_SHM_INVALID; } @@ -235,7 +235,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("no more blocks\n"); return ODP_SHM_INVALID; } @@ -250,14 +250,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("ftruncate huge pages failed\n"); 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("\n" + "\tNo huge pages, fall back to normal pages.\n" + "\tCheck: /proc/sys/vm/nr_hugepages\n"); } else { block->alloc_size = alloc_hp_size; block->huge = 1; @@ -271,7 +273,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("ftruncate failed\n"); return ODP_SHM_INVALID; } @@ -279,7 +281,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("mmap failed\n"); return ODP_SHM_INVALID; } else { block->alloc_size = alloc_size;