Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1258661

Re: [PATCH v2] um: net: replace GFP_KERNEL with GFP_ATOMIC when spinlock is held

From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject Re: [PATCH v2] um: net: replace GFP_KERNEL with GFP_ATOMIC when spinlock is held
Date 2015-10-29 09:50 +0100
Message-ID <qoR4d-6jD-5@gated-at.bofh.it> (permalink)
References <qnH6W-3es-15@gated-at.bofh.it> <qoPON-5DQ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am 29.10.2015 um 08:27 schrieb Saurabh Sengar:
> replace GFP_KERNEL with GFP_ATOMIC while spinlock is held,
> as code while holding a spinlock should be atomic.
> GFP_KERNEL may sleep and can cause deadlock,
> where as GFP_ATOMIC may fail but certainly avoids deadlock

As UML does not support SMP nor PREEMPT this is a non issue,
spinlocks are a NOP.
But for the sake of completeness you are right, the code needs
fixing.

> Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
> ---
> v2: correcting the subject
> 
>  arch/um/drivers/net_kern.c | 31 +++++++++++++++++++++++--------
>  1 file changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
> index f70dd54..7d4b709 100644
> --- a/arch/um/drivers/net_kern.c
> +++ b/arch/um/drivers/net_kern.c
> @@ -388,16 +388,22 @@ static const struct net_device_ops uml_netdev_ops = {
>  static int driver_registered;
>  
>  static void eth_configure(int n, void *init, char *mac,
> -			  struct transport *transport)
> +			  struct transport *transport, bool atomic)

Why do you need this atomic variable? Can't you just pass gfp_mask around?

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] um: net: replace GFP_KERNEL with GFP_ATOMIC when spinlock is held Saurabh Sengar <saurabh.truth@gmail.com> - 2015-10-29 08:30 +0100
  Re: [PATCH v2] um: net: replace GFP_KERNEL with GFP_ATOMIC when  spinlock is held Richard Weinberger <richard@nod.at> - 2015-10-29 09:50 +0100

csiph-web