From patchwork Thu Dec 20 09:04:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 10738683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C0266C2 for ; Thu, 20 Dec 2018 09:04:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B7A7286B0 for ; Thu, 20 Dec 2018 09:04:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E071286B4; Thu, 20 Dec 2018 09:04:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17457286B0 for ; Thu, 20 Dec 2018 09:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728426AbeLTJEY (ORCPT ); Thu, 20 Dec 2018 04:04:24 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:56430 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbeLTJEY (ORCPT ); Thu, 20 Dec 2018 04:04:24 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBK8xNXi163760; Thu, 20 Dec 2018 09:04:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2018-07-02; bh=hS4obODKFHxlQ3KaMD/f+TgM8+0iP/K68hkS6qeVJ60=; b=0C8IAfLaL1Cj4cxhIzv0WhLRXaL4POPfgKhLXFkcvly0OCCPjsZyrU4OpPSsYpLX+9a7 B9im4FnGH4nlOz5gDWztC8TnOI2ayqk10sMhkUTNwK/yzfawjFJ6laHblUc7ZDof2rTW /R3uout5WKNKPs5RgD4nL63WQQ0FFcyvPm2kGM0/GU2N6eVcuzFL424o30JYaRVJM+dT NjuikZksHP9H+anemmL6lZxm5VZMZ0nHzig32k363Kchl9ZfZma/MX3a/qVYzxfxi36c 5X4wP9jYO3NWyHob+u3YXbxPEYplKB/ObVDMMzwYlN/7GxQbWht3lUq3dv172H03gRFV CA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2pfh3a62dm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Dec 2018 09:04:17 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wBK94GSa021494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Dec 2018 09:04:16 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wBK94FJL007904; Thu, 20 Dec 2018 09:04:15 GMT Received: from lap1.nl.oracle.com (/10.175.19.37) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 20 Dec 2018 01:04:15 -0800 From: Yuval Shaia To: dledford@redhat.com, jgg@ziepe.ca, leon@kernel.org, yuval.shaia@oracle.com, jackm@dev.mellanox.co.il, parav@mellanox.com, linux-rdma@vger.kernel.org Subject: [PATCH] IB/core: Warn if can't pin memory Date: Thu, 20 Dec 2018 11:04:07 +0200 Message-Id: <20181220090407.5920-1-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9112 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=878 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812200075 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When memory registration is needed for page count which exceeds the allowed lock limit the function exits with an error but no error is printed. Since this is a case that system administrator can fix (rlimit etc) we need to give an alert. This is not a data patch so performance penalty is not a consideration. Signed-off-by: Yuval Shaia --- drivers/infiniband/core/umem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index c6144df47ea4..e213e7e3a277 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -164,6 +164,8 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, if (check_add_overflow(mm->pinned_vm, npages, &new_pinned) || (new_pinned > lock_limit && !capable(CAP_IPC_LOCK))) { up_write(&mm->mmap_sem); + pr_err("%s: Can't pin memory, req %ld, lmt %ld ipc_lock off\n", + __func__, new_pinned, lock_limit); ret = -ENOMEM; goto out; }