linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Ledford <dledford@redhat.com>
To: j.glisse@gmail.com, linux-kernel@vger.kernel.org
Cc: "Jérôme Glisse" <jglisse@redhat.com>,
	linux-rdma@vger.kernel.org, "Haggai Eran" <haggaie@mellanox.com>,
	"Sagi Grimberg" <sagig@mellanox.com>,
	"Shachar Raindel" <raindel@mellanox.com>
Subject: Re: [PATCH] IB/core: Print error when umem fails due to locked memory limit.
Date: Thu, 15 Oct 2015 12:02:06 -0400	[thread overview]
Message-ID: <561FCDFE.5020001@redhat.com> (raw)
In-Reply-To: <1444918916-17928-1-git-send-email-j.glisse@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]

On 10/15/2015 10:21 AM, j.glisse@gmail.com wrote:
> From: Jérôme Glisse <jglisse@redhat.com>
> 
> 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 <jglisse@redhat.com>
> cc: <linux-rdma@vger.kernel.org>
> Cc: Haggai Eran <haggaie@mellanox.com>
> Cc: Sagi Grimberg <sagig@mellanox.com>
> Cc: Shachar Raindel <raindel@mellanox.com>
> Cc: Doug Ledford <dledford@redhat.com>
> ---
>  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;
>  	}
> 

This looks like it could easily cause a flood of messages (possibly even
enough to DoS the machine).  Please convert this to some sort of rate
limited output (preferably, you would issue this warning only once per
task, and the error would include the command name).

-- 
Doug Ledford <dledford@redhat.com>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

      reply	other threads:[~2015-10-15 16:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 14:21 [PATCH] IB/core: Print error when umem fails due to locked memory limit j.glisse-Re5JQEeQqe8AvxtiuMwx3w
2015-10-15 16:02 ` Doug Ledford [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561FCDFE.5020001@redhat.com \
    --to=dledford@redhat.com \
    --cc=haggaie@mellanox.com \
    --cc=j.glisse@gmail.com \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=raindel@mellanox.com \
    --cc=sagig@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).