Re: [PATCH rdma-next 0/4] Convert AH and SRQ to core allocation

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

 



On Tue, Mar 26, 2019 at 04:56:12PM +0200, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> 
> Hi,
> 
> This is continuation of our conversion from driver allocations to core
> responsibility. Current series converts SRQ and AH, while latter
> required some code preparation.
> 
> The most challenge was in supporting AH to be allocated with GFP_ATOMIC
> or GFP_KERNEL according to context. The common solution is to use in_atomic()
> and in_interrupt() already used in many drivers, but unfortunately
> checkpatch produces warning.
> 
> WARNING: use of in_atomic() is incorrect outside core kernel code
> #37: FILE: include/rdma/ib_verbs.h:2288:
> +               (in_atomic() || in_interrupt()) ? GFP_ATOMIC : GFP_KERNEL))

Looks like it doesn't work anyhow:

commit 691d77b6b85c20e4166bafd12bd0131b28f95a16
Author: Andy Whitcroft <apw@xxxxxxxxxxxx>
Date:   Tue Jan 6 14:41:16 2009 -0800

    checkpatch: add checks for in_atomic()
    
    in_atomic() is not for driver use so report any such use as an ERROR.
    Also in_atomic() is often used to determine if we may sleep, but it is not
    reliable in this use model therefore strongly discourage its use.

So you need to pass flags

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