From patchwork Thu Oct 15 14:21:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 7407431 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AFE8FBEEA4 for ; Thu, 15 Oct 2015 15:57:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D00F42086C for ; Thu, 15 Oct 2015 15:57:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAA122086B for ; Thu, 15 Oct 2015 15:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbbJOP50 (ORCPT ); Thu, 15 Oct 2015 11:57:26 -0400 Received: from mail-qk0-f171.google.com ([209.85.220.171]:33691 "EHLO mail-qk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752237AbbJOP5Z (ORCPT ); Thu, 15 Oct 2015 11:57:25 -0400 Received: by qkas79 with SMTP id s79so41137806qka.0; Thu, 15 Oct 2015 08:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=o1zmLmDmumwjR30tTn2NyY7W2Z7AFOVPN/SXkyux77g=; b=IW/EQPm7622gM7B8xyx3v3Ln/9Y4K8rIecRpaNsA1b0YMSG9R1YmyBh/PlOuYm0036 MpZnMZYBkyCsvbBQ2zwKXe5dkzJ1g7Sl+/h0pZ7sUIrSj/DyiX0u7GZAnAquwOS/Ohsc ofEepfKQh/6DUCHMNFNqnSdAuIYBZpAxdP8qabzq64yVON5CFQFl4lbsBIsX2vUoaLlW AeTS+W/NRm9rsTGLHBnDZnOQTcGxYACasojfEdFxPVNVmGHCtHYulfnaf7i7HJg/w8vr RurgJutzI9AqqFbZ3+QJXCQqUqNPtVTM7m3kwnfxumHm6+jKzpEA1eFUk3HPAjKtOZsB 7irA== X-Received: by 10.194.191.161 with SMTP id gz1mr5081825wjc.0.1444924644546; Thu, 15 Oct 2015 08:57:24 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id vr10sm8690412wjc.38.2015.10.15.08.57.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 08:57:23 -0700 (PDT) From: j.glisse@gmail.com To: linux-kernel@vger.kernel.org Cc: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , , Haggai Eran , Sagi Grimberg , Shachar Raindel , Doug Ledford Subject: [PATCH] IB/core: Print error when umem fails due to locked memory limit. Date: Thu, 15 Oct 2015 10:21:56 -0400 Message-Id: <1444918916-17928-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jérôme Glisse It can be rather tedious to find why userspace is failing when only thing kernel report is -ENOMEM. This add an error message so that user can figure out why they are getting -ENOMEM. Signed-off-by: Jérôme Glisse cc: Cc: Haggai Eran Cc: Sagi Grimberg Cc: Shachar Raindel Cc: Doug Ledford --- drivers/infiniband/core/umem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index 38acb3c..a66929e 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -169,6 +169,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; if ((locked > lock_limit) && !capable(CAP_IPC_LOCK)) { + pr_err("locked memory quota exhausted (see ulimit -l)\n"); ret = -ENOMEM; goto out; }