Re: [PATCH v2] IB/core: Warn if can't pin memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 20, 2018 at 12:05:31PM +0200, Yuval Shaia wrote:
> 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 <yuval.shaia@xxxxxxxxxx>
> ---
> v0 -> v1:
> 	* Accept Leon's comment pr_err to pr_err_ratelimited
> v1 -> v2:
> 	* Comments from Gal (d -> lu, _func__ -> __func__)
> ---
>  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..d6a66bd4f55a 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 %lu, limit %lu, ipc_lock off\n",
> +				   __func__, new_pinned, lock_limit);

The kernel shouldn't print when things hit like lock limits - nothing
else using lock limits does this.

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux