From patchwork Thu Dec 20 09:32:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 10738705 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 E40CC13AD for ; Thu, 20 Dec 2018 09:32:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D11B928592 for ; Thu, 20 Dec 2018 09:32:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C263A28678; Thu, 20 Dec 2018 09:32:42 +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 4FF4528592 for ; Thu, 20 Dec 2018 09:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732997AbeLTJcl (ORCPT ); Thu, 20 Dec 2018 04:32:41 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:45962 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732833AbeLTJck (ORCPT ); Thu, 20 Dec 2018 04:32:40 -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 wBK9TQSI186580; Thu, 20 Dec 2018 09:32:33 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=DS+5mDALrXJUbu3CetWzGYwbSckprJ6Dq+WOB9FQ7ZY=; b=QYy8WwsEdf7ALeK7mQNdH1rC5edc3fhpEPEJW5j3DQjXmgVZVMQnklNyVJD2fCt7O5Z9 pAcEEbeWlzjpGPFDR7/teRL716UL73c3xihxfcuYyEGlIuyg98NZbuOKBWNNRFgJnmBB IL7NpW5JY6BS2JmAb/UZI8YsDhW9HYuz5bjt8xBNb4MtCtW4ZDHGoaxJ4YSxhaENWR2R HaXsSRLysdGNyDOMK+GJ1G+aZT/1g47QABgZGYM0vNuVFwPjNXwnJfg3kgKtHAYIulh3 h1oyDXHzZj5EnS3jPnndubspg3tB5e2IKKR3V2JW+S83+rNOeuuOIOvg/El0djEskanz Sw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2pfh3a65y7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Dec 2018 09:32:33 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wBK9WWhV024304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Dec 2018 09:32:32 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBK9WVZQ010069; Thu, 20 Dec 2018 09:32:31 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:32:31 -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 v1] IB/core: Warn if can't pin memory Date: Thu, 20 Dec 2018 11:32:21 +0200 Message-Id: <20181220093221.6624-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=961 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812200078 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 --- v0 -> v1: * Accept Leon's comment pr_err to pr_err_ratelimited --- 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..73f85cc35418 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_ratelimited("%s: Can't pin memory, requested %d, limit %d, ipc_lock off\n", + _func__, new_pinned, lock_limit); ret = -ENOMEM; goto out; }